AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Configure HuggingChat for Custom Coding Models and Dedicated Endpoints

羅馥伊 · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Developers frequently run into the exact same dead end: they open HuggingChat, click through settings, and search for a custom input box where they can paste a private Hugging Face Inference Endpoint URL or a third-party API key. At 365Finds, we understand that frustration. You have a specialized coding model—like Qwen 2.5 Coder or DeepSeek-Coder—deployed on private infrastructure, and you want HuggingChat's clean conversational UI without queuing behind public rate limits.

Here is the reality: the public platform at huggingface.co/chat is a managed showcase service. Its web interface does not allow individual end users to plug arbitrary third-party endpoints or private Inference Endpoints directly into personal UI settings.

To run HuggingChat with your own endpoints, you deploy its open-source foundation: Chat UI (huggingface/chat-ui). It runs seamlessly in a private Hugging Face Space or Docker container, communicates with any OpenAI-compatible backend, and gives you total architectural authority over inference parameters and API routing.

1. Switching to Public Coding Models on Hosted HuggingChat

If your workflow only requires testing leading open-source coding models without hosting private hardware, the hosted HuggingChat web interface provides immediate access:

  1. Navigate to https://huggingface.co/chat/ and sign in with your Hugging Face credentials.
  2. Click the model selector at the top of the interface or open Settings (⚙️) > Models.
  3. Select an active coding-specialized model from the curated list, such as Qwen 2.5 Coder 32B Instruct.
  4. To standardize prompting conventions, go to /chat/assistants/new and build a dedicated coding assistant. You can assign precise system instructions—such as enforcing type safety, unit test coverage, or specific framework styles—while binding the assistant to that underlying base model.

While this hosted route requires zero setup, 365Finds notes its clear limitations: shared inference pools impose strict rate throttling during peak hours, context window lengths are frequently constrained, and you cannot connect proprietary fine-tuned weights.

2. Connecting Custom Endpoints via a Private Chat UI Instance

When an engineering workflow demands dedicated throughput, proprietary code privacy, or specialized models on custom infrastructure, self-hosting the HuggingChat interface is the established engineering path.

Step 1: Provision Your Dedicated or Third-Party Endpoint

Your model backend must expose an OpenAI-compatible /v1/chat/completions API:

Step 2: Deploy Chat UI to Hugging Face Spaces

  1. Visit huggingface.co/new-space, select Docker, and choose the official chat-ui template.
  2. In your Space dashboard, open Settings > Variables and secrets.
  3. Provide your HF_TOKEN secret so the container can authenticate against protected endpoints and gated models.

Step 3: Configure Model Endpoints

For a single backend, define universal routing variables:

OPENAI_BASE_URL=https://<endpoint-id>.<region>.endpoints.huggingface.cloud/v1
OPENAI_API_KEY=hf_your_access_token

To configure multiple coding models or blend dedicated Inference Endpoints with third-party providers, define the MODELS environment variable using JSON format:

MODELS=`[
  {
    "id": "Qwen/Qwen2.5-Coder-32B-Instruct",
    "name": "Qwen 2.5 Coder (Dedicated Endpoint)",
    "parameters": {
      "temperature": 0.2,
      "max_new_tokens": 4096
    },
    "endpoints": [
      {
        "type": "openai",
        "baseURL": "https://<endpoint-id>.<region>.endpoints.huggingface.cloud/v1",
        "apiKey": "hf_your_access_token"
      }
    ]
  },
  {
    "id": "deepseek-coder",
    "name": "DeepSeek Coder (Third-Party API)",
    "parameters": {
      "temperature": 0.1,
      "max_new_tokens": 8192
    },
    "endpoints": [
      {
        "type": "openai",
        "baseURL": "https://api.together.xyz/v1",
        "apiKey": "your_third_party_key"
      }
    ]
  }
]`

3. 365Finds Assessment & Practical Trade-Offs

365Finds recommends choosing your deployment path based on engineering economics rather than convenience alone:

Chat UI loads model definitions into memory during application initialization, requiring a complete Space restart whenever environment variables or endpoint credentials are updated.

References