Unlocking AI Power: Baseten as a Supported Inference Provider on Hugging Face Hub
In the rapidly evolving landscape of artificial intelligence, selecting the right tools and platforms can significantly impact your development process. One exciting recent development is the integration of Baseten as a supported Inference Provider on the Hugging Face Hub. This collaboration expands the capabilities of serverless inference, making it easier for developers to harness AI technologies.
What is Baseten?
Baseten is an innovative AI infrastructure platform that facilitates seamless serverless AI integration. It provides developers with a comprehensive environment to access various AI capabilities, from training models to deploying them effortlessly. With a rich catalog of advanced models, Baseten simplifies the process for developers who wish to embed AI functionalities in their applications without extensive setup.
Enhanced AI Capabilities
Baseten supports an impressive range of model types, including:
- Large Language Models (LLMs)
- Text-to-Speech Models
- Conversational Tasks
- Text Generation Models
With this initial integration, users can leverage popular open-weight large language models such as Kimi K3, the latest DeepSeek V4 Flash, and GLM-5.2. Additional support for various tasks is expected to roll out soon, broadening the model spectrum available to developers.
How Baseten Works
The integration process is user-friendly and efficient. Hereâs a breakdown:
1. User-Friendly Interface
In your Hugging Face user account, you can easily:
- Set Your API Keys: Assign your API keys for the providers youâve registered with. If you donât set a custom key, your requests will default through Hugging Face.
- Order Providers by Preference: This setting will influence the widget and code snippets displayed on the model pages.
2. Two Modes of Operation
When calling Inference Providers, there are two modes to choose from:
- Custom Key: This allows calls to go directly to the Inference Provider using your own API key.
- Routed by HF: No key from the provider is required, and charges are directly applied to your Hugging Face account.
3. Integration into Model Pages
The model pages now showcase third-party inference providers compatible with the current model, sorted by user preference.
Accessing Baseten via Client SDKs
Baseten is readily available through Hugging Faceâs client SDKs for both Python and JavaScript. To enhance usability, developers can utilize the huggingface_hub (>= 1.26.1) for Python or @huggingface/inference for JavaScript.
Python Example
python
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 Example
javascript
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);
Billing Made Simple
When using a custom key from an Inference Provider, billing aligns with that providerâs rates. For routed requests via Hugging Face, youâll pay standard API rates without any additional markup.
Important Note: PRO users receive $2 worth of inference credits every month, usable across various providers. Upgrading to the Hugging Face PRO plan unlocks a suite of benefits, including ZeroGPU, Spaces Dev Mode, and higher usage limits.
Engaging with Baseten and Hugging Face
Hugging Face encourages users to share their feedback about this integration. Your input is valuable and can help shape the future of AI tools and services provided on the platform. Join the conversation by sharing your thoughts here.
With Baseten now part of the Hugging Face ecosystem, developers can unlock new opportunities for integrating AI into their projects, ultimately streamlining the development process and enhancing the functionality of applications.
Inspired by: Source



