Skip to content

Comments

add OpenRouter as option for inferences#147

Open
adrienlacombe wants to merge 4 commits intoConway-Research:mainfrom
adrienlacombe:main
Open

add OpenRouter as option for inferences#147
adrienlacombe wants to merge 4 commits intoConway-Research:mainfrom
adrienlacombe:main

Conversation

@adrienlacombe
Copy link

No description provided.

adrienlacombe and others added 4 commits February 20, 2026 19:34
- 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]>
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