Repository navigation
feat: add Cheaper Inference as an open_code gateway provider - #165
Conversation
|
Thanks for this. Before we can merge it, please sign our CLA: https://cla-assistant.io/Agent-Field/SWE-AF?pullRequest=165 (the CLA bot didn't run on this PR when it was opened, so nobody had asked yet). I reviewed the change. The resolution chain matches Infron's in both Python and Go (I checked every key/env combination, and the two ports agree), and the new path only kicks in when Cheaper Inference is the only gateway key. Two things remain:
Once the CLA is signed I'll take care of the docs and any conflict myself if you'd rather not. |
Agent-Field#172 (Runcrate) landed first and touches the same 13 files. Resolved as unions: Runcrate stays first in the env example, compose files, manifests, opencode.json providers, README and tests, with the Cheaper Inference entries after it. Cheaper Inference is now the last gateway in the auto-selection order, so its *_only_env helper (Python and Go) also yields to a Runcrate key. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…heaper Inference The runtime tables in README, docs/deployment.md, docs/ARCHITECTURE.md and go/README.md only named Infron (and now Runcrate) as the gateway keys that auto-select open_code; add Cheaper Inference and its env row, and say that the earlier gateway key wins when several are set. Add CHEAPERINFERENCE_API_KEY to the tests that clear provider keys so an ambient key cannot change their result, and to the OpenRouter-precedence, runtime-override and QA-synthesizer model-resolution cases that already cover Runcrate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
CLA is in, so I took this over as said earlier. #172 (Runcrate) landed first and touched the same files, so I merged main and resolved it as a union: Runcrate stays first, and Cheaper Inference is last in the auto-select order, so its Python and Go helpers also yield to a One gap I'm leaving as a follow-up: the Go node only builds its direct AI config for gateways the pinned Go SDK knows (Runcrate and Infron are there), so with just a Cheaper Inference key the Go flagged-QA synthesis uses its deterministic fallback. That needs the SDK side. |
Summary
open_codegateway provider, next to Infron.Closes Add Cheaper Inference as an open_code gateway provider #164.
Cheaper Inference is an OpenAI-compatible LLM gateway.
One API key gives access to models from several labs.
Its model ids are bare (one level), so a role ref is the provider prefix plus a bare id:
With only a
CHEAPERINFERENCE_API_KEYset (no Anthropic key, no other gateway key, noSWE_DEFAULT_RUNTIME), the main paths auto-selectopen_codeand default tocheaperinference/gpt-5.4-mini.A gateway key already configured keeps precedence.
Validation
make checkBehavior Impact
Notes
Every new path is gated on a Cheaper Inference key being the only gateway key present, so existing deployments do not change.
Details
Files:
opencode.json: acheaperinference(@ai-sdk/openai-compatible) provider with base URLhttps://api.cheaperinference.com/v1and the chat model ids it declares.swe_af/execution/schemas.pyandgo/internal/config/resolve.go:_cheaperinference_only_env/cheaperInferenceOnlyEnv, the auto default constant, and the auto-select wiring..env.example,README.md,agentfield-package.yaml,go/agentfield-package.yaml: document the key.docker-compose*.yml: passCHEAPERINFERENCE_API_KEYto the services.tests/test_model_config.py,go/internal/config/config_test.go,tests/test_dockerfile.py: cover auto-select, precedence, overrides, and the provider entry.Live check: the default model
gpt-5.4-minireturned a reply through thecheaperinferenceconfig's base URL, and every declared model id is a live text model fromGET /v1/models.