AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Build, Configure, and Share Custom Assistants in HuggingChat

365Finds Editorial
Indexed 11,430 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

For developers and AI practitioners looking to build specialized conversational agents without being locked into proprietary ecosystems like OpenAI's Custom GPTs, Hugging Face provides HuggingChat Assistants. Powered by the open-source chat-ui engine, HuggingChat Assistants allow anyone to create, customize, and distribute task-specific AI agents driven entirely by open-weights large language models (LLMs).

Unlike proprietary assistant stores that require paid monthly subscriptions ($20/month or more for ChatGPT Plus/Team) for creators and end users alike, HuggingChat Assistants are completely free to build, test, and share. Furthermore, because the underlying application is open-source, developers are not trapped in a hosted platform: you can test an assistant on Hugging Face’s hosted interface and later port the exact same configuration to an enterprise self-hosted deployment.

This guide walks through how to design, configure, and distribute custom HuggingChat Assistants, covering open-weights model selection, system prompt engineering, Community Tools integration, and practical security considerations.


What Powers HuggingChat Assistants?

HuggingChat Assistants combine three core architectural components:

  1. Open-Weights Foundation Models: Rather than relying on a single proprietary model family, HuggingChat allows you to select from leading open-weights models hosted on Hugging Face’s inference infrastructure, such as Meta Llama (e.g., Llama 3.3 70B, Llama 3.1), Mistral and Mixtral architectures, Qwen 2.5, DeepSeek, or Cohere Command R+.
  2. System Prompt (Preprompt) Configuration: A persistent instruction layer that primes the model’s persona, operational rules, output formatting constraints, and domain-specific knowledge boundaries.
  3. Tool and Context Extensions: Native web search capabilities and "Community Tools"—which turn public Hugging Face Spaces into callable Gradio APIs for image generation, code execution, or retrieval-augmented generation (RAG) over custom documents.

The interface is driven by huggingface/chat-ui, a production-grade SvelteKit web application backed by MongoDB and OpenAI-compatible inference endpoints.


Step-by-Step: Creating a Custom Assistant in HuggingChat

Building an assistant in the hosted HuggingChat interface takes only a few minutes and requires no code for standard configurations.

1. Access the Creation Studio

  1. Navigate to the HuggingChat Assistants Hub.
  2. Log into your free Hugging Face account.
  3. Click the "Create new assistant" button in the top-right corner (or open /chat/settings/assistants/new directly).

2. Define Metadata and Visual Identity

In the creation form, configure the assistant's public persona:

3. Choose the Optimal Open-Weights Model

Model selection directly influences context processing, reasoning fidelity, and tool compatibility:

When selecting your base model, evaluate whether you intend to use Community Tools, as tool-calling requires a model checkpoint trained to handle function calling and tool syntax.

4. Author the System Prompt (Preprompt)

The system prompt is the cognitive core of your assistant. It remains active throughout every interaction, shaping how the model interprets inputs and structures outputs.

Key techniques for crafting high-performing system prompts with open-weights LLMs include:

Example System Prompt: Technical Code Review Assistant

### Role & Persona
You are a Staff Software Engineer specializing in Python, Go, and cloud-native architecture. Your role is to perform rigorous, production-grade code reviews focused on security, latency, and idiomatic maintainability.

### Operational Guidelines
1. Analyze the user's submitted snippet before providing suggestions.
2. Structure your review into three distinct sections:
   - **Critical Vulnerabilities & Bugs:** Highlight severe logic errors, security risks (SQLi, SSRF, memory leaks), or race conditions.
   - **Performance & Idiomatic Refactoring:** Suggest algorithmic improvements and language-native patterns.
   - **Refactored Implementation:** Provide a fully commented, drop-in replacement code block.
3. If the user's code is already optimal, explicitly validate why it conforms to best practices.
4. Keep explanations direct, technical, and free of conversational filler.

5. Configure User Message Starters

Add 2 to 4 conversation starters (e.g., "Review this Python async connection pool for memory leaks", "Optimize this PostgreSQL index strategy"). These appear as clickable prompt cards when a user initiates a new chat session, guiding them immediately toward optimal prompt formats.

6. Enable Community Tools and External Capabilities

HuggingChat allows assistants to interact with external tools directly:

7. Save and Activate

Click "Create" to instantiate the assistant. Your assistant is immediately active and ready to test within your personal HuggingChat workspace.


Sharing and Community Distribution

Once created, distributing an assistant requires no hosting configuration:


Enterprise and Self-Hosting: Taking Assistants Beyond HF Cloud

One of the greatest advantages of HuggingChat Assistants is architectural portability. Because HuggingChat is powered by huggingface/chat-ui, you are never locked into Hugging Face’s public hosted servers.

Engineering teams with stringent data sovereignty, air-gapped environments, or internal model pipelines can deploy their own assistant platform:

  1. Deploy chat-ui Locally or in Private Cloud: Clone huggingface/chat-ui and run it via Docker or Node.js connected to a private MongoDB database.
  2. Connect to Private Inference Endpoints: Configure OPENAI_BASE_URL in .env.local to point to self-hosted inference servers—such as vLLM, Hugging Face Text Generation Inference (TGI), Ollama, or llama.cpp server—hosting fine-tuned company weights.
  3. Enable Assistants via Environment Variables: Set ENABLE_ASSISTANTS=true in your .env.local. Users within your organization can build, test, and share internal assistants that reference private models without sending data to external endpoints.

Best Practices and Security Considerations

When building and publishing HuggingChat Assistants, keep the following operational principles in mind:


References