← All comparisons

Niu vs LiteLLM

Compare two self-hosted gateways by operating model. Niu focuses on Provider management, workspace budgets and customer-charge accounting. LiteLLM offers a Proxy and Python SDK with broad Provider integrations, virtual keys, spend tracking and configurable routing. Choose against the capabilities you need today.

Reviewed October 30, 2026. Product documentation and Niu's current API contract are linked below.

Niu targets lower-cost model access and transparent billing. Savings depend on the model, workload and qualified Provider offer; this feature comparison is not a verified price comparison.
FeatureNiuLiteLLM
Access & billing
From experimentation to ongoing operationProvider management, company/workspace/key budgets, request accounting and text/video generation managementSelf-hosted Proxy and Python SDK with virtual keys, spend tracking and an admin UI
Application keysWorkspace keys with model grants, expiry, revocation and rotationVirtual keys with model access, budgets and expiry
Spending controlsCompany funds plus independent workspace/key caps; outstanding reservations countKey, user and team budgets; configurable budget duration
PricingCustomer tariffs are separate from Provider offers; unresolved charges stay unknownModel cost tracking with configurable pricing
Model access
Video generation managementCreate and track supported video jobs, restore saved inputs and history, and preview/download available results with workspace-key authorizationSupported video endpoints depend on the configured model and Provider
Chat endpointPOST /v1/chat/completionsPOST /v1/chat/completions
Model namesAliases mapped to configured upstream modelsModel aliases in model_list map to upstream deployments
Upstream credentialsProvider businesses with separate credentials and model mappingsProvider credentials configured per deployment
RoutingConfigured pools with priorities and weightsLoad balancing across deployments with configurable strategies
Retries and fallbacksBounded Chat failover after a qualified OpenRouter 401; no generic replay of uncertain requestsConfigurable retries, cooldowns, timeouts and fallbacks
Function toolsOpt-in route support; the caller executes requested toolsTool calling for supported models; caller executes tools
Observability
Request historyPostgreSQL records: model, key, status, reported tokens, timing and customer chargeSpend logs and configurable logging integrations
Inspecting retriesEach recorded attempt remains distinguishable from the requestRetry and fallback configuration; logging depends on configured integrations
Setup
Where it runsYour own gateway deploymentSelf-hosted Proxy or Python SDK in your application
DatabasePostgreSQL is requiredPostgreSQL required for Proxy virtual-key management
Source codePublic core under MITOpen-source core; review separate enterprise licensing terms

Performance benchmark

Niu, New API and LiteLLM Proxy

Archived runs: Niu v0.2.4, New API 45fbb14 and LiteLLM Proxy v1.104.0.

Apple M4, 24 GB · PostgreSQL 17.11 · local zero-delay mock upstream. Historical synthetic results, not current-release or production capacity claims. OpenRouter was not tested.

RPS: requests/second · p99: 99th-percentile latency · coding sessions: simulated workloads.
Workload / metricNiu v0.2.4New API 45fbb14LiteLLM Proxy v1.104.0
c = 64 throughput (/v1/chat/completions)3,238.7 RPS

p50: 18.94 ms · p99: 31.54 ms

865.6 RPS (peak)

p50: 71.15 ms · p99: 135.73 ms

302.2 RPS

p50: 193.26 ms · p99: 338.74 ms

Anthropic /v1/messages (c = 64)2,518.8 RPS (p99: 60.61 ms)136.2 RPS (p99: 1,475.53 ms)232.2 RPS (p99: 397.88 ms)
Concurrent streaming throughput (c = 16)235.9 streams/s

9,436 tokens/s · Stream p50: 62.17 ms

100.9 streams/s

4,036 tokens/s · Stream p50: 150.33 ms

83.0 streams/s

3,320 tokens/s · Stream p50: 192.65 ms

Concurrent Inter-Token Latency (ITL p50, c = 16)1.34 ms3.55 ms (2.65x slower)4.62 ms (3.45x slower)
16 agents × 30 turns (codex /v1/chat/completions)1,686.6 ms wall

Turn p50: 54.05 ms · Turn p99: 72.50 ms

4,891.9 ms wall

Turn p50: 132.79 ms · Turn p99: 510.17 ms

5,803.9 ms wall

Turn p50: 180.75 ms · Turn p99: 328.23 ms

16 agents × 30 turns (claude_code /v1/messages)1,746.0 ms (turn p50: 55.02 ms)4,864.9 ms (turn p50: 141.96 ms)3,353.3 ms (turn p50: 103.01 ms)
Idle resident memory (RSS)18.16 MB37.42 MB (2.06x Niu)158.00 MB (8.70x Niu)
Peak resident memory under c = 64 load (RSS)26.40 MB98.50 MB (3.73x Niu)194.60 MB (7.37x Niu)

Different configurations: Niu used PostgreSQL admission and batched completion; New API used token caching and batched logs; LiteLLM used an in-memory master key without database spend logs. PostgreSQL synchronous_commit was off.

Why choose Niu?

Your requirementNiuLiteLLMFits best
Use a Python SDK inside an existing applicationGateway accessed through HTTP APIsPython SDK alongside the self-hosted ProxyChoose LiteLLM for the Python SDK
Configure retries and fallbacks across deploymentsBounded Chat failover after a qualified OpenRouter 401Configurable retries, cooldowns and fallbacksChoose LiteLLM when broader routing controls are required
Separate customer charges from Provider purchase ratesCustomer tariffs independent of Provider offers; persisted customer-charge recordsModel cost tracking and configurable pricing; validate your billing requirementsEvaluate Niu for this customer-billing workflow
Manage company funds across workspaces and application keysCompany funds with independent workspace/key caps and pending reservationsKey, user and team budgetsCompare the budget hierarchy against your organization
Make your first request

Sources