Skip to main content
Back to timeline
Hugging Face - BlogSource publication:

Hugging Face hands language-model routing to OpenRouter: one Hub token now reaches open-weight models, with automatic retry on another provider

Synopsis

Hugging Face has switched routing for language-model requests from its own router to OpenRouter's, so users still call open-weight models served by providers on the Hub with the same Hugging Face token and the same API. OpenRouter picks a provider for each request from live price, speed and reliability, and retries on the next provider inside the same call if the first fails; previously Inference Providers chose one provider and returned its error on failure. Image, video and audio generation still run through Hugging Face's own inference path, not through OpenRouter.

Source-provided article image: Hugging Face and OpenRouter join forces to make open-weight models easy to run
Hugging Face

Interpretation

Language-model inference requests are now dispatched by OpenRouter's router instead of Hugging Face's own, and calling code does not change. Previously Inference Providers picked one provider for a request and returned that provider's error to the caller when it failed. OpenRouter says its rebuilt routing allocates traffic by a mix of price, speed and reliability, moving traffic away from a provider that slows or starts failing until it recovers; in OpenRouter's measurements the new routing cut capacity errors by 46%, improved time to first token by 16.9% and throughput by 16.3%.

Routing is cache-aware: a conversation stays on the provider that holds its prompt cache, so the cache is not lost. To make this explicit, a stable UUID per conversation is sent in the X-HF-Session-Id header. Model pages gain Providers and Metrics tabs listing every provider OpenRouter can route the model to with its input and output price, speed and uptime over the last 24 hours, and the best price, throughput, time to first token, context length and uptime among them.

Callers can still pin a policy or a provider with a suffix on the model id, such as :fastest for highest throughput, :cheapest for lowest price, or :novita to use only Novita. Language-model requests now go through OpenRouter and are billed to the Hugging Face account or organization, so these models no longer accept a caller's own provider API key. Custom keys for image and video providers keep working, and image, video and audio generation continue directly through Hugging Face Inference Providers without going through OpenRouter.

Perspective

The change covers language-model requests for open-weight models on the Hub that a provider serves; image, video and audio generation still go directly through Hugging Face Inference Providers, where custom keys keep working. Hugging Face describes this as the first step of its partnership with OpenRouter, with connecting an OpenRouter account to Hugging Face and routing more tasks through OpenRouter to follow.

The routing figures (capacity errors down 46%, time to first token improved 16.9%, throughput improved 16.3%) are OpenRouter's measurements on its own traffic. The open-weight share on OpenRouter rose from 26.8% of tokens served in October 2025 to 71.7% at the end of September 2026, after peaking at 77.5% in July; these are statistics for the OpenRouter platform, not estimates for all deployments.