Skip to content
Try Hanzo
Language: English (United States)

Use Hanzo AI with Hugging Face

Access Hugging Face models and use the HF Inference API through the Hanzo AI API. Also use Hanzo AI models with HuggingFace Hub tooling.

Get API key — Free
InferenceClient via Hanzopython
pip install huggingface_hub
 
from huggingface_hub import InferenceClient
 
client = InferenceClient(
    base_url="https://api.hanzo.ai/v1",
    api_key="your-hanzo-api-key",
)
 
output = client.chat.completions.create(
    model="meta-llama/llama-4-scout",
    messages=[{"role": "user", "content": "Hello!"}],
)
2 of 10 lines point at Hanzo

hf CLI with Hanzo endpoint

python

4 of 8 lines point at Hanzo
hf CLI with Hanzo endpointpython
# Use hf for model downloads, Hanzo for inference
hf download meta-llama/Llama-4-Scout-17B-16E-Instruct
 
# Then serve via Hanzo API
from openai import OpenAI
client = OpenAI(
    base_url="https://api.hanzo.ai/v1",
    api_key="your-hanzo-api-key",
)

JS InferenceClient

typescript

3 of 8 lines point at Hanzo
JS InferenceClienttypescript
import { InferenceClient } from "@huggingface/inference";
 
const client = new InferenceClient("your-hanzo-api-key");
 
const chatCompletion = await client.chatCompletion({
  model: "meta-llama/llama-4-scout",
  messages: [{ role: "user", content: "Hello!" }],
  provider: "hanzo",
  endpointUrl: "https://api.hanzo.ai/v1",
});

cURL inference

bash

2 of 4 lines point at Hanzo
cURL inferencebash
curl https://api.hanzo.ai/v1/chat/completions \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"meta-llama/llama-4-maverick","messages":[{"role":"user","content":"Hi"}]}'

Created by Hugging Face

License: Apache-2.0 · View source on GitHub →

Hanzo AI is OpenAI-compatible, so existing Hugging Face code works with zero refactoring. We deeply appreciate the Hugging Face team for building and maintaining this open-source project.

Ready to get started?

Create a free account and get your API key. The Free plan includes free model requests and Kai decisions, no card.