feat: add OrcaRouter as a named LLM provider - #296
Open
clementguarino06510-glitch wants to merge 1 commit into
Open
feat: add OrcaRouter as a named LLM provider#296clementguarino06510-glitch wants to merge 1 commit into
clementguarino06510-glitch wants to merge 1 commit into
Conversation
Add OrcaRouter as a first-class LLM provider alongside Anthropic, OpenAI, Amazon Bedrock, and Ollama in both the viewer's AI optimization assistant and the coz suggest-points agent. OrcaRouter exposes an OpenAI-compatible /v1/chat/completions endpoint, so the streaming path and the tool-calling agent mirror the existing OpenAI provider. Model ids are namespaced (e.g. openai/gpt-4o-mini, orcarouter/auto). - coz: ORCAROUTER_API_KEY in llm_config, /orcarouter-models endpoint, _stream_orcarouter for the /optimize streaming path, and _orcarouter_tool_request/_suggest_run_orcarouter_agent for suggest-points. - viewer: OrcaRouter entry in the provider selector, model dropdown fetch, fallback models, and settings persistence. - README: provider list, suggest-points table, and example. - Add orcarouter-live-test.py exercising the real code paths. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Add OrcaRouter as a named LLM provider
Coz supports an AI optimization assistant in the viewer and an LLM-powered
coz suggest-pointsagent, both backed by a small set of named providers (Anthropic, OpenAI, Amazon Bedrock, Ollama). This PR adds OrcaRouter as a first-class provider so Coz users can point either feature at OrcaRouter's OpenAI-compatible gateway without treating it as an anonymous custom base URL.OrcaRouter is an OpenAI-compatible AI gateway built for both models and agents. Like OpenRouter, it exposes a provider/model namespace across many models — but it also combines adaptive routing, automatic failover, zero-markup inference, observability, guardrails, and agent-tool governance behind the same endpoint. Adding it as a named provider means this project's users can use that stack directly. It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.
Changes mirror the existing OpenAI wiring (OrcaRouter exposes an OpenAI-compatible
/v1/chat/completionsendpoint; model ids are namespaced, e.g.openai/gpt-4o-miniororcarouter/auto):coz: readsORCAROUTER_API_KEYinllm_config, serves a/orcarouter-modelsendpoint that lists curated models from the gateway's catalog, adds_stream_orcarouterfor the viewer's/optimizestreaming path, and adds_orcarouter_tool_request/_suggest_run_orcarouter_agentfor thecoz suggest-pointstool-calling agent.viewer/: adds an OrcaRouter entry to the provider selector, wires the model dropdown to/orcarouter-modelswith fallback models, and persists the key in the existing cookie settings.README.md: adds OrcaRouter to the supported-providers list, thesuggest-pointsprovider table, and the usage examples.orcarouter-live-test.py: a script that exercises the new code paths (tool-calling request,/optimizestreaming,/orcarouter-models) against the live gateway.Verification:
python3 -m py_compile cozand the viewer TypeScript build (tsc) both pass./optimizestream produces a full streaming reply, and/orcarouter-modelslists the curated models.coz suggest-points --provider orcarouter --model openai/gpt-4o-mini --dry-runruns the full agent loop end-to-end.Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter
I'm an engineer on the OrcaRouter team.