How to Set Up Your Own Offline AI Chatbot

Offline Chatbot Cover Image

The usefulness of popular online chatbots like ChatGPT is unquestionable – they help us write, analyze, and solve problems daily. But what if you don’t want your conversations stored on someone else’s servers or need to access AI even without an Internet connection? You can set up your own offline AI chatbot that runs entirely on your computer.

What Is an Offline AI Chatbot and What Can It Do?

A local (offline) AI chatbot is essentially an artificial intelligence model that runs directly on your computer, using your own hardware resources – your CPU (processor), GPU (graphics card), and RAM (memory) – to process and generate responses.

Jan Ai Create Function In Javascript

There are many local AI models available today, with new ones being released regularly. Most of these are based on open-source models published by major tech companies like Meta (Llama), Google (Gemma), Microsoft (Phi), and Mistral (Codestral, Mistral_7B). You can find their rankings on the Open LLM leaderboard.

Different models excel at different tasks. Some are specialists – particularly good at coding, creative writing, and role-playing – while others are generalists that can handle a wide range of tasks. They also vary in their content filtering: some models are strictly filtered and won’t touch anything NSFW (Not Safe For Work), while others don’t hesitate to use vocabulary that would make an old sailor blush.

When choosing a local AI model, size is another factor to consider. Ideally, the entire model should fit into your GPU’s VRAM (Video RAM). For example, if your graphics card has 8 GB of VRAM, you can comfortably run a 7 GB model, but a 10 GB model would be too large. Generally, larger models tend to produce better results, but they require more powerful hardware.

For this guide, I’m using the Qwen2.5 Coder 14B model, as it’s relatively compact (8.37 GB), can be used commercially, and shows impressive coding capabilities for its size. I recommend experimenting with different models to find what works best for your needs. Communities like r/LocalLLaMA are excellent resources for staying up to date.

How to Install and Configure an Offline AI Chatbot

To set up an offline AI chatbot, you need two key components: a local AI model and a user-friendly interface to interact with the model in a familiar chat style. There are software solutions that handle both aspects seamlessly.

My top pick is Jan.ai, as it’s completely open source and offers a clean, intuitive interface that resembles popular chat applications. It also includes a built-in model hub that makes downloading and managing AI models straightforward. Another option is LM Studio, which generally adds support for cutting-edge models sooner but doesn’t publish its source code.

Installing Jan.ai and Downloading Your First Model

First, visit the Jan.ai website and download the appropriate version for your system. The installation process is straightforward: run the downloaded installer file and follow the standard installation prompts.

Once installed, launch Jan.ai. Click the Hub tab to browse available models. Find a model that meets your criteria and is compatible with your hardware (Jan.ai makes this obvious), and click Download. The download and installation may take some time, depending on your Internet connection.

Qwen2.5 Jan Ai Model Download

Before you start chatting, there’s one more important step for optimal performance. If you have a compatible NVIDIA graphics card, go to Settings and find the GPU Acceleration option. Enable it to significantly improve the model’s response speed. You may need to install or update your NVIDIA drivers and CUDA Toolkit if prompted.

Having a Conversation With Your Local AI Chatbot

With a model downloaded, start your first chat by clicking the Chat button at the top of the left sidebar. A new thread will open, and your model will be selected automatically. If you have downloaded more than one model, click the model name to choose one.

To send your first chat message via your offline AI chatbot, click the Ask me anything field, type anything you want, and hit Enter. The first response will take a while, as the model has to load first, but subsequent responses should be relatively speedy.

Jav Ai First Question

Continue the conversation in the same thread, which makes sense if you want to dig deeper into the same topic, as the AI chatbot can benefit from the context provided by your previous messages. Alternatively, click the New Thread button in the top-left corner.

Jan Ai New Thread

Generally, I recommend creating a new thread whenever you want to start a fresh topic or switch to a different task. This helps keep your conversations organized and prevents the AI from getting confused by mixing unrelated context from previous discussions.

Configuring How Your Local AI Chatbot Behaves

What’s great about Jan.ai is that you can customize how your AI chatbot responds to your prompts. Mainly, this customization happens in two ways: through general instructions and specific parameters.

First, give your AI assistant general instructions about how it should behave. Click the Settings button next to the name of your model and navigate to the Assistant tab in the right sidebar of any chat thread to find an Instructions field.

Jan Ai Instructions

You can type guidelines for how you want the AI to respond. For example, you could tell it to “Act as a programming tutor who explains concepts in simple terms” or “Respond like a creative writing coach who provides constructive feedback.”

Model Settings Jan Ai

Beyond basic instructions, you can fine-tune various technical parameters that control how the AI generates its responses. In the Model tab of the right sidebar, you’ll find several important settings, including:

  • Temperature: think of this as the AI’s creativity level. Lower values (0.0 – 0.5) make it give more predictable, focused responses, while higher values (0.8 – 2.0) make it more creative and varied (but potentially unfocused).
  • Max tokens: controls how long the AI’s responses can be. Higher values allow for longer, more detailed answers, while lower values keep things concise.
  • Context length: determines how much of your conversation the AI can remember and reference. A longer context means the AI can maintain more detailed discussions but may run slower.

Best of all, you can create different chat threads with different configurations, such as one thread with a high-temperature setting for creative writing and another with a low-temperature setting for precise technical answers – so don’t be afraid to experiment.

With a good model powering your offline AI chatbot, you can accomplish an impressive range of tasks. I’ve personally used an AI chatbot to help me create a modern web app from scratch, and the possibilities are truly endless: from writing and coding to analysis and creative projects.

All images and screenshots by David Morelo.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

David Morelo Avatar