Skip to content

feat: support dynamic OpenRouter models and improve shell integration#24

Open
aficiomaquinas wants to merge 1 commit intoforeveryh:mainfrom
aficiomaquinas:main
Open

feat: support dynamic OpenRouter models and improve shell integration#24
aficiomaquinas wants to merge 1 commit intoforeveryh:mainfrom
aficiomaquinas:main

Conversation

@aficiomaquinas
Copy link
Copy Markdown

English:
This PR introduces dynamic model support for OpenRouter, allowing users to use any model ID without them being hardcoded in the script. It also
improves the shell integration logic to be more robust.

Key Changes:

  • Dynamic OpenRouter Support: If a provider/model string contains a / (e.g., google/gemini-2.0-flash-001), it is now treated as a literal OpenRouter
    model ID.
  • Improved Fallback: Unknown providers now trigger a warning but allow the script to proceed using the input as a literal ID, making the tool
    future-proof.
  • Documentation: Updated README.md and README_CN.md with examples of dynamic usage.
  • Comment Consistency: Cleaned up comments to follow the project's En/Zh convention.

中文:
此 PR 为 OpenRouter 引入了动态模型支持,允许用户使用任何模型 ID,而无需在脚本中进行硬编码。同时改进了 shell 集成逻辑,使其更加健壮。

主要变更:

  • 动态 OpenRouter 支持:如果提供商/模型字符串包含 /(例如 google/gemini-2.0-flash-001),现在将其视为完整的 OpenRouter 模型 ID。
  • 改进的回退逻辑:未知的提供商现在会触发警告,但允许脚本继续将输入作为字面 ID 使用,使工具具备前瞻性。
  • 文档更新:更新了 README.md 和 README_CN.md,添加了动态用法的示例。
  • 注释一致性:清理了注释,遵循项目的英文/中文惯例。

Why?
AI models are released frequently. Hardcoding every provider makes the tool outdated quickly. This change allows users to use any new model on
OpenRouter immediately.

Testing performed:

  • Verified ccc xiaomi/mimo-v2-pro sets environment variables correctly.
  • Verified ccm open xiaomi/mimo-v2-pro works with the new fallback logic.
  • Checked that existing shorthands (ds, kimi, glm) still work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant