Inference Providers documentation
PublicAI
PublicAI
All models supported by the PublicAI Inference Utility can be found here
The Public AI Inference Utility is a nonprofit, open-source project. Their team builds products and organizes advocacy to support the work of public AI model builders like the Swiss AI Initiative, AI Singapore, AI Sweden, and the Barcelona Supercomputing Center.
They believe in public AI — AI as public infrastructure like highways, water, or electricity. Think of a BBC for AI, a public utility for AI, or public libraries for AI.
Supported tasks
Chat Completion (LLM)
Find out more about Chat Completion (LLM) here.
Language
Client
Provider
Copied
import os
from huggingface_hub import InferenceClient
client = InferenceClient(
provider="publicai",
api_key=os.environ["HF_TOKEN"],
)
completion = client.chat.completions.create(
model="swiss-ai/Apertus-8B-Instruct-2509",
messages=[
{
"role": "user",
"content": "What is the capital of France?"
}
],
)
print(completion.choices[0].message)