Skip to main content
Hugging Face is a platform for building, training, and deploying open-source models. You can use SambaNova as an inference provider to access SambaNova models through Hugging Face.

Prerequisites

Setup

1

Enable SambaNova as an inference provider

Go to your Hugging Face account settings, navigate to Inference Providers, and enable SambaNova.
Hugging Face inference providers settings with SambaNova enabled
2

Add your SambaCloud API key

Enter your SambaCloud API key in the provider configuration.Get your API key from the SambaCloud portal.
Hugging Face API key configuration for SambaNova

Usage

There are two ways to use Inference APIs:
  • Custom key: Your requests are sent directly to SambaNova using your own API key. Usage is billed to your SambaNova account.
  • Routed by HF: Your requests are routed through Hugging Face, so you don’t need a separate provider API key. Usage fees are billed to your Hugging Face account.

Using the Python SDK

Install the required package:
The example below demonstrates how to run a model through SambaNova as the inference provider. You can authenticate with your SambaCloud API key.

Additional resources

Troubleshooting

Ensure your Hugging Face account is verified and eligible for third-party inference providers. Check Hugging Face Inference Providers docs.
The api_key parameter in the SDK takes your SambaNova API key, not your Hugging Face token — this is the most common cause of 401 errors.
  1. Confirm the key in your code matches the one on the SambaNova API dashboard.
  2. If the key is expired or revoked, generate a new one from the dashboard and update it in Hugging Face Inference Providers settings and in your code.
Upgrade with pip install --upgrade "huggingface_hub>=0.28.0".