{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-08-06-baseten-on-hugging-face-inference-providers-fire/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "[![banner image](https://huggingface.co/blog/assets/inference-providers/welcome-baseten.png)](https://huggingface.co/blog/assets/inference-providers/welcome-baseten.png)\n\nWe're thrilled to share that **Baseten** is now a supported Inference Provider on the Hugging Face Hub!\n\nBaseten 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.\n\n[Baseten](https://baseten.com) 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.\n\nBaseten 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](https://huggingface.co/moonshotai/Kimi-K3?inference_provider=baseten), latest [DeepSeek V4 Flash](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731?inference_provider=baseten), [GLM-5.2](https://huggingface.co/zai-org/GLM-5.2?inference_provider=baseten), and many more. **Support for additional tasks** will roll out soon!\n\nSee the full list of models supported by Baseten [here](https://huggingface.co/models?inference_provider=baseten&sort=trending).\n\nFollow Baseten on Hugging Face: [https://huggingface.co/baseten](https://huggingface.co/baseten).\n\n## How it works\n\n### In the website UI\n\n1. In your user account settings, you are able to:\n\n- 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.\n- Order providers by preference. This applies to the widget and code snippets in the model pages.\n\n![Inference Providers](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/inference-providers-baseten.png)\n\n2. As mentioned, there are two modes when calling Inference Providers:\n\n- Custom key (calls go directly to the inference provider, using your own API key of the corresponding inference provider)\n- 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)\n\n![Inference Providers](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/explainer.png)\n\n3. Model pages showcase third-party inference providers (the ones that are compatible with the current model, sorted by user preference)\n\n![Inference Providers](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/model-widget-v3.png)\n\n### From the client SDKs\n\nBaseten is available through the Hugging Face SDKs - `huggingface_hub` (>= 1.26.1) for Python and `@huggingface/inference` for JavaScript.\n\nThe following examples show how to use the latest [DeepSeek V4 Flash](https://huggingface.co/blog/deepseek-ai/DeepSeek-V4-Flash-0731) through Baseten. Use a [Hugging Face token](https://huggingface.co/settings/tokens) to authenticate - the request will be routed to Baseten automatically.\n\n#### From your favorite Agent Harness\n\nHugging Face Inference Providers are integrated in most Agent Harnesses - including Pi, OpenCode, Hermes Agents, OpenClaw, and more. This means you can plug baseten-hosted models straight into your favorite tools without any extra glue code. Browse the full list of integrations [here](https://huggingface.co/docs/inference-providers/en/integrations/index).\n\n#### from Python\n\n```python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://router.huggingface.co/v1\",\n    api_key=os.environ[\"HF_TOKEN\"],\n)\n\ncompletion = client.chat.completions.create(\n    model=\"deepseek-ai/DeepSeek-V4-Flash-0731:baseten\",\n    messages=[\n        {\n            \"role\": \"user\",\n            \"content\": \"Write a Python function that returns the nth Fibonacci number using memoization.\"\n        }\n    ],\n)\n\nprint(completion.choices[0].message)\n```\n\n#### from JS\n\n```js\nimport { OpenAI } from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://router.huggingface.co/v1\",\n    apiKey: process.env.HF_TOKEN,\n});\n\nconst chatCompletion = await client.chat.completions.create({\n    model: \"deepseek-ai/DeepSeek-V4-Flash-0731:baseten\",\n    messages: [\n        {\n            role: \"user\",\n            content: \"Write a Python function that returns the nth Fibonacci number using memoization.\",\n        },\n    ],\n});\n\nconsole.log(chatCompletion.choices[0].message);\n```\n\n## Billing\n\nFor 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.\n\nFor 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. (In the future, we may establish revenue-sharing agreements with our provider partners.)\n\n**Important Note** ‼️ PRO users get $2 worth of Inference credits every month. You can use them across providers. 🔥\n\nSubscribe to the [Hugging Face PRO plan](https://hf.co/subscribe/pro) to get access to Inference credits, ZeroGPU, Spaces Dev Mode, 20x higher limits, and more.\n\nWe also provide free inference with a small quota for our signed-in free users, but please upgrade to PRO if you can!\n\n## Feedback and next steps\n\nWe would love to get your feedback! Share your thoughts and/or comments here: [https://huggingface.co/spaces/huggingface/HuggingDiscussions/discussions/49](https://huggingface.co/spaces/huggingface/HuggingDiscussions/discussions/49)\n",
  "authors": [],
  "captured_at": "2026-10-19T01:26:53.998049939+00:00",
  "category": "ai",
  "content_html": "<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/blog/assets/inference-providers/welcome-baseten.png\"><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/blog/assets/inference-providers/welcome-baseten.png\" alt=\"banner image\" loading=\"eager\" decoding=\"async\" fetchpriority=\"high\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></a></p>\n<p>We're thrilled to share that <strong>Baseten</strong> is now a supported Inference Provider on the Hugging Face Hub!</p>\n<p>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.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://baseten.com\">Baseten</a> 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.</p>\n<p>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 <strong>conversational and text-generation tasks</strong> on Hugging Face, enabling access to popular open-weight LLMs such as <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/moonshotai/Kimi-K3?inference_provider=baseten\">Kimi K3</a>, latest <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731?inference_provider=baseten\">DeepSeek V4 Flash</a>, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/zai-org/GLM-5.2?inference_provider=baseten\">GLM-5.2</a>, and many more. <strong>Support for additional tasks</strong> will roll out soon!</p>\n<p>See the full list of models supported by Baseten <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/models?inference_provider=baseten&amp;sort=trending\">here</a>.</p>\n<p>Follow Baseten on Hugging Face: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/baseten\">https://huggingface.co/baseten</a>.</p>\n<h2>How it works</h2>\n<h3>In the website UI</h3>\n<ol>\n<li>In your user account settings, you are able to:</li>\n</ol>\n<ul>\n<li>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.</li>\n<li>Order providers by preference. This applies to the widget and code snippets in the model pages.</li>\n</ul>\n<p><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/inference-providers-baseten.png\" alt=\"Inference Providers\" loading=\"lazy\" decoding=\"async\" fetchpriority=\"low\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></p>\n<ol start=\"2\">\n<li>As mentioned, there are two modes when calling Inference Providers:</li>\n</ol>\n<ul>\n<li>Custom key (calls go directly to the inference provider, using your own API key of the corresponding inference provider)</li>\n<li>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)</li>\n</ul>\n<p><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/explainer.png\" alt=\"Inference Providers\" loading=\"lazy\" decoding=\"async\" fetchpriority=\"low\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></p>\n<ol start=\"3\">\n<li>Model pages showcase third-party inference providers (the ones that are compatible with the current model, sorted by user preference)</li>\n</ol>\n<p><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/model-widget-v3.png\" alt=\"Inference Providers\" loading=\"lazy\" decoding=\"async\" fetchpriority=\"low\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></p>\n<h3>From the client SDKs</h3>\n<p>Baseten is available through the Hugging Face SDKs - <code>huggingface_hub</code> (&gt;= 1.26.1) for Python and <code>@huggingface/inference</code> for JavaScript.</p>\n<p>The following examples show how to use the latest <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/blog/deepseek-ai/DeepSeek-V4-Flash-0731\">DeepSeek V4 Flash</a> through Baseten. Use a <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/settings/tokens\">Hugging Face token</a> to authenticate - the request will be routed to Baseten automatically.</p>\n<h4>From your favorite Agent Harness</h4>\n<p>Hugging Face Inference Providers are integrated in most Agent Harnesses - including Pi, OpenCode, Hermes Agents, OpenClaw, and more. This means you can plug baseten-hosted models straight into your favorite tools without any extra glue code. Browse the full list of integrations <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/docs/inference-providers/en/integrations/index\">here</a>.</p>\n<h4>from Python</h4>\n<pre><code class=\"language-python\"><span class=\"code-snippet\" data-language=\"Python\"><span class=\"syntax-source syntax-python\"><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-python\">import</span> <span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">os</span></span></span>\n<span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-from syntax-python\">from</span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-meta syntax-import-source syntax-python\"> <span class=\"syntax-meta syntax-import-path syntax-python\"><span class=\"syntax-meta syntax-import-name syntax-python\">openai</span></span> <span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-python\">import</span></span></span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"> <span class=\"syntax-meta syntax-generic-name syntax-python\">OpenAI</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">client</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">OpenAI</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\">\n    <span class=\"syntax-variable syntax-parameter syntax-python\">base_url</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">https://router.huggingface.co/v1<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">api_key</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">os</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">environ</span></span></span><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python\">[</span></span><span class=\"syntax-meta syntax-item-access syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">HF_TOKEN<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span></span><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python\">]</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">completion</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">client</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">chat</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">completions</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">create</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\">\n    <span class=\"syntax-variable syntax-parameter syntax-python\">model</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">deepseek-ai/DeepSeek-V4-Flash-0731:baseten<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">messages</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-structure syntax-list syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-list syntax-begin syntax-python\">[</span>\n        <span class=\"syntax-meta syntax-structure syntax-dictionary-or-set syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python\">{</span>\n            <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">role<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">user<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python\">,</span>\n            <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">content<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">Write a Python function that returns the nth Fibonacci number using memoization.<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span>\n        <span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python\">}</span></span>\n    <span class=\"syntax-punctuation syntax-section syntax-list syntax-end syntax-python\">]</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n\n<span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-support syntax-function syntax-builtin syntax-python\">print</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">completion</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">choices</span></span></span><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python\">[</span></span><span class=\"syntax-meta syntax-item-access syntax-arguments syntax-python\"><span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">0</span></span><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python\">]</span></span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">message</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n</span></span></code></pre>\n<h4>from JS</h4>\n<pre><code class=\"language-js\"><span class=\"code-snippet\" data-language=\"JavaScript\"><span class=\"syntax-source syntax-js\"><span class=\"syntax-meta syntax-import syntax-js\"><span class=\"syntax-keyword syntax-control syntax-import-export syntax-js\">import</span> <span class=\"syntax-meta syntax-block syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-block syntax-js\">{</span> <span class=\"syntax-variable syntax-other syntax-readwrite syntax-js\">OpenAI</span> <span class=\"syntax-punctuation syntax-section syntax-block syntax-js\">}</span></span> <span class=\"syntax-keyword syntax-control syntax-import-export syntax-js\">from</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-js\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-js\">&quot;</span>openai<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-js\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-terminator syntax-statement syntax-js\">;</span>\n\n<span class=\"syntax-storage syntax-type syntax-js\">const</span> <span class=\"syntax-variable syntax-other syntax-readwrite syntax-js\">client</span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-js\">=</span> <span class=\"syntax-meta syntax-instance syntax-constructor syntax-js\"><span class=\"syntax-keyword syntax-operator syntax-word syntax-new syntax-js\">new</span><span class=\"syntax-meta syntax-function-call syntax-constructor syntax-js\"> <span class=\"syntax-variable syntax-type syntax-js\">OpenAI</span><span class=\"syntax-meta syntax-group syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-group syntax-js\">(</span><span class=\"syntax-meta syntax-object-literal syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-block syntax-js\">{</span>\n    <span class=\"syntax-meta syntax-object-literal syntax-key syntax-js\">baseURL</span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-js\">:</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-js\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-js\">&quot;</span>https://router.huggingface.co/v1<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-js\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-comma syntax-js\">,</span>\n    <span class=\"syntax-meta syntax-object-literal syntax-key syntax-js\">apiKey</span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-js\">:</span> <span class=\"syntax-support syntax-type syntax-object syntax-process syntax-js\">process</span><span class=\"syntax-punctuation syntax-accessor syntax-js\">.</span><span class=\"syntax-support syntax-type syntax-object syntax-process syntax-js\">env</span><span class=\"syntax-punctuation syntax-accessor syntax-js\">.</span><span class=\"syntax-meta syntax-property syntax-object syntax-js\">HF_TOKEN</span><span class=\"syntax-punctuation syntax-separator syntax-comma syntax-js\">,</span>\n<span class=\"syntax-punctuation syntax-section syntax-block syntax-js\">}</span></span></span><span class=\"syntax-meta syntax-group syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-group syntax-js\">)</span></span></span></span><span class=\"syntax-punctuation syntax-terminator syntax-statement syntax-js\">;</span>\n\n<span class=\"syntax-storage syntax-type syntax-js\">const</span> <span class=\"syntax-variable syntax-other syntax-readwrite syntax-js\">chatCompletion</span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-js\">=</span> <span class=\"syntax-variable syntax-other syntax-readwrite syntax-js\">await</span> <span class=\"syntax-variable syntax-other syntax-object syntax-js\">client</span><span class=\"syntax-punctuation syntax-accessor syntax-js\">.</span><span class=\"syntax-meta syntax-property syntax-object syntax-js\">chat</span><span class=\"syntax-punctuation syntax-accessor syntax-js\">.</span><span class=\"syntax-meta syntax-property syntax-object syntax-js\">completions</span><span class=\"syntax-punctuation syntax-accessor syntax-js\">.</span><span class=\"syntax-meta syntax-function-call syntax-method syntax-js\"><span class=\"syntax-variable syntax-function syntax-js\">create</span><span class=\"syntax-meta syntax-group syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-group syntax-js\">(</span><span class=\"syntax-meta syntax-object-literal syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-block syntax-js\">{</span>\n    <span class=\"syntax-meta syntax-object-literal syntax-key syntax-js\">model</span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-js\">:</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-js\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-js\">&quot;</span>deepseek-ai/DeepSeek-V4-Flash-0731:baseten<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-js\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-comma syntax-js\">,</span>\n    <span class=\"syntax-meta syntax-object-literal syntax-key syntax-js\">messages</span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-js\">:</span> <span class=\"syntax-meta syntax-sequence syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-js\">[</span>\n        <span class=\"syntax-meta syntax-object-literal syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-block syntax-js\">{</span>\n            <span class=\"syntax-meta syntax-object-literal syntax-key syntax-js\">role</span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-js\">:</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-js\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-js\">&quot;</span>user<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-js\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-comma syntax-js\">,</span>\n            <span class=\"syntax-meta syntax-object-literal syntax-key syntax-js\">content</span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-js\">:</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-js\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-js\">&quot;</span>Write a Python function that returns the nth Fibonacci number using memoization.<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-js\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-comma syntax-js\">,</span>\n        <span class=\"syntax-punctuation syntax-section syntax-block syntax-js\">}</span></span><span class=\"syntax-punctuation syntax-separator syntax-comma syntax-js\">,</span>\n    <span class=\"syntax-punctuation syntax-section syntax-brackets syntax-js\">]</span></span><span class=\"syntax-punctuation syntax-separator syntax-comma syntax-js\">,</span>\n<span class=\"syntax-punctuation syntax-section syntax-block syntax-js\">}</span></span></span><span class=\"syntax-meta syntax-group syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-group syntax-js\">)</span></span></span><span class=\"syntax-punctuation syntax-terminator syntax-statement syntax-js\">;</span>\n\n<span class=\"syntax-meta syntax-function-call syntax-method syntax-js\"><span class=\"syntax-support syntax-type syntax-object syntax-console syntax-js\">console</span><span class=\"syntax-punctuation syntax-accessor syntax-js\">.</span><span class=\"syntax-support syntax-function syntax-console syntax-js\">log</span><span class=\"syntax-meta syntax-group syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-group syntax-js\">(</span><span class=\"syntax-variable syntax-other syntax-object syntax-js\">chatCompletion</span><span class=\"syntax-punctuation syntax-accessor syntax-js\">.</span><span class=\"syntax-meta syntax-property syntax-object syntax-js\">choices</span><span class=\"syntax-meta syntax-brackets syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-js\">[</span><span class=\"syntax-constant syntax-numeric syntax-js\">0</span><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-js\">]</span></span><span class=\"syntax-punctuation syntax-accessor syntax-js\">.</span><span class=\"syntax-meta syntax-property syntax-object syntax-js\">message</span></span><span class=\"syntax-meta syntax-group syntax-js\"><span class=\"syntax-punctuation syntax-section syntax-group syntax-js\">)</span></span></span><span class=\"syntax-punctuation syntax-terminator syntax-statement syntax-js\">;</span>\n</span></span></code></pre>\n<h2>Billing</h2>\n<p>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.</p>\n<p>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. (In the future, we may establish revenue-sharing agreements with our provider partners.)</p>\n<p><strong>Important Note</strong> ‼️ PRO users get $2 worth of Inference credits every month. You can use them across providers. 🔥</p>\n<p>Subscribe to the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://hf.co/subscribe/pro\">Hugging Face PRO plan</a> to get access to Inference credits, ZeroGPU, Spaces Dev Mode, 20x higher limits, and more.</p>\n<p>We also provide free inference with a small quota for our signed-in free users, but please upgrade to PRO if you can!</p>\n<h2>Feedback and next steps</h2>\n<p>We would love to get your feedback! Share your thoughts and/or comments here: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/huggingface/HuggingDiscussions/discussions/49\">https://huggingface.co/spaces/huggingface/HuggingDiscussions/discussions/49</a></p>\n",
  "content_markdown": "[![banner image](https://huggingface.co/blog/assets/inference-providers/welcome-baseten.png)](https://huggingface.co/blog/assets/inference-providers/welcome-baseten.png)\n\nWe're thrilled to share that **Baseten** is now a supported Inference Provider on the Hugging Face Hub!\n\nBaseten 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.\n\n[Baseten](https://baseten.com) 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.\n\nBaseten 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](https://huggingface.co/moonshotai/Kimi-K3?inference_provider=baseten), latest [DeepSeek V4 Flash](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731?inference_provider=baseten), [GLM-5.2](https://huggingface.co/zai-org/GLM-5.2?inference_provider=baseten), and many more. **Support for additional tasks** will roll out soon!\n\nSee the full list of models supported by Baseten [here](https://huggingface.co/models?inference_provider=baseten&sort=trending).\n\nFollow Baseten on Hugging Face: [https://huggingface.co/baseten](https://huggingface.co/baseten).\n\n## How it works\n\n### In the website UI\n\n1. In your user account settings, you are able to:\n\n- 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.\n- Order providers by preference. This applies to the widget and code snippets in the model pages.\n\n![Inference Providers](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/inference-providers-baseten.png)\n\n2. As mentioned, there are two modes when calling Inference Providers:\n\n- Custom key (calls go directly to the inference provider, using your own API key of the corresponding inference provider)\n- 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)\n\n![Inference Providers](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/explainer.png)\n\n3. Model pages showcase third-party inference providers (the ones that are compatible with the current model, sorted by user preference)\n\n![Inference Providers](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/model-widget-v3.png)\n\n### From the client SDKs\n\nBaseten is available through the Hugging Face SDKs - `huggingface_hub` (>= 1.26.1) for Python and `@huggingface/inference` for JavaScript.\n\nThe following examples show how to use the latest [DeepSeek V4 Flash](https://huggingface.co/blog/deepseek-ai/DeepSeek-V4-Flash-0731) through Baseten. Use a [Hugging Face token](https://huggingface.co/settings/tokens) to authenticate - the request will be routed to Baseten automatically.\n\n#### From your favorite Agent Harness\n\nHugging Face Inference Providers are integrated in most Agent Harnesses - including Pi, OpenCode, Hermes Agents, OpenClaw, and more. This means you can plug baseten-hosted models straight into your favorite tools without any extra glue code. Browse the full list of integrations [here](https://huggingface.co/docs/inference-providers/en/integrations/index).\n\n#### from Python\n\n```python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://router.huggingface.co/v1\",\n    api_key=os.environ[\"HF_TOKEN\"],\n)\n\ncompletion = client.chat.completions.create(\n    model=\"deepseek-ai/DeepSeek-V4-Flash-0731:baseten\",\n    messages=[\n        {\n            \"role\": \"user\",\n            \"content\": \"Write a Python function that returns the nth Fibonacci number using memoization.\"\n        }\n    ],\n)\n\nprint(completion.choices[0].message)\n```\n\n#### from JS\n\n```js\nimport { OpenAI } from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://router.huggingface.co/v1\",\n    apiKey: process.env.HF_TOKEN,\n});\n\nconst chatCompletion = await client.chat.completions.create({\n    model: \"deepseek-ai/DeepSeek-V4-Flash-0731:baseten\",\n    messages: [\n        {\n            role: \"user\",\n            content: \"Write a Python function that returns the nth Fibonacci number using memoization.\",\n        },\n    ],\n});\n\nconsole.log(chatCompletion.choices[0].message);\n```\n\n## Billing\n\nFor 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.\n\nFor 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. (In the future, we may establish revenue-sharing agreements with our provider partners.)\n\n**Important Note** ‼️ PRO users get $2 worth of Inference credits every month. You can use them across providers. 🔥\n\nSubscribe to the [Hugging Face PRO plan](https://hf.co/subscribe/pro) to get access to Inference credits, ZeroGPU, Spaces Dev Mode, 20x higher limits, and more.\n\nWe also provide free inference with a small quota for our signed-in free users, but please upgrade to PRO if you can!\n\n## Feedback and next steps\n\nWe would love to get your feedback! Share your thoughts and/or comments here: [https://huggingface.co/spaces/huggingface/HuggingDiscussions/discussions/49](https://huggingface.co/spaces/huggingface/HuggingDiscussions/discussions/49)\n",
  "dateCreated": "2026-10-19T01:26:53.998049939+00:00",
  "date_created": "2026-08-06T00:00:00+00:00",
  "date_modified": "2026-08-06T00:00:00+00:00",
  "date_published": "2026-08-06T00:00:00+00:00",
  "description": "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.…",
  "external_url": "https://huggingface.co/blog/baseten",
  "git": {
    "commit": "ebb0941c5c06a2ab2377342d607535262a3e969e",
    "path": "items/huggingface-co/2026/08/2026-08-06-baseten-on-hugging-face-inference-providers-fire.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/ebb0941c5c06a2ab2377342d607535262a3e969e/items/huggingface-co/2026/08/2026-08-06-baseten-on-hugging-face-inference-providers-fire.md"
  },
  "id": "urn:aggr:item:752b53d0dca8de6d8eea24bb443eaa42f67bd1a2",
  "isBasedOn": {
    "@id": "https://huggingface.co/blog/baseten"
  },
  "mainEntity": {
    "@id": "https://huggingface.co/blog/baseten",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-08-06-baseten-on-hugging-face-inference-providers-fire/#webpage"
    },
    "dateModified": "2026-08-06T00:00:00+00:00",
    "datePublished": "2026-08-06T00:00:00+00:00",
    "headline": "Baseten on Hugging Face Inference Providers",
    "image": {
      "@type": "ImageObject",
      "caption": "banner image",
      "height": 90,
      "url": "https://huggingface.co/blog/assets/inference-providers/welcome-baseten.png",
      "width": 160
    },
    "timeRequired": "PT4M",
    "url": "https://huggingface.co/blog/baseten",
    "wordCount": 686
  },
  "name": "Archived snapshot: Baseten on Hugging Face Inference Providers",
  "preview": {
    "alt": "banner image",
    "color": null,
    "height": 90,
    "placeholder": {
      "data_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=",
      "hash": ""
    },
    "url": "https://huggingface.co/blog/assets/inference-providers/welcome-baseten.png",
    "width": 160
  },
  "reading_minutes": 4,
  "replicated_at": null,
  "source": "huggingface-co",
  "source_name": "Hugging Face - Blog",
  "summary": null,
  "tags": [],
  "temporalCoverage": "2026-10-19T01:26:53.998049939+00:00",
  "title": "Baseten on Hugging Face Inference Providers",
  "url": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-08-06-baseten-on-hugging-face-inference-providers-fire/",
  "word_count": 686
}