Add OpenRouter as default LLM provider; make deprecated Gemini SDK optional#31
Merged
Conversation
- New OpenRouterProvider (stdlib urllib, OpenAI-compatible chat completions via openrouter.ai) with retry/backoff, usage-based cost tracking, and OpenRouterAPIError, mirroring existing providers. - Factory: openrouter first in auto-detect priority (OPENROUTER_API_KEY); config.py accepts and env-maps the new provider. - erdos_config.json default: openrouter + google/gemini-2.5-flash (was invalid chatgpt/gpt-5.4 combination). - google-generativeai demoted from core dependency to optional [gemini] extra; imports guarded so src.llm imports cleanly without it and Gemini tests skip instead of failing. - 19 new tests (tests/test_openrouter.py); suite green both with the SDK (333 passed, 9 skipped) and without (320 passed, 22 skipped). https://claude.ai/code/session_01KAKnLjpFZ9oF74GNW9QNtN
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.
What
Adds OpenRouter as the recommended/default provider (per owner direction: "just use openrouter") and untangles the deprecated Gemini SDK.
OpenRouterProvider(stdlib urllib, OpenAI-compatible chat completions) with transient-error retry/backoff, usage-based cost tracking, andOpenRouterAPIError, mirroring the existing provider patterns.OPENROUTER_API_KEYfirst;src/config.pyaccepts and env-maps the provider everywhere.erdos_config.jsondefault fixed: was an invalidchatgpt/gpt-5.4combination, nowopenrouter/google/gemini-2.5-flash.google-generativeai(officially deprecated by Google) demoted from core dependency to the optional[gemini]extra; imports guarded sosrc.llmimports cleanly without it and Gemini tests skip rather than fail.tests/test_openrouter.py.Verification
ERDOS_MOCK_MODE=1 python -m src.solver --manifest manifest.jsonstill degrades gracefully.OPENROUTER_API_KEY→OpenRouterProvider(model=google/gemini-2.5-flash).Part of the project-wide polish batch.
https://claude.ai/code/session_01KAKnLjpFZ9oF74GNW9QNtN
Generated by Claude Code