Skip to content

feat(providers): add Cheaper Inference API provider - #2172

Open
aiapienthusiast wants to merge 1 commit into
org2AI:developfrom
aiapienthusiast:cheaperinference-provider
Open

aiapienthusiast wants to merge 1 commit into
org2AI:developfrom
aiapienthusiast:cheaperinference-provider

Conversation

@aiapienthusiast

Copy link
Copy Markdown

Problem

ORG2 has no built-in entry for Cheaper Inference.
Cheaper Inference is an OpenAI-compatible LLM gateway.
One API key gives access to models from several labs.
Today a user must use the generic Custom provider and type the base URL and protocol by hand.

Solution

Add cheaperinference_api as an API key provider.
It uses the same pattern as #503 (Atlas Cloud) and the current CherryIN registry shape.

  • Key vault: ModelType::CheaperinferenceApi, registry entry, endpoint table, protocols (openai default, anthropic optional), env var CHEAPERINFERENCE_API_KEY.
  • Validation: OpenAI-compatible validator path; listed with providers that have no public quota API.
  • Agent core: provider_id::CHEAPERINFERENCE, ProviderSpec, model type mapping, auxiliary model fallback list.
  • Frontend: schema literal, provider lists, icon mapping.
Endpoints

Potential risks

  • The Rust crates were not compiled locally (see Verification). Every new match arm sits next to the existing CherryinApi arm, so match exhaustiveness is the same as for CherryIN.
  • No brand icon is added. The tile uses the existing generic gateway icon (custom). A brand SVG can follow in a separate change.
  • No CLI agent pairing is added (Claude Code, OpenCode). Only the Rust harness uses the provider. This keeps the change small.
  • No screenshots: the tile is rendered by the existing registry-driven key vault UI; no layout or component changed.
  • No data migration. Existing keys and settings are not touched. Rollback is a plain revert.

Verification

  • rustfmt --edition 2021 --check on all 11 changed Rust files: pass.
  • Searched every CherryinApi / cherryin_api / provider_id::CHERRYIN use and added the new provider next to each one.
  • Changed .ts files stay under 700 lines (largest: 598).
  • Not run: cargo test for key_vault and agent_core, pnpm typecheck, pnpm lint:fast, app build. Reviewers or CI should run them.
  • Added test coverage in existing tests: api_providers_are_api_key_providers, as_str_round_trips_through_from_str, new_aggregators_are_openai_and_anthropic_capable, every_key_vault_model_type_maps_to_a_registered_provider_spec.

Submit checklist

  • I read and followed .github/PR_RULES.md.
  • The PR is focused and has a scoped Conventional Commit title, such as feat(scope): summary or fix(scope): summary.
  • I ran the relevant checks, or explained why they were not run.
  • No secrets, private config, generated output, or unrelated formatting changes are included.
  • Docs, screenshots, and locale updates are included when the change needs them.

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.

1 participant