# Bailian Model Recommend

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-modelstudioai-skills-bailian-model-recommend`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [modelstudioai](https://agentstack.voostack.com/s/modelstudioai)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [modelstudioai](https://github.com/modelstudioai)
- **Source:** https://github.com/modelstudioai/skills/tree/main/skills/bailian-model-recommend
- **Website:** https://modelstudioai.github.io/skills/

## Install

```sh
agentstack add skill-modelstudioai-skills-bailian-model-recommend
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 百炼模型推荐

从阿里云百炼平台模型库中，根据用户场景推荐最合适的模型并提供调用示例代码。

## 适用场景

**显式选型：**
- "推荐一个模型"、"选哪个模型"、"用什么模型好"
- "帮我对比一下XX和XX模型"

**隐式选型（用户描述想做的事，隐含需要选模型）：**
- "我想做一个XX"（客服机器人、翻译工具、代码助手...）
- "帮我实现XX功能"（图片生成、语音合成、文本摘要...）
- "怎么用 AI 来做XX"、"大模型能做XX吗"
- "XX场景有什么方案"、"我想接入XX能力"

**技术选型：**
- "XX和XX哪个更适合做YY"
- "低成本/高并发/高精度 场景怎么选"

**不适用：**
- 用户已确定模型，只问怎么调用 → 直接给调用代码
- 纯粹查询模型参数/价格 → 使用 bailian-docs-llm-wiki skill

**与 bailian-docs-llm-wiki 的边界：** 当用户同时涉及模型查询和模型选择时，优先使用本 skill（本 skill 内部会读取模型数据完成推荐）。仅当用户已确定模型、只需查参数/价格/调用方式时，由 bailian-docs-llm-wiki 处理。

## 前置检查

执行推荐前确认依赖的 `bailian-docs-llm-wiki` skill 已安装且数据可用。

**检测逻辑：**

1. 检查 `bailian-docs-llm-wiki` skill 是否已安装（通过查找已安装 skill 目录中是否存在 `bailian-docs-llm-wiki/models/models.jsonl`）
2. 如果未安装，执行安装：`npx skills add modelstudioai/skills --skill bailian-docs-llm-wiki -y`

安装失败则告知用户并中止。**禁止在没有数据的情况下凭记忆推荐模型。**

## 推荐流程

### 第一步：理解需求（Agent 直接完成，不输出给用户）

从用户描述中快速提取结构化需求信息。JSON 结构定义见 [references/requirement-schema.md](references/requirement-schema.md)，推断规则见 [references/capability-codes.md](references/capability-codes.md)。

**要快：** 简单字段映射，不做复杂推理。如果需求不清晰，直接追问具体场景，不输出中间分析。

### 第二步：筛选候选

从 `models/models.jsonl` 和 `models/groups/.json` 中综合筛选匹配的模型（10~50 个），结构化字段和语义信息同时参与筛选：

1. 去除历史快照版本（如 `model-2025-04-28`），只保留主版本
2. 按模态过滤（输入/输出模态必须兼容）
3. 按能力、特性、上下文窗口、质量定位评分排序
4. 读取 group 文件的 description（group 级 + item 级），将场景关键词（如"科研"、"代码"、"长文本"、"客服"）与用户需求做语义匹配，提升匹配模型的排序
5. 同一家族最多保留少量模型，避免同质化
6. 候选不足时放宽过滤条件

数据源字段说明见 [references/data-source.md](references/data-source.md)。

### 第三步：精选推荐

从候选列表中选出 3 个推荐：

| 位置 | 策略 |
| --- | --- |
| 推荐 #1（最佳推荐） | 最符合用户预算和质量偏好的最佳模型 |
| 推荐 #2（次优选择） | 另一个档次的模型，说明与 #1 的 tradeoff |
| 推荐 #3（备选参考） | 不同视角的选择，说明场景差异 |

**排序逻辑：**

- 用户要省钱 → #1 必须是性价比最高的，不是旗舰
- 用户要最好 → #1 必须是能力最强的旗舰
- 用户无倾向 → #1 选综合匹配度最高的
- 推荐最适合场景的，不是最强的；偏好从用户表达中推断，不预设倾向

**约束：**

- 理由必须关联用户具体需求（禁止"性能强大"等空话），三条理由角度不同
- 有定价信息时结合预算权衡，帮用户做成本决策
- 避免推荐同家族多个模型，优先稳定版本
- 提供多档次选择和 tradeoff 说明，由用户自己决定

**pipeline 场景：** 相邻步骤的模型模态必须兼容，不兼容时添加提示。

### 第四步：输出推荐结果

对每个推荐模型，读取对应的 group JSON 文件（`models/groups/.json`）获取 `samples` 字段中的调用示例代码。示例代码获取方式和输出格式见 [references/samples-format.md](references/samples-format.md)。

用自然语言直接输出推荐（如"根据你的需求，我推荐以下模型..."），每个模型包含：

1. **模型名称和 ID**
2. **推荐理由** — 关联用户具体需求，附 tradeoff 对比
3. **亮点** — 关键优势标签
4. **规格信息** — 上下文窗口、最大输出、定价（如有）
5. **调用示例代码** — 从 group 文件的 samples 字段获取（优先 openai.python，同时提供 curl）

**输出约束：**

- 不暴露内部流程术语（禁止出现"Stage"、"意图画像"、"候选召回"、"精排"等词汇）
- 所有推荐基于 `bailian-docs-llm-wiki` 的实际数据，不凭记忆推荐

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [modelstudioai](https://github.com/modelstudioai)
- **Source:** [modelstudioai/skills](https://github.com/modelstudioai/skills)
- **License:** Apache-2.0
- **Homepage:** https://modelstudioai.github.io/skills/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-modelstudioai-skills-bailian-model-recommend
- Seller: https://agentstack.voostack.com/s/modelstudioai
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
