Repository navigation
feat: add Cheaper Inference as an OpenAI-compatible provider - #629
Open
aiapienthusiast wants to merge 1 commit into
Open
aiapienthusiast wants to merge 1 commit into
aiapienthusiast wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Cheaper Inference provider, mirroring the existing Opper and Requesty providers.
The provider extends
OpenAI::ChatProviderand 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.
https://api.cheaperinference.com/v1CHEAPER_INFERENCE_API_KEYgpt-5.4-mini/v1/embeddings, through the sameOpenAI::Embedding::RequestTypeas OpperIt loads through the existing dynamic provider resolution (
service: "CheaperInference"tocheaper_inference_providertoCheaperInferenceProvider), so no registry or remap change is needed.Usage:
Details
Files:
lib/active_agent/providers/cheaper_inference_provider.rblib/active_agent/providers/cheaper_inference/options.rblib/active_agent/providers/cheaper_inference/_types.rbtest/providers/cheaper_inference/provider_loading_test.rbtest/providers/cheaper_inference/request_test.rbdocs/actions/mcps.md, next to the Opper rowsTests: provider loading and WebMock request tests (chat to
/v1/chat/completions, embeddings to/v1/embeddings,CHEAPER_INFERENCE_API_KEYfallback, bare model ids sent unchanged), in the shape of the Opper tests.Live check:
gpt-5.4-minireturned a reply throughPOST /v1/chat/completionsand an embedding model returned a vector throughPOST /v1/embeddings.