Baseten on Hugging Face Inference Providers 🔥
Baseten on Hugging Face Inference Providers 🔥
We’re thrilled to share that Baseten is now a supported Inference Provider on the Hugging Face Hub! Baseten joins our growing ecosystem, enhancing the breadth and capabilities of serverless inference directly on the Hub’s model pages. Inference Providers are also seamlessly integrated into our client SDKs (for both JS and Python), making it super easy to use a wide variety of models with your preferred providers.
我们非常高兴地宣布,Baseten 现已成为 Hugging Face Hub 支持的推理提供商(Inference Provider)!Baseten 加入了我们不断壮大的生态系统,直接在 Hub 的模型页面上增强了无服务器推理的广度和能力。推理提供商也已无缝集成到我们的客户端 SDK(JS 和 Python)中,让您可以极其轻松地使用您偏好的提供商来运行各种模型。
Baseten is an AI infrastructure platform that covers serverless AI, training and more. With a catalog of many frontier models, Baseten makes it easy for developers to integrate a wide range of AI capabilities into their applications with minimal setup. Baseten supports a broad spectrum of model types - from LLMs to text-to-speech and more. As part of this initial integration, Baseten is launching support for conversational and text-generation tasks on Hugging Face, enabling access to popular open-weight LLMs such as Kimi K3, latest DeepSeek V4 Flash, GLM-5.2, and many more. Support for additional tasks will roll out soon!
Baseten 是一个涵盖无服务器 AI、模型训练等功能的 AI 基础设施平台。凭借其丰富的尖端模型库,Baseten 让开发者能够以极简的配置,轻松将广泛的 AI 能力集成到应用程序中。Baseten 支持多种模型类型,从大语言模型(LLM)到语音合成(TTS)等应有尽有。作为此次初步集成的一部分,Baseten 在 Hugging Face 上推出了对对话和文本生成任务的支持,用户可以访问诸如 Kimi K3、最新的 DeepSeek V4 Flash、GLM-5.2 等热门开源权重 LLM。更多任务支持即将推出!
How it works
In the website UI
In your user account settings, you are able to:
- Set your own API keys for the providers you’ve signed up with. If no custom key is set, your requests will be routed through HF.
- Order providers by preference. This applies to the widget and code snippets in the model pages.
工作原理
在网站界面中
在您的用户账户设置中,您可以:
- 为您已注册的提供商设置您自己的 API 密钥。如果未设置自定义密钥,您的请求将通过 HF 进行路由。
- 按偏好对提供商进行排序。这适用于模型页面中的小部件和代码片段。
As mentioned, there are two modes when calling Inference Providers:
- Custom key: calls go directly to the inference provider, using your own API key of the corresponding inference provider.
- Routed by HF: in that case, you don’t need a token from the provider, and the charges are applied directly to your HF account rather than the provider’s account.
如前所述,调用推理提供商时有两种模式:
- 自定义密钥 (Custom key):调用直接发送至推理提供商,使用您在该提供商处的 API 密钥。
- HF 路由 (Routed by HF):在这种情况下,您无需提供商的令牌,费用将直接计入您的 HF 账户,而非提供商账户。
From the client SDKs
Baseten is available through the Hugging Face SDKs - huggingface_hub (>= 1.26.1) for Python and @huggingface/inference for JavaScript. The following examples show how to use the latest DeepSeek V4 Flash through Baseten. Use a Hugging Face token to authenticate - the request will be routed to Baseten automatically.
通过客户端 SDK
Baseten 可通过 Hugging Face SDK 使用,包括 Python 版的 huggingface_hub (>= 1.26.1) 和 JavaScript 版的 @huggingface/inference。以下示例展示了如何通过 Baseten 使用最新的 DeepSeek V4 Flash。使用 Hugging Face 令牌进行身份验证,请求将自动路由至 Baseten。
Billing
For direct requests, i.e. when you use the key from an inference provider, you are billed by the corresponding provider. For instance, if you use a Baseten API key you’re billed on your Baseten account. For routed requests, i.e. when you authenticate via the Hugging Face Hub, you’ll only pay the standard provider API rates. There’s no additional markup from us; we just pass through the provider costs directly.
计费
对于直接请求(即使用推理提供商的密钥时),您将由相应的提供商计费。例如,如果您使用 Baseten API 密钥,费用将计入您的 Baseten 账户。对于路由请求(即通过 Hugging Face Hub 进行身份验证时),您只需支付标准的提供商 API 费率。我们不会收取任何额外费用,仅直接转嫁提供商的成本。
Important Note ‼️
PRO users get $2 worth of Inference credits every month. You can use them across providers. 🔥 Subscribe to the Hugging Face PRO plan to get access to Inference credits, ZeroGPU, Spaces Dev Mode, 20x higher limits, and more. We also provide free inference with a small quota for our signed-in free users, but please upgrade to PRO if you can!
重要提示 ‼️
PRO 用户每月可获得价值 2 美元的推理额度,可用于各个提供商。🔥 订阅 Hugging Face PRO 计划即可获得推理额度、ZeroGPU、Spaces 开发模式、20 倍更高的限制等权益。我们也为已登录的免费用户提供少量免费推理额度,但如果条件允许,请升级至 PRO!