Cohere Integration with Hugging Face Inference Providers
Hugging Face has integrated Cohere as a supported Inference Provider on the HF Hub. This integration marks the first time a model creator has shared and served their models directly on the Hub, enabling serverless inference for a comprehensive suite of enterprise-focused AI solutions.
Supported Cohere Models
Cohere and Cohere Labs provide several models optimized for specific business and research applications, now available via serverless inference:
- c4ai-command-a-03-2025: Designed for high-demand enterprises requiring fast, secure, and high-quality AI. It features a 256k context length, advanced retrieval-augmented generation (RAG) with verifiable citations, agentic tool use, and multilingual support for 23 languages.
- aya-expanse-32b: A state-of-the-art multilingual model supporting 23 languages (including Arabic, Chinese, French, German, Hindi, Japanese, Korean, and Spanish) with a 128k context length.
- c4ai-command-r7b-12-2024: An open-weight model optimized for low-cost and low-latency use cases. It supports 23 languages and provides citation-verified RAG, reasoning, and agentic tool use with a 128k context length.
- aya-vision-32b: A 32-billion parameter multimodal model optimized for vision-language tasks such as OCR, captioning, visual reasoning, and question answering across 23 languages.
Other supported models include c4ai-command-r-v01, c4ai-command-r-plus, c4ai-command-r-08-2024, aya-expanse-8b, and aya-vision-8b.
Implementation and Access Methods
Users can access Cohere models through the Hugging Face website UI or via several client SDKs.
Website UI
Users can filter the model hub by the Cohere inference provider to find compatible models. From the Model Card, users can select the provider and run inference directly within the UI.
Client SDKs
Cohere models can be invoked using the following methods:
- Python (huggingface_hub): By installing
huggingface_hub(v0.30.0 or later) and specifyingprovider="cohere"in theInferenceClient. - JavaScript (@huggingface/inference): By using the
HfInferenceclient and specifying theprovider: "cohere"parameter in thechatCompletioncall. - OpenAI Client: By setting the
base_urltohttps://router.huggingface.co/cohere/compatibility/v1and using the OpenAI client library.
Agentic Tool Use
Cohere models support state-of-the-art agentic tool use through both the Hugging Face Hub client and the OpenAI client. This allows models to interact with external APIs by defining tools (functions) and passing them to the inference client.
For example, a tool can be defined to fetch flight information between two cities. The model's chat template (which is open source) handles the representation of the tool definition, and the client passes the tool calls and results back to the model to generate a final response.
Billing and Credits
Billing for Cohere models on the Hub is handled based on the authentication method:
- Direct Requests: Users using a Cohere API key are billed directly through their Cohere account.
- Routed Requests: Users authenticating via the Hub pay standard Cohere API rates with no additional markup from Hugging Face.
Additionally, Hugging Face PRO users receive $2 worth of Inference credits monthly, which can be applied across different providers.