---
title: "So you want to build your own open source ChatGPT-style chatbot…"
description: "Mozilla's innovation team built a self-hosted, open source LLM chatbot prototype on its own GCP infrastructure during a one-week hackathon, and walks through each layer of the stack and the tradeoffs behind each choice."
url: "https://swe.quest/articles/so-you-want-to-build-your-own-open-source-chatgpt-style-chatbot-fa0e68b18d9b7b0d"
canonical: "https://hacks.mozilla.org/2023/07/so-you-want-to-build-your-own-open-source-chatbot/"
source: "Mozilla Hacks"
published: "2023-07-27"
difficulty: "medium"
kind: "Case study"
reading_minutes: 19
tags: ["llms","inference","rag","open-source","ai-safety"]
---

# So you want to build your own open source ChatGPT-style chatbot…

A post on [Mozilla Hacks](https://swe.quest/sources/mozilla-hacks.md), published 2023-07-27, 19 min read, Case study. Original: [https://hacks.mozilla.org/2023/07/so-you-want-to-build-your-own-open-source-chatbot/](https://hacks.mozilla.org/2023/07/so-you-want-to-build-your-own-open-source-chatbot/)

## Summary

Mozilla's innovation team built a self-hosted, open source LLM chatbot prototype on its own GCP infrastructure during a one-week hackathon, and walks through each layer of the stack and the tradeoffs behind each choice. Hugging Face's text-generation-inference proved hard to deploy because of CUDA and driver requirements, so the team switched to llama.cpp on a CPU-only AMD server, using its OpenAI-compatible Python bindings. That decision limited them to LLaMA-architecture models, and licensing restrictions on LLaMA-derived weights narrowed the list further, so they picked LLaMA 2 after a manual evaluation of bias and safety. They also used embeddings and vector search to add internal Mozilla knowledge, stressing that every choice in the stack constrains the others.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)
- [AI safety](https://swe.quest/tags/ai-safety.md) (AI & ML)

## Prerequisites

- LLM basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- Docker ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))

## Keywords

llama.cpp, LLaMA 2, text-generation-inference, Hugging Face, OpenLLaMA, CUDA, Google Cloud Platform

## Related posts

- [Open-source LLMs as LangChain Agents](https://swe.quest/articles/open-source-llms-as-langchain-agents-e2163a289958a319.md): Hugging Face · 2024-01-24 · Medium · 10 min read · AI agents, LLMs, Evaluation, Python
  Open-source LLMs can now serve as reasoning engines for tool-using ReAct agents, with Mixtral-8x7B outperforming GPT-3.5 out of the box on a mixed benchmark drawn from HotpotQA, GSM8K and GAIA, graded by GPT-4-as-a-judge.
- [Llama 2 is here - get it on Hugging Face](https://swe.quest/articles/llama-2-is-here-get-it-on-hugging-face-c56eec059476bd0f.md): Hugging Face · 2023-07-18 · Medium · 9 min read · LLMs, Inference & serving, Model training, Python
  Meta's Llama 2 family (7B, 13B, 70B base and RLHF-tuned chat models) is released under a commercially usable license, trained on 40% more tokens than Llama 1 with 4k context and grouped-query attention for the 70B model, and is integrated across the Hugging Face ecosystem.
- [From OpenAI to Open LLMs with Messages API on Hugging Face](https://swe.quest/articles/from-openai-to-open-llms-with-messages-api-on-hugging-face-98058f09a7d2acc1.md): Hugging Face · 2024-02-08 · Medium · 7 min read · Inference & serving, LLMs, API design, RAG & retrieval
  Text Generation Inference 1.4.0 adds a Messages API compatible with OpenAI's Chat Completion API, so open LLMs on Inference Endpoints can be called from existing OpenAI client code by changing the base URL and token.
- [Liberate your OpenClaw](https://swe.quest/articles/liberate-your-openclaw-ab18bd39a62ddf02.md): Hugging Face · 2026-03-27 · Medium · 3 min read · AI agents, Inference & serving, LLMs, Open source
  With Anthropic restricting Claude access in open agent platforms for Pro/Max subscribers, OpenClaw agents can be moved to open models either through Hugging Face Inference Providers or by running a model locally.
- [How to Make an AI Chatbot from Scratch using Docker Model Runner](https://swe.quest/articles/how-to-make-an-ai-chatbot-from-scratch-using-docker-model-runner-48eab58e2814218f.md): Docker · 2025-06-03 · Medium · 17 min read · Inference & serving, Observability, LLMs, Go, Containers
  A local GenAI chatbot built on Docker Model Runner, which runs llama.cpp models natively on the host and exposes an OpenAI-compatible API to containers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
