Repository navigation
Conversation
Signed-off-by: Nicho Deng <nicho810d@gmail.com>
63a38bc to
efa303f
Compare
|
👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push. Commits that are not verified: See GitHub's guide on signing commits for setup instructions. I've added |
|
👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push.\n\nCommits that are not verified: |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the cheapaimodel provider addition.
No open issues 🎉
What changed in this PR
Adds cheapaimodel as a built-in OpenAI-compatible provider through the centralized provider catalog, reusing existing alias handling without introducing a new client implementation.
Changes:
- Configures the endpoint,
CHEAPAIMODEL_API_KEYdiscovery, default model, and consecutive system-message merging. - Extends alias and automatic-selection tests, with exemptions for models absent from models.dev.
- Adds configuration examples, provider documentation, navigation, and schema-description updates.
| File | Description |
|---|---|
pkg/model/provider/openai/system_message_merge_test.go |
Tests system-message merging for the alias. |
pkg/model/provider/openai_alias_providers_test.go |
Adds shared alias request and compatibility coverage. |
pkg/model/provider/catalog/providers.json |
Registers the endpoint, credentials, default model, and merge behavior. |
pkg/model/provider/catalog_test.go |
Exempts the provider from models.dev catalog matching. |
pkg/config/examples_test.go |
Allows example models absent from models.dev. |
pkg/config/auto_test.go |
Tests credential discovery and automatic model selection. |
examples/README.md |
Lists the new provider recipe. |
examples/cheapaimodel.yaml |
Adds a named-model assistant example with tools. |
docs/providers/overview/index.md |
Lists the provider and its authentication variable. |
docs/providers/cheapaimodel/index.md |
Documents setup, models, parameter restrictions, and attachment capabilities. |
docs/data/nav.yml |
Adds provider navigation. |
docs/configuration/models/index.md |
Includes the alias in provider and custom-header documentation. |
agent-schema.json |
Adds the alias to the provider description. |
Review effort: Balanced
Summary
cheapaimodel, base URLhttps://api.cheapaimodel.ai/v1), in the same shape as the Runcrate and Atlas Cloud aliasesCHEAPAIMODEL_API_KEYfor automatic model selection and credential forwarding, withdeepseek-v4-1-flashas the default modelcheapaimodel is a pay-per-token API gateway for open-weight models (DeepSeek, GLM, Kimi) and Grok, billed from a prepaid USD balance, through an OpenAI-compatible Chat Completions API. I work on cheapaimodel. It is not in models.dev yet (anomalyco/models.dev#11684 is open), so it gets the same exemptions as
runcrateandatlascloudinTestProviderIDsMatchEmbeddedCatalogandmodelsDevAbsentProviders, and the docs page says that no catalog metadata is imported. Since #4755 the alias is a single entry inpkg/model/provider/catalog/providers.json, placed afterruncrate.The docs page also notes that
kimi-k3only acceptstemperature0.6 or 1 andtop_p0.95, and which models take image input (users opt in withcapabilities, since there is no catalog metadata).Testing
go vet ./pkg/model/provider/... ./pkg/config/...: cleango test ./pkg/model/provider/... ./pkg/config/... ./cmd/root/...: all 33 packages pass, includingTestOpenAIAliasProvider_EndToEndRequest/cheapaimodel,TestProviderIDsMatchEmbeddedCatalog/cheapaimodel,TestAliases_MergeConsecutiveSystemMessages/cheapaimodel,TestAutoModelConfig/cheapaimodel_providerand the three example checks forexamples/cheapaimodel.yamldocker-agent run --execwithcheapaimodel/<model>returns the expected reply fordeepseek-v4-1-flash,glm-5.3,glm-5.3-flash,kimi-k3andgrok-4.7. With afilesystemtoolset, all five callread_fileand answer from the result;deepseek-v4-1-flashsometimes streams its last text in the same chunk asfinish_reasonand usage, which the runtime drops today, fixed separately in fix(runtime): keep text and reasoning streamed in the terminal chunk #4765.