AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Switch Foundation Models and Configure Web Search 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

HuggingChat is the most accessible staging ground for open-source foundation models on the web. Instead of locking developers into a single proprietary weights family, it lets you swap state-of-the-art open models and layer real-time web retrieval on top of them without paying API minimums. At 365Finds, we view HuggingChat not merely as an alternative to ChatGPT, but as an essential evaluation workbench for testing how architectures like Llama 3.3, Qwen 2.5, and Command R+ handle grounded reasoning.

Executing model switches and search configuration happens at two levels: directly in the hosted graphical interface at huggingface.co/chat, and through the environment configuration of its underlying open-source engine, chat-ui.


1. Switching Open-Source Foundation Models in the Web Interface

In the hosted HuggingChat interface, changing the underlying reasoning engine takes three clicks, but understanding what changes behind the scenes determines output quality.

Standard Model Switching

  1. Open HuggingChat in your browser.
  2. In the left navigation sidebar or directly next to the active chat header, click on the current model name (or navigate to the Settings menu via the gear icon).
  3. The Model Selector modal displays the active roster of supported open-weight foundation models. Click your target model (for example, meta-llama/Llama-3.3-70B-Instruct, Qwen/Qwen2.5-72B-Instruct, or CohereForAI/c4ai-command-r-plus) and select Activate.
  4. Alternatively, selecting Omni allows HuggingChat to automatically route your prompt to the model best suited for the detected task intent.

Creating Model-Locked Custom Assistants

If you switch models frequently for distinct workflows—such as architecture reviews versus documentation lookup—relying on the global model selector gets tedious. 365Finds recommends creating dedicated Assistants:

  1. Click Assistants in the left sidebar, then click Create New Assistant.
  2. Under Model, select your preferred base engine.
  3. Supply custom system instructions, define temperature parameters, and save. Each conversation started under that Assistant remains locked to that model without altering your global HuggingChat default.

2. Configuring Web Search: Global Toggle vs. Assistant Scoping

HuggingChat does not treat web search as a blind web dump. When search is active, HuggingChat runs a two-step Retrieval-Augmented Generation (RAG) pipeline: a background task model formulates search queries from your prompt, scrapes candidate pages into clean Markdown, embeds chunks locally using transformers.js (often via Xenova/gte-small or all-MiniLM-L6-v2), and injects the highest-scoring text passages into the primary model's context window.

Developers have two distinct ways to control this retrieval mechanism.

Method A: The Quick Web Search Toggle (Ad-Hoc Queries)

Directly adjacent to the message input box at the bottom of the chat interface sits the Web Search globe toggle.

Method B: Scoped Web Search via Custom Assistants (Recommended)

For technical research, unconstrained web search introduces too much SEO noise. HuggingChat's Assistant builder provides granular control over search boundaries. In the Assistant creation or edit screen, scroll to the Internet Access configuration:


3. Configuring Models and Search in Self-Hosted chat-ui

For development teams hosting HuggingChat internally using the open-source repository huggingface/chat-ui, model switching and web search providers are managed through the .env.local configuration.

Configuring Foundation Models

Define your target models inside the MODELS environment variable. You can connect to Hugging Face Inference Endpoints, vLLM, Text Generation Inference (TGI), or any OpenAI-compatible server:

MODELS=`[
  {
    "name": "meta-llama/Llama-3.3-70B-Instruct",
    "displayName": "Llama 3.3 70B",
    "endpoints": [{
      "type": "tgi",
      "url": "https://api-inference.huggingface.co/models/meta-llama/Llama-3.3-70B-Instruct",
      "authorization": "Bearer hf_..."
    }],
    "supportsTools": true,
    "parameters": {
      "temperature": 0.2,
      "max_new_tokens": 4096
    }
  }
]`

Configuring the Web Search Provider Backend

To enable the web search toggle on a private chat-ui instance, configure one of the supported search backends and an embedding model in .env.local:

# Search provider (Serper is the default for hosted HuggingChat)
SERPER_API_KEY=your_serper_api_key

# Alternatively, for fully air-gapped or private environments:
SEARXNG_QUERY_URL="https://searxng.internal.network/search?q=<query>&engines=duckduckgo,google&format=json"

# Local vector embeddings for scraped web chunks
TEXT_EMBEDDING_MODELS=`[
  {
    "name": "Xenova/gte-small",
    "chunkCharLength": 512,
    "endpoints": [{ "type": "transformersjs" }]
  }
]`
TASK_MODEL="meta-llama/Llama-3.1-8B-Instruct"

Setting TASK_MODEL ensures that a lightweight, fast model drafts search queries and formats summaries, leaving the primary foundation model dedicated to generating the final code or answer.


365Finds Technical Assessment

At 365Finds, our primary recommendation when working with HuggingChat is to avoid relying on small 8B parameter models for web-augmented developer workflows. Smaller models struggle to discard conflicting information retrieved from search scrapes, frequently blending outdated syntax from web snippets with modern library methods. Pairing Qwen/Qwen2.5-72B-Instruct or meta-llama/Llama-3.3-70B-Instruct with an Assistant configured for Domain Search offers the highest reliability-to-cost ratio currently available in open-source chat environments.

In high-concurrency production setups, HuggingChat's public hosted web search can occasionally hit upstream scraper rate limits; pinning a private deployment to an internal SearXNG instance using SEARXNG_QUERY_URL resolves external API dependencies entirely.

References