Skip to content

feat: add UnoRouter as an OpenAI-compatible provider#32673

Open
0-don wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
0-don:feat/add-unorouter-provider
Open

feat: add UnoRouter as an OpenAI-compatible provider#32673
0-don wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
0-don:feat/add-unorouter-provider

Conversation

@0-don

@0-don 0-don commented Jul 9, 2026

Copy link
Copy Markdown

Relevant issues

None (provider addition, same shape as the merged Gonka24/darkbloom additions).

Summary

Adds UnoRouter as an OpenAI-compatible chat completions provider.

  • Provider: unorouter
  • Base URL: https://api.unorouter.com/v1
  • API key env: UNOROUTER_API_KEY
  • Get a key: https://unorouter.com/token (free signup via Discord/GitHub, no card)

UnoRouter is a fully open-source gateway (github.com/unorouter) serving 200+ models; models with a :free suffix are a genuine free tier (priced 0 in the added entries).

Changes

  • litellm/llms/openai_like/providers.json: unorouter registry entry
  • model_prices_and_context_window.json: 8 model entries (unorouter/<model>) with pricing and context limits from the live pricing API (https://unorouter.com/api/models/pricing)
  • provider_endpoints_support.json: endpoints entry

Pre-Submission checklist

  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have added meaningful tests (data-only registry addition, no code paths changed; follows the same test-less shape as prior openai_like provider additions)
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)

Screenshots / Proof of Fix

Smoke-tested live against the endpoint (real calls):

Chat completions (non-stream):

curl -s -X POST https://api.unorouter.com/v1/chat/completions \
  -H "Authorization: Bearer $UNOROUTER_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"step-3.7-flash:free","messages":[{"role":"user","content":"Say OK"}],"max_tokens":16}'
# -> choices + usage present

Streaming with stream_options.include_usage:

data: {"id":"stream-1783628747823","object":"chat.completion.chunk","created":1783628747,"model":"nvidia/step-3.7-flash","choices":[],"usage":{"prompt_tokens":14,"completion_tokens":16,...}}
data: [DONE]

GET /v1/models also live (returns the full catalog) for model discovery.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This is a pure data PR that registers UnoRouter as a new OpenAI-compatible provider, following the same shape as recent openai_like additions. No production code paths are changed.

  • providers.json: adds the unorouter registry entry with base URL, API key env vars, and declared supported endpoints.
  • model_prices_and_context_window.json: adds 8 model entries (4 free-tier with :free suffix) with pricing sourced from UnoRouter's live pricing API.
  • provider_endpoints_support.json: adds the UnoRouter endpoint-capability entry; responses and embeddings are marked true but were not smoke-tested in the PR (noted in prior review).

Confidence Score: 4/5

Safe to merge once the open question about unverified endpoint claims (from the prior review thread) is resolved; the data-only change carries no risk to existing code paths.

All three files are pure data additions with no code logic changes, so regression risk is minimal. The only open item is that responses: true and embeddings: true in provider_endpoints_support.json and /v1/responses + /v1/embeddings in providers.json were not verified with live calls, as noted in the prior review thread. Until those endpoints are confirmed or removed, users routing embeddings or Responses-API traffic to unorouter could hit runtime errors.

provider_endpoints_support.json and litellm/llms/openai_like/providers.json — both claim responses and embeddings support that is unverified; model_prices_and_context_window.jsonclaude-sonnet-5 carries supports_adaptive_thinking: true without confirmation that UnoRouter forwards extended-thinking parameters correctly.

Important Files Changed

Filename Overview
litellm/llms/openai_like/providers.json Adds unorouter registry entry following the established openai_like pattern; supported_endpoints lists /v1/responses and /v1/embeddings whose support has not been verified against the live API (flagged in prior review thread)
model_prices_and_context_window.json Adds 8 unorouter model entries with pricing and context limits; unorouter/claude-sonnet-5 claims supports_adaptive_thinking: true — this is the first non-native-Anthropic provider to carry this flag, and actual extended-thinking behaviour via the OpenAI-like path is unverified
provider_endpoints_support.json Adds unorouter endpoint support entry; marks responses: true and embeddings: true without verified live evidence beyond chat completions (prior thread)

Reviews (2): Last reviewed commit: "fix: add supports_adaptive_thinking + su..." | Re-trigger Greptile

Comment on lines +2060 to 2073
"messages": false,
"responses": true,
"embeddings": true,
"image_generations": false,
"audio_transcriptions": false,
"audio_speech": false,
"moderations": false,
"batches": false,
"rerank": false,
"a2a": false
}
},
"predibase": {
"display_name": "Predibase (`predibase`)",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unverified endpoint claims for responses and embeddings

The PR description smoke-tests only /v1/chat/completions, yet provider_endpoints_support.json marks responses: true and embeddings: true, and providers.json lists /v1/responses and /v1/embeddings in supported_endpoints. If UnoRouter does not actually implement these endpoints, users routing embeddings or Responses API calls through this provider will hit runtime errors. Please either verify these endpoints with live calls (similar to the chat completions curl shown) or set them to false/remove them from supported_endpoints until verified.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@0-don

0-don commented Jul 9, 2026

Copy link
Copy Markdown
Author

@greptileai

@codspeed-hq

codspeed-hq Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing 0-don:feat/add-unorouter-provider (6bf3383) with litellm_internal_staging (6eed38b)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (97d0951) during the generation of this report, so 6eed38b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@0-don

0-don commented Jul 9, 2026

Copy link
Copy Markdown
Author

Companion docs PR: BerriAI/litellm-docs#522 (provider page + sidebar entry). Recommend merging both together.

@0-don

0-don commented Jul 10, 2026

Copy link
Copy Markdown
Author

Re the greptile P2 on unverified endpoint claims: both endpoints re-verified live against api.unorouter.com just now.

/v1/responses (Responses API wire format): POST /v1/responses with {"model": "gpt-5.4:free", "input": ...} returned a completed response object with output text RESPONSES OK.

/v1/embeddings: POST /v1/embeddings with {"model": "jina-embeddings-v4:free", "input": "hello world"} returned a 2048-dim embedding with usage.

So the supported_endpoints list in providers.json and the provider_endpoints_support.json entry (chat + responses + embeddings) reflect tested behavior, not just documentation.

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.

2 participants