Grafy News
Try Grafy free

Hugging Face routes open-weight models through OpenRouter for cheaper, faster inference

Hugging Face now routes all language model calls through OpenRouter, automatically picking the cheapest.

Illustration for the news story: Hugging Face routes open-weight models through OpenRouter for cheaper, faster inferenceSource: Hugging Face Blog

Hugging Face announced that it is moving its language‑model inference routing to OpenRouter, letting developers call any open‑weight model on the Hub with a single Hugging Face token while automatically selecting the best provider for price, speed and reliability. The change matters because open‑weight models now dominate the traffic on OpenRouter and cost roughly four times less than closed models, offering a practical path to cheaper, scalable AI services.

What is the new partnership between Hugging Face and OpenRouter?

According to the Hugging Face Blog, the two companies have teamed up so that every open‑weight model published on the Hugging Face Hub can be served through OpenRouter’s routing layer. The partnership replaces Hugging Face’s previous custom router with OpenRouter’s system, which evaluates live metrics from more than 80 providers and directs each request to the provider that offers the best combination of price, latency and uptime. The integration is transparent to users – the same API calls and token continue to work, but the underlying request now passes through OpenRouter.

How does OpenRouter’s routing decide which provider to use?

OpenRouter measures each provider’s live price, throughput and reliability across its massive traffic of over 800 trillion tokens a month. When a request arrives, the router selects the provider with the optimal mix of those three factors. If the chosen provider slows down or fails, the request is automatically retried on the next‑best provider within the same call. The system also supports explicit routing policies via suffixes on the model ID, such as :fastest for highest throughput, :cheapest for lowest price, or a provider name to lock the request to a specific backend. Additionally, a conversation can stay on a provider that holds a prompt cache by sending a stable UUID in the X-HF-Session-Id header.

What impact does the change have on open‑weight model usage and cost?

Open‑weight models have surged on OpenRouter, rising from 26.8 % of tokens served in October 2025 to 71.7 % at the end of September 2026, with a peak of 77.5 % in July 2026 (OpenRouter, October 2026). Weekly volume for these models grew more than 60‑fold, outpacing closed models by a factor of ten. The most used model this week is DeepSeek V4.1 Flash 1017, which has processed 59.2 trillion tokens.

Cost differences are stark: open‑weight models average $0.28 per million input tokens and $1.62 per million output tokens, compared with $1.27 and $6.36 for closed models. While the top open‑weight model (Kimi K3.1 Pro) scores 46 on the Artificial Analysis Intelligence Index versus 65 for Claude Fable 5.2, it does so at about a seventh of the cost per task ($3.68 vs $26.54). For many workloads, that trade‑off between performance and price is attractive.

Will developers need to modify their code to use the new routing?

No code changes are required for basic usage. The Hugging Face token, endpoint URL and request format remain identical. The only adjustment developers may consider is adding a provider suffix to a model ID if they want to enforce a specific policy (e.g., zai-org/GLM-5.3:fastest). For those who previously supplied their own API keys for a provider, the blog notes a breaking change: custom provider keys are no longer accepted for language‑model calls routed through OpenRouter. Image, video and audio generation continue to use the existing inference providers and still accept custom keys.

How can Grafy users take advantage of the new routing?

Grafy Chat lets creators experiment with multiple models side‑by‑side. By supplying a Hugging Face token, you can now chat with any open‑weight model on the Hub and benefit from OpenRouter’s automatic provider selection without extra configuration. For developers who prefer code, the Grafy Code studio can be used to integrate the same Hugging Face API calls; the routing logic runs entirely on the server side, so the code you write in Grafy Code works unchanged. Finally, researchers who want to explore the pricing and performance data can use Grafy Reader to load the Hugging Face documentation PDFs and query the numbers directly.

Try a model in Grafy Chat: Grafy Chat

For SDK‑level integration, see the Grafy Code studio: Grafy Code

To read the full Inference Providers documentation, open it in Grafy Reader: Grafy Reader

The partnership is just the first step. Future plans include linking OpenRouter accounts to Hugging Face, routing more task types through OpenRouter, and expanding the set of models that benefit from the dynamic provider selection.

Frequently asked questions

Does the new routing affect the pricing of open‑weight models?

Pricing itself does not change; you pay the provider’s listed price on your Hugging Face bill, and Hugging Face adds no markup. However, because OpenRouter automatically selects the cheapest viable provider, most users will see lower average costs compared with manually picking a single provider.

Do I need to update my existing inference endpoint configurations?

No. Existing endpoint URLs and authentication tokens continue to work. The only change is that language‑model requests now flow through OpenRouter, which handles provider selection and retries internally.

Can I still force a request to a specific provider?

Yes. By appending a provider suffix to the model ID (e.g., model-id:novita) you can lock the request to a particular backend, or you can disable unwanted providers in your Hugging Face settings to prevent the router from sending traffic there.


Source: Hugging Face Blog, "Hugging Face and OpenRouter join forces to make open-weight models easy to run" (November 16 2026).


Source: Hugging Face Blog — Hugging Face and OpenRouter join forces to make open-weight models easy to run