Baseten now appears as an Inference Provider on the Hugging Face Hub: that means you can run serverless inference from model pages, choose Baseten as your preferred provider, and use models hosted by Baseten with very little setup. Can you imagine testing a new LLM in minutes from the same Hub interface? That's exactly what this integration enables.
What the integration offers
Baseten joins Hugging Face's Inference Providers ecosystem, bringing support for conversational tasks and text generation from cutting-edge models. Models mentioned include Kimi K3, DeepSeek V4 Flash, GLM-5.2 and other open weights that Baseten has in its catalog.
The integration also reaches the client: it's supported in Hugging Face SDKs for Python and JavaScript, so you can invoke those models from your apps with the same experience you'd use other providers.
- Support for various model types: LLMs, text-to-speech and more.
- Serverless access directly from model pages on the Hub.
- Integration into official SDKs (Python and JS) and agent harnesses.
Modes of use and authentication
There are two ways to call an Inference Provider from Hugging Face: using the provider's own key, or letting Hugging Face route the request.
- Mode with your own key (custom key): the request goes directly to the provider (for example Baseten) using your Baseten API key. Billing is charged to the provider account.
- Mode routed by Hugging Face (routed by HF): you don't need the provider's API key; you authenticate with your Hugging Face token and charges apply to your HF account. Hugging Face doesn't add a markup; it simply passes through the provider's costs.
Also, in your account you can:
- Configure the API keys of the providers you registered with.
- Order providers by preference; that order applies in the widget and in the code snippets on model pages.
Important: if you don't configure a custom key, your requests will be routed by Hugging Face by default.
SDKs and practical examples
To use Baseten through Hugging Face you need recent versions of the SDKs: huggingface_hub (>= 1.26.1) in Python and @huggingface/inference for JavaScript. Here are examples showing how to invoke DeepSeek V4 Flash through the Hugging Face router.
Python (example using the OpenAI-compatible client with HF router):
import os
from openai import OpenAI
client = OpenAI(
base_url="https://router.huggingface.co/v1",
api_key=os.environ["HF_TOKEN"],
)
completion = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V4-Flash-0731:baseten",
messages=[
{"role": "user", "content": "Write a Python function that returns the nth Fibonacci number using memoization."}
],
)
print(completion.choices[0].message)
JavaScript (Node.js):
import { OpenAI } from "openai";
const client = new OpenAI({
baseURL: "https://router.huggingface.co/v1",
apiKey: process.env.HF_TOKEN,
});
const chatCompletion = await client.chat.completions.create({
model: "deepseek-ai/DeepSeek-V4-Flash-0731:baseten",
messages: [
{ role: "user", content: "Write a Python function that returns the nth Fibonacci number using memoization." },
],
});
console.log(chatCompletion.choices[0].message);
If instead of routing via HF you use Baseten's API key directly, billing is charged to your Baseten account. If you use the HF route, you'll pay the provider's standard rates from your HF account.
Integrations with agents and tools
Hugging Face mentions that Inference Providers are integrated into most Agent Harnesses like Pi, OpenCode, Hermes Agents, OpenClaw and others. What does that mean in practice? It means you can connect models hosted on Baseten directly to those agents without writing extra glue code. It's a time saver if you already use any of those frameworks.
Cost considerations and PRO plan
- Requests routed by HF are charged to your Hugging Face account, with no additional markup.
- Requests with direct keys are charged to the corresponding provider account.
- Hugging Face PRO users receive $2 in Inference credits each month that they can use with any provider.
- There is a small free quota for free account users, but if you need more usage it's worth evaluating the PRO plan.
Why should you care?
Because it reduces the friction to test and deploy models: fewer setups, access to frontier models and the flexibility to choose how to authenticate and bill your calls. If you build prototypes or products that consume third-party models, this integration gives you faster routes to experiment and scale.
Think of it this way: instead of deploying infra, tuning containers and managing endpoints, you can try a model from the Hub page and move it into your app with a couple clicks or an SDK call. Isn't that exactly what most developers and small teams are after?
