Hugging Face Integrates Public AI as an Inference Provider

Hugging Face has integrated Public AI as a supported Inference Provider on the Hugging Face Hub. This integration allows users to access public and sovereign AI models—such as those from the Swiss AI Initiative and AI Singapore—via serverless inference directly from model pages and through client SDKs.

Public AI Infrastructure and Mission

Public AI is a nonprofit, open-source project that provides an Inference Utility to support public AI model builders. Its infrastructure is designed for resilience and distributed access:

  • Backend: The utility uses a vLLM-powered backend with servers exposing OpenAI-compatible APIs.
  • Deployment: Compute is deployed across clusters donated by national and industry partners.
  • Routing: A global load-balancing layer transparently routes requests to the most efficient compute source regardless of the host country.
  • Funding: Free public access is currently supported by advertising subsidies and donated GPU time, with long-term stability intended to be anchored by institutional and state contributions.

Integration and Usage Workflow

Users can access Public AI models through the Hugging Face Hub website UI or via official client SDKs. The system supports two primary authentication and routing modes:

Website UI Configuration

Users can manage their preferences in account settings to:

  1. Set API Keys: Users can provide their own API keys for specific providers. If no custom key is set, requests are routed through Hugging Face.
  2. Order Preferences: Users can prioritize which providers appear first in model page widgets and code snippets.

Routing Modes

  • Custom Key: Requests are sent directly to the inference provider using the user's provider-specific API key.
  • Routed by HF: Requests are authenticated via a Hugging Face token, and charges are applied to the Hugging Face account rather than the provider's account.

Technical Implementation via SDKs

Public AI is integrated into the Python and JavaScript SDKs. To use Public AI as a provider, the huggingface_hub Python library must be version 0.34.6 or higher.

Python Example

Using the InferenceClient from huggingface_hub, users can specify provider="publicai" and provide an api_key (either a Hugging Face token for routing or a Public AI key).

JavaScript Example

Using the @huggingface/inference library, the provider parameter is passed within the chatCompletion method to route the request to Public AI.

Billing and Credits

As of September 17, 2025, usage of the Public AI Inference Utility through Hugging Face Inference Providers is free of charge, though pricing and availability are subject to change.

For other providers on the platform, billing follows these rules:

  • Direct Requests: Users are billed by the provider when using a provider-specific API key.
  • Routed Requests: Users pay standard provider API rates via Hugging Face with no additional markup.
  • PRO Plan Benefits: Hugging Face PRO users receive $2 in monthly Inference credits that can be used across different providers.

Sources