Hugging Face now routes model requests through OpenRouter for the best price or speed

In one sentence

Hugging Face now routes language model requests through OpenRouter to optimize for price, speed, and reliability while handling billing directly.

Key points

  • Developers can steer routing using suffixes or headers, with automatic provider selection and outage fallback by default.
  • Hugging Face bills directly with no markup, retiring bring-your-own API keys for language models while keeping them for image and video.
  • OpenRouter measurements show the new routing cut capacity errors by 46% and improved time to first token and throughput by over 16%.
  • Open-weight models now account for 71.7% of weekly tokens among OpenRouter's top models, costing roughly a quarter of closed models on average.

In depth

An AI-written overview of the original article, not the article itself.

Hugging Face announced that its Inference Providers service now routes language model requests through OpenRouter, automatically selecting providers based on price, speed, and reliability. Developers do not need to change existing code or bring their own language model API keys.

Routing and performance

By default, the router balances price, speed, and reliability, and automatically falls back during outages. Developers can use :fastest or :cheapest suffixes to steer selection, or the X-HF-Session-Id header to use provider caches.

According to OpenRouter's measurements, the new routing reduced capacity errors by 46 percent, improved time to first token by 16.9 percent, and increased throughput by 16.3 percent.

Billing and open-weight trends

Hugging Face passes through provider prices with no markup, while image, video, and audio generation continue to run directly. The article notes that open-weight models' share of weekly tokens among OpenRouter's 50 most-used models grew from 26.8 percent to 71.7 percent, costing roughly a quarter of closed models on average.

Read originalOpens the-decoder.com

This summary was generated by AI from the original article and may contain errors; the original is authoritative. Copyright belongs to the original author.

Other coverage of this story

2 reports from 2 sources, in order of publication.

Recent stories from this source