add OpenRouter as option for inferences#147
Open
adrienlacombe wants to merge 4 commits intoConway-Research:mainfrom
Open
add OpenRouter as option for inferences#147adrienlacombe wants to merge 4 commits intoConway-Research:mainfrom
adrienlacombe wants to merge 4 commits intoConway-Research:mainfrom
Conversation
- Add openrouterApiKey to AutomatonConfig, createConfig, and createInferenceClient - Route models with provider/model format (e.g. openai/gpt-4o) to OpenRouter - Use Bearer auth and https://openrouter.ai/api endpoint - Prompt for OpenRouter key in setup wizard Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
The upstream InferenceRouter selected models exclusively from DEFAULT_ROUTING_MATRIX, which only contains OpenAI model IDs. config.inferenceModel was completely ignored, so setting an OpenRouter model like "minimax/minimax-m2.5" had no effect. - Add overrideModel field to InferenceRequest - InferenceRouter.route() uses overrideModel first (if set and enabled) - loop.ts registers non-baseline models (those with "/" in the ID) into the ModelRegistry after initialize() which would otherwise disable them - loop.ts passes config.inferenceModel as overrideModel for OpenRouter models Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… ID heuristic Replace the "/" model-ID check with config.openrouterApiKey as the signal for both registering the model and passing it as overrideModel to InferenceRouter. This is more explicit and matches what is configured in automaton.json. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Instead of fighting the routing matrix (which only knows OpenAI models), call inference.chat() directly when openrouterApiKey is configured. inference.chat() already routes correctly: if model contains "/" and openrouterApiKey is set, it hits https://openrouter.ai/api. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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.
No description provided.