Build Your Own Chatbot Assistant in 2 Minutes with Hugging Face

Yaduvanshiharsh
3 min readFeb 17, 2024

Hugging Face has introduced Assistant, built on top of Hugging Chat. With this platform, you can create your own chatbot assistant in under 2 minutes and deploy it at no cost and the added advantage is that you don’t need to write a single line of code from creating the assistant to deploying it on Hugging Face. Currently, Hugging Face is not charging any fees for creation or deployment of the assistant ; it’s free of charge.

You have the flexibility to choose from various LLM (Large language model) options for your assistant

  • Mistralai/Mixtral-8x7B-Instruct-v0.1
  • Meta-llama/Llama-2–70b-chat-hf
  • NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO
  • Codellama/CodeLlama-70b-Instruct-hf
  • Mistralai/Mistral-7B-Instruct-v0.2
  • Openchat/openchat-3.5–0106

Let’s create a new assistant tailored for coding help:

  1. Start by visiting the page Hugging Chat Assistant
Homepage of Hugging Chat Assistant (image by Author)

Here, you can explore popular assistants created by the community.

2. Click on “Create new Assistant,” and a new page will open

(Image by Author)

3. Fill in all the details for your own assistant

Today, We will be creating a Chatbot Assistant which will help us in coding lets name it as CodeBuddy and provide a description like, “Meet Code Buddy Assistant, your trusted ally in the world of coding. It will help you in crafting new lines of code, untangling bugs, or optimizing for peak performance.”

Choose a model, for CodeBuddy, I’ve selected codellama/CodeLlama-70b-Instruct-hf LLM.

In the User start messages section, provide sample text to guide users in asking questions, such as:

  • Python code to connect with AWS S3 bucket
  • Java code to create a simple Spring Boot-based API

The crucial part of assistant creation is the Instructions (system prompt). For CodeBuddy, I’m using the prompt:
‘You serve as a coding assistant, proficient in guiding users through the process of writing code in various programming languages such as Java, Python, C, C++, JavaScript, and more.

Your capabilities extend to resolving errors that users encounter during code execution, as well as offering assistance in optimizing and refactoring code for enhanced efficiency and readability.’

You can also add an image for your bot, under Avatar section, then click on create, Voila! Your bot is created. For my CodeBuddy, the URL is https://hf.co/chat/assistant/65bd4f9a5aee22b1d9ae14fb

Our own assistant i.e. CodeBudyy (Image by Author)
HomePage of our assistant CodeBuddy

Try asking some question to the Bot like ‘java code to create a simple spring boot based API’

Our bot is working😊

Feel free to ask any coding-related question in any programming language, and our CodeBuddy will be more than happy to assist you.

Currently, Hugging Face has not integrated support for RAG or any external database connection. Therefore, training on personal data is not possible, but the platform is excellent for day-to-day activities. Additionally, disabling data sharing in your settings ensures that your conversations will not be used for any downstream purposes, including research or model training.

🟠 Medium’s Boost / Find AI’s Honest Limits / FREE GPT salternative

--

--