AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Switch Open-Source Model Backends and Configure System Prompts in HuggingChat

Natalia Amaral · 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

HuggingChat puts top open-weights models behind a clean interface, but developers frequently get stuck trying to force it to act like a deterministic development environment. The short answer: you switch backends either dynamically via the top-bar model selector or permanently in Settings > Models; and while you can paste instructions into global settings, 365Finds strongly advises creating custom HuggingChat Assistants to bind a specific model backend to an immutable system prompt.

Here is the exact operational guide, the architectural trade-offs, and how to prevent open-source models from drifting off your instructions.


Step 1: Switching Model Backends in the Web UI

HuggingChat gives you access to a rotating roster of hosted open-source models—typically flagship checkpoints like Meta's Llama 3.3 70B, Qwen 2.5 72B, Cohere's Command R+, and Mistral Nemo. Switching between them takes two clicks:

  1. In-Session Quick Switch:

    • Look at the header bar of your active conversation. Next to the HuggingChat logo or centrally in the top toolbar, click on the current model name (for example, meta-llama/Llama-3.3-70B-Instruct).
    • A modal or dropdown lists all currently hosted open backends alongside their parameter sizes, context window caps, and licensing highlights.
    • Select the target backend. The current chat immediately reroutes subsequent prompts through the newly chosen inference endpoint.
  2. Setting a Default Model in User Settings:

    • Click your profile icon or the gear icon in the lower-left sidebar to open Settings (/chat/settings).
    • Navigate to the Models tab.
    • Here, 365Finds recommends reviewing the active model list. You can toggle off models you never use to declutter the UI, and select your default model so new chat sessions start on your preferred engine without manual re-selection.

Step 2: Configuring System Prompts (The Trap vs. The Right Way)

Developers commonly look for a system prompt box in the chat window, only to find standard user input. There are two ways to inject system instructions in HuggingChat, but only one is production-grade.

The Quick (and Fragile) Way: Global Custom Instructions

Under Settings > General (or Custom Instructions), HuggingChat allows you to enter a global preprompt that appends to every conversation.

We at 365Finds advise against using this for development tasks. A global prompt set up for strict TypeScript return types will butcher your next conversational brainstorming session with a different model. Furthermore, when you switch backends, different tokenizers handle global system tags differently, causing unexpected hallucinations.

The Recommended Way: Create a Dedicated Assistant

The cleanest architecture in HuggingChat is to bind each specialized workflow into an Assistant (/chat/assistants):

  1. Open the left sidebar and click Assistants, or navigate directly to https://huggingface.co/chat/assistants.
  2. Click Create new assistant.
  3. Select Model Backend: Click the model dropdown and pick the engine tailored to your task. For instance, choose Qwen/Qwen2.5-72B-Instruct or a specialized Coder model for syntax-heavy tasks, or meta-llama/Llama-3.3-70B-Instruct for complex multi-step reasoning.
  4. Define the System Prompt: In the System Prompt field, paste your explicit instructions. Because HuggingChat wraps this in the model's native chat template (<|im_start|>system... or [INST] <<SYS>>...), the backend treats it as ground truth rather than conversational user dialogue.
  5. Configure Tools & Metadata: Provide an evocative name (e.g., Postgres Query Optimizer), set web search toggles if your prompt requires live documentation retrieval, and click Create.

Your assistant now resides permanently in your sidebar. Whenever you open it, HuggingChat spins up a fresh session with the designated backend and locked system prompt already in place.


Choosing the Right Backend for Your System Prompt

Not all open backends digest system instructions equally. In our testing at 365Finds, you will notice sharp behavioral divergences depending on the model you pair with your prompt:

Model ArchitectureSystem Prompt AdherenceBest Development Use CasePotential Failure Mode
Qwen 2.5 (72B / Coder)Exceptional; respects rigid JSON schemas and negative rulesCode refactoring, schema transformations, API mockupsCan occasionally over-index on brevity if not explicitly told to elaborate
Llama 3.3 (70B Instruct)Strong; balanced tone with reliable logical guardrailsArchitecture analysis, technical writing, RFC draftingStricter default alignment; may decline aggressive penetration test prompts
Command R+High; natively trained for tool calling and grounded RAGDocumentation parsing, multi-source synthesisSlower token generation throughput under high server load
Mistral Nemo / SmallModerate; responds well to concise prompt directivesFast iterations, basic script generation, summariesWill drift from complex multi-layered negative constraints after 5+ turns

Our direct recommendation: for structured code generation or deterministic JSON outputs, set your Assistant backend to Qwen 2.5. For long-form reasoning, documentation critique, or conceptual architecture, point it to Llama 3.3 70B.


Beyond the Hosted UI: Self-Hosting with chat-ui

If HuggingChat's hosted web interface does not provide the exact private model weights, fine-tunes, or Hugging Face Dedicated Inference Endpoints your team requires, the entire stack is open-source under Hugging Face's chat-ui.

In a self-hosted deployment, backend switching and system prompt templates are governed in .env.local or your backend configuration file via the MODELS JSON array:

[
  {
    "name": "meta-llama/Llama-3.3-70B-Instruct",
    "displayName": "Llama 3.3 70B",
    "preprompt": "You are a senior systems engineer. Output POSIX-compliant shell scripts with zero conversational preamble.",
    "parameters": {
      "temperature": 0.2,
      "max_new_tokens": 2048
    },
    "endpoints": [{
      "type": "tgi",
      "url": "https://your-custom-endpoint.endpoints.huggingface.cloud"
    }]
  }
]

In self-hosted chat-ui, the preprompt string is fed directly into the model's template variable {{@root.preprompt}}, ensuring zero latency overhead and absolute prompt integrity.


The 365Finds Verdict

HuggingChat offers the most accessible playground for comparing frontier open-source models without spinning up GPU clusters. But treat the top-bar dropdown as an exploratory tool, not a workflow. For repeatable engineering work, build dedicated Assistants for each task: pair Qwen 2.5 with formatting rules for code, lock Llama 3.3 to an analysis prompt for design review, and keep your global settings clean.


References