Hugging Face now routes model requests through OpenRouter for the best price or speed
By thedecoder · · AI News
Hugging Face now routes language model requests through OpenRouter, which automatically selects the cheapest or fastest provider. Bring-your-own API keys for language models are going away. According to OpenRouter, the new routing cut capacity errors by 46 percent. Both partners face multibillion-dollar acquisitions. The article Hugging Face now routes model requests through OpenRouter for the best price or speed appeared first on The Decoder .
Hugging Face now routes language model requests through OpenRouter. Developers are routed by default to a provider with a good mix of price, speed, and reliability. Bring-your-own API keys for language model providers are going away.
Hugging Face's Inference Providers service now routes language model requests through OpenRouter, the company announced. The router picks a provider for each call based on price, speed, and reliability, and automatically falls back to another provider during outages. Existing code keeps working without changes.
Suffixes and session headers control provider selection
By default, the router looks for the best mix of price, speed, and reliability. The ":fastest" suffix picks the provider with the highest throughput, while ":cheapest" picks the least expensive one. Developers can also select a provider directly by name. The "X-HF-Session-Id" header lets the routing take provider caches into account.
According to OpenRouter's own measurements, capacity errors dropped 46 percent with the new routing. Time to first token improved by 16.9 percent, and throughput rose by 16.3 percent.