AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Configure Custom System Prompts and Switch Open-Weight Models in HuggingChat

劉書磊 · 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

Testing how different open-weight architectures respond to system-level instructions usually means spinning up local vLLM instances or racking up serverless inference API bills. HuggingChat bypasses that friction entirely. It provides a browser-based, zero-cost sandbox running top-tier open-weight models, but its configuration workflow is not immediately obvious to developers accustomed to ChatGPT's global user instructions.

In HuggingChat, custom system prompts are not managed through a global account profile setting. Instead, Hugging Face implements custom system instructions through its Assistants architecture, while general model switching happens directly through the interface header and the application settings menu.

At 365Finds, we rely heavily on HuggingChat to stress-test prompt resilience across disparate model families. Here is how developers can configure custom system prompts, switch underlying engines, and structure prompt-benchmarking workflows efficiently.


1. How to Switch Open-Weight Models in the Main Chat

If you only need to interact with standard model baselines without overriding default system behaviors, model switching takes two clicks.

Steps in the Web Interface:

  1. Navigate to HuggingChat.
  2. Locate the model picker at the top-left corner of the chat pane (or inside the sidebar menu on compact screens), which displays the currently active model (such as Meta Llama, Qwen, Mistral, or Cohere Command R+).
  3. Click the model badge to open the active model drawer.
  4. Select the desired open-weight engine from the catalog.
  5. Alternatively, open Settings (gear icon at the bottom-left of the sidebar) and click Models to review the list of supported endpoints, read model-specific token context limits, and choose your default engine.

What Developers Need to Know About Mid-Chat Switching:


2. How to Configure Custom System Prompts via HuggingChat Assistants

To inject custom behavioral guidelines, enforce strict output schemas (such as raw JSON), or build specialized role prompts (such as an aggressive code reviewer or synthetic data generator), developers must use Assistants.

HuggingChat does not offer an ephemeral per-session system prompt box in the default chat view. Creating a custom Assistant binds your exact system prompt to a designated model engine and stores it as a reusable environment.

[Developer System Instructions]
              │
              ▼
   [HuggingChat Assistant] ──► [Select Open Model: Llama / Qwen / Mistral]
              │
              ▼
    [Execution Sandbox / Web Search Tooling]

Step-by-Step Configuration:

  1. In the left navigation rail, click Assistants or go directly to huggingface.co/chat/assistants.
  2. Click Create new assistant in the top right.
  3. Configure the essential metadata:
    • Avatar & Name: Give the assistant a technical identifier (e.g., JSON-Schema-Extractor or Security-Audit-Linter).
    • Description: A short operational summary for your workspace.
  4. Select the Model: Choose the underlying open-weight model that will execute the instructions from the dropdown menu.
  5. Define the System Prompt: Scroll to the User Instructions (System Prompt) field. Paste your prompt here. This block is injected at the system level into the model's chat template before any user turn is processed.
  6. Configure Tools (Optional): Toggle Internet Search if your custom prompt requires live web retrieval to ground its analysis.
  7. Click Create to save.

Once created, the assistant appears in your personal library and can be launched with one click. Any conversation initiated under that assistant automatically applies your custom system prompt.


3. The 365Finds Workflow: Benchmarking Prompt Adherence Across Models

What makes HuggingChat indispensable to our workflow at 365Finds is how easily it turns into a prompt evaluation harness.

When tuning system prompts for production applications, prompt engineers frequently encounter model-specific quirks: a system constraint that Qwen follows without hesitation might be routinely ignored by another model of similar parameter size.

Rather than editing API scripts for initial sanity checks, 365Finds uses this cross-model evaluation loop:

Evaluation StepAction in HuggingChatDiagnostic Focus
1. Draft Baseline PromptWrite strict constraints in an AssistantNegative constraints, edge-case handling, format adherence
2. Test Primary EngineRun 5–10 challenging inputs against Model ADetect hallucination, refusal triggers, formatting leaks
3. Swap Model ParameterOpen Assistant Settings > change Model dropdown to Model BObserve whether the prompt degrades or holds up
4. Clone for A/B ComparisonCreate parallel Assistants with identical prompts on different enginesCompare output deterministic consistency side-by-side

Because modifying the model dropdown inside an existing Assistant takes under five seconds, you can verify whether prompt failures stem from your wording or from the underlying model's instruction-following limitations.


4. Self-Hosted Developers: Configuring Models and Prompts in chat-ui

HuggingChat's entire front-end and inference router are open source under the huggingface/chat-ui repository. If you host your own internal deployment using private vLLM, TGI (Text Generation Inference), or Ollama endpoints, model switching and default system prompts are managed in the server configuration.

In your self-hosted setup, models and their preprompts are declared in .env.local via the MODELS JSON array:

[
  {
    "name": "meta-llama/Llama-3.3-70B-Instruct",
    "displayName": "Llama 3.3 70B (Local Inference)",
    "description": "Enterprise coding and reasoning agent",
    "preprompt": "You are a senior systems engineer. You output only production-grade code without preamble or boilerplate commentary.",
    "parameters": {
      "temperature": 0.2,
      "top_p": 0.9,
      "max_new_tokens": 4096
    },
    "endpoints": [{
      "type": "tgi",
      "url": "http://127.0.0.1:8080"
    }]
  }
]

In this environment:


5. Our Assessment: Where HuggingChat Excels and Where It Frustrates

365Finds prefers HuggingChat over proprietary chat platforms whenever we need an unfiltered read on how open weights handle structured prompts. You do not deal with aggressive corporate guardrails masking the raw instruction capability of the architecture.

However, the user experience has one noticeable shortcoming: the absence of an ephemeral system prompt input in the standard chat window. If a developer wants to test a single sentence adjustment to a system role for two minutes, creating and naming an Assistant feels like unnecessary friction. A collapsible "Session Preprompt" drawer in the main view would make HuggingChat virtually unbeatable for rapid prototyping.

For persistent workflows, 365Finds recommends maintaining a dedicated folder of testing Assistants. Public HuggingChat instances operate under per-model query quotas that refresh hourly, with Hugging Face Pro subscribers receiving expanded capacity allocations.

References