Skip to content

feat: add Cheaper Inference as an open_code gateway provider - #165

Open
aiapienthusiast wants to merge 1 commit into
Agent-Field:mainfrom
aiapienthusiast:cheaperinference-provider
Open

aiapienthusiast wants to merge 1 commit into
Agent-Field:mainfrom
aiapienthusiast:cheaperinference-provider

Conversation

@aiapienthusiast

Copy link
Copy Markdown

Summary

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:

export CHEAPERINFERENCE_API_KEY="ci_live_..."
SWE_DEFAULT_MODEL=cheaperinference/gpt-5.4-mini

With only a CHEAPERINFERENCE_API_KEY set (no Anthropic key, no other gateway key, no SWE_DEFAULT_RUNTIME), the main paths auto-select open_code and default to cheaperinference/gpt-5.4-mini.
A gateway key already configured keeps precedence.

Validation

  • make check
  • Relevant manual test performed (if needed)

Behavior Impact

  • No behavior change
  • Backward compatible behavior change
  • Breaking change (explain below)

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: a cheaperinference (@ai-sdk/openai-compatible) provider with base URL https://api.cheaperinference.com/v1 and the chat model ids it declares.
  • swe_af/execution/schemas.py and go/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: pass CHEAPERINFERENCE_API_KEY to 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-mini returned a reply through the cheaperinference config's base URL, and every declared model id is a live text model from GET /v1/models.

This branch has not been deployed

No deployments
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.

Add Cheaper Inference as an open_code gateway provider

1 participant