feat(openrouter): add stealth/union-alpha to the model cost map - #41576
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
|
bugbot run |
|
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3d0fd12. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TLDR
Problem this solves:
stealth/union-alphais missing from the cost mapHow it solves it:
openrouter/stealth/union-alphato the cost map and its backup copyGET https://openrouter.ai/api/v1/models: 262,144 context, 131,072 max completion tokens, $0 in/out, text+image input, tools, tool_choice, response_formatUser Flow
Before: a developer routing to Union Alpha through the gateway gets a working answer but the model is unknown to the gateway
model: openrouter/stealth/union-alphaand anOPENROUTER_API_KEY"model": "union-alpha"and gets a 200 with a normal completionmax_input_tokens: null,supports_vision: nullandsupports_function_calling: null, and SDK users callingcompletion_coston the response getThis model isn't mapped yetAfter: the same request is priced and described
max_input_tokens: 262144,max_output_tokens: 131072,supports_vision: true,supports_function_calling: trueand $0 pricing, andcompletion_costreturns0.0Relevant issues
Affected release
Linear ticket
Resolves LIT-7988
Closes LIT-7988
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more (no test file touched; verified via live proxy below)@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Live calls against OpenRouter with a real key, through both the SDK and a running proxy. Before runs on a worktree at the merge base (port 4001), After runs on the PR tip (port 4000), both started with
LITELLM_LOCAL_MODEL_COST_MAP=True python litellm/proxy/proxy_cli.py --config config.yamlwhere config.yaml has one deployment,model_name: union-alpha->model: openrouter/stealth/union-alphaSource row, fetched with
curl -s https://openrouter.ai/api/v1/modelson 2026-09-17:Commands (run once per port):
Before (merge base, port 4001)
SDK at the merge base,
litellm.completion(model='openrouter/stealth/union-alpha', ...)returnsunion alpha okbutlitellm.completion_cost(completion_response=r)raisesValueError: This model isn't mapped yet. Add it here - https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.jsonAfter (3d0fd12, port 4000)
SDK at the PR tip, same
litellm.completioncall returnsunion alpha okwith usage 24/7 andlitellm.completion_cost(completion_response=r)returns0.0Type
New Feature
Caveats (if any)
Low
Final Attestation
Link to Devin session: https://app.devin.ai/sessions/1bb1affe356b4dd795450e529e2cff25
Open in Devin Desktop: https://app.devin.ai/desktop/session/1bb1affe356b4dd795450e529e2cff25?variant=devin