Metadata-Version: 2.4
Name: recommend-model
Version: 0.1.0
Summary: Probe free-tier LLM quotas and one-click configure QianWen free models for OpenClaw/Codex
Author: recommend-model contributors
License-Expression: MIT
Project-URL: Homepage, https://pypi.org/project/recommend-model/
Project-URL: Documentation, https://platform.qianwenai.com/docs/api-reference/preparation/cli#usage-free-tier
Keywords: llm,qianwen,dashscope,openclaw,codex,free-tier,quota,probe
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# recommend-model (rmodel)

探测商用大模型可用性，并一键把**千问免费额度模型**写入 OpenClaw / Codex。

> 可用性探测 ≠ 账单状态。`qwen-free` 以 [千问 CLI `usage free-tier`](https://platform.qianwenai.com/docs/api-reference/preparation/cli#usage-free-tier) 为准。

## 安装（PyPI）

```bash
pip install recommend-model
rmodel --help
```

升级：

```bash
pip install -U recommend-model
```

开发安装：

```bash
git clone <your-repo>
cd recommend-model
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
```

只需本机有 **Node.js / npm（>=18）**。`rmodel qwen-free` 会在需要时自动：

1. `npm install -g @qianwenai/qianwen-cli`
2. 拉起 `qianwen auth login`（浏览器授权）
3. 拉取免费额度模型并写入 OpenClaw / Codex

## 一键配置千问免费模型

```bash
rmodel qwen-free
```

可选：

```bash
rmodel qwen-free --dry-run
rmodel qwen-free --set-primary --agent main
rmodel qwen-free --api-key sk-xxx
rmodel qwen-free --no-install
rmodel qwen-free --no-login
rmodel qwen-free --yes
```

| 场景 | 行为 |
|------|------|
| 已有 DashScope/千问 **API** provider | 复用 Key，补充最多 5 个仍有免费额度的模型选项 |
| 没有 API provider | 引导创建/填写 API Key，新建 `dashscope` provider 并写入 |
| 订阅 Plan（`qianwen-plan` 等） | 不当作 API 配置复用 |

`qianwen auth login`（CLI 会话）与 DashScope **API Key** 是两套凭证。  
API Key 控制台：https://bailian.console.aliyun.com/?tab=model#/api-key

## 通用探测

```bash
rmodel probe --source openclaw
rmodel apply --target openclaw --agent main --to dashscope/qwen-plus
```

## 发布到 PyPI（维护者）

```bash
pip install -e ".[dev]"
python -m build
twine check dist/*
TWINE_USERNAME=__token__ TWINE_PASSWORD=pypi-... twine upload dist/*
```

## 开发

```bash
pytest
```
