Hugging Face Chat UI
Last updated Apr 21, 2026 Use Workers AI with Chat UI ↗︎, an open-source chat interface offered by Hugging Face.
Prerequisites
You will need the following:
- A Cloudflare account ↗︎
- Your Account ID
- An API token for Workers AI
Setup
First, decide how to reference your Account ID and API token (either directly in your .env.local using the CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN variables or in the endpoint configuration).
Then, follow the rest of the setup instructions in the Chat UI GitHub repository ↗︎.
When setting up your models, specify the cloudflare endpoint.
{
"name" : "nousresearch/hermes-2-pro-mistral-7b",
"tokenizer": "nousresearch/hermes-2-pro-mistral-7b",
"parameters": {
"stop": ["<|im_end|>"]
},
"endpoints" : [
{
"type": "cloudflare",
// optionally specify these if not included in .env.local
"accountId": "your-account-id",
"apiToken": "your-api-token"
//
}
]
}
Supported models
This template works with any text generation models that begin with the @hf parameter.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/workers-ai/configuration/hugging-face-chat-ui/#page","headline":"Hugging Face Chat UI","description":"Connect Workers AI models to Hugging Face's open-source Chat UI interface.","url":"https://developers.cloudflare.com/workers-ai/configuration/hugging-face-chat-ui/","inLanguage":"en","image":"https://developers.cloudflare.com/workers-ai/configuration/hugging-face-chat-ui/og.png?v=e9b5c6da7ed0c500","dateModified":"2026-04-21","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Use the OpenAI SDK with Workers AI Chat Completions, embeddings, and supported GPT-OSS Responses requests. title: OpenAI compatible API endpoints image: https://developers.cloudflare.com/workers-ai/configuration/open-ai-compatibility/og.png?v=43d7808c7c4959b5
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/workers-ai/llms.txt
Use this file to discover all available pages before exploring further.
Docs