Skip to content

feat: add Cheaper Inference as an OpenAI-compatible provider - #629

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

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

Conversation

@aiapienthusiast

Copy link
Copy Markdown

Adds a Cheaper Inference provider, mirroring the existing Opper and Requesty providers.
The provider extends OpenAI::ChatProvider and reuses the OpenAI Chat request, response and transform pipeline unchanged.

Cheaper Inference is an OpenAI-compatible LLM gateway.
One API key gives access to models from several labs.

  • Base URL: https://api.cheaperinference.com/v1
  • API key: CHEAPER_INFERENCE_API_KEY
  • Model ids: bare names such as gpt-5.4-mini
  • Embeddings: /v1/embeddings, through the same OpenAI::Embedding::RequestType as Opper

It loads through the existing dynamic provider resolution (service: "CheaperInference" to cheaper_inference_provider to CheaperInferenceProvider), so no registry or remap change is needed.

Usage:

cheaper_inference:
  service: "CheaperInference"
  api_key: <%= ENV["CHEAPER_INFERENCE_API_KEY"] %>
  model: "gpt-5.4-mini"
Details

Files:

  • lib/active_agent/providers/cheaper_inference_provider.rb
  • lib/active_agent/providers/cheaper_inference/options.rb
  • lib/active_agent/providers/cheaper_inference/_types.rb
  • test/providers/cheaper_inference/provider_loading_test.rb
  • test/providers/cheaper_inference/request_test.rb
  • README install block and the MCP provider support table in docs/actions/mcps.md, next to the Opper rows

Tests: provider loading and WebMock request tests (chat to /v1/chat/completions, embeddings to /v1/embeddings, CHEAPER_INFERENCE_API_KEY fallback, bare model ids sent unchanged), in the shape of the Opper tests.

Live check: gpt-5.4-mini returned a reply through POST /v1/chat/completions and an embedding model returned a vector through POST /v1/embeddings.

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