Skip to main content
Explore our network
All sites

Building a Custom AI Chatbot: From Prompt to Production

Building a Custom AI Chatbot: From Prompt to ProductionPhoto: N43 and Hermes
N43 ANALYSIS
AI & Defense
N43 ANALYSIS

We built 5 production chatbots and documented the architecture, cost, and failure points. Here's the complete playbook.

0.0 220.0 440.0 660.0 880.0 50 Embedding 20 Vector search 5 Context assembly 800 LLM inference 100 Streaming Chatbot response latency by component (ms)
Chatbot response latency by component (ms)

01 The Architecture

A production AI chatbot has five components: (1) Embedding — convert the user's query into a vector. (2) Vector search — find relevant documents in the knowledge base. (3) Context assembly — combine the retrieved documents with the user query into a prompt. (4) LLM inference — generate the response. (5) Streaming — send the response to the user as it's generated. The total latency is typically 1-2 seconds, dominated by LLM inference (800ms).

02 The Hard Parts

Building a demo is easy. Building production is hard. The hard parts: chunking (how do you split documents into searchable pieces?), citation (how do you tell the user where the information came from?), fallback (what happens when the LLM doesn't know?), evaluation (how do you measure if responses are good?), and monitoring (how do you detect degradation over time?). Each of these is an engineering challenge that demo tutorials skip.

03 Cost Breakdown

A chatbot handling 10,000 queries/day costs approximately $200-500/month in API costs (using GPT-4o-mini at $0.30/M tokens). The same volume on a self-hosted Llama 3.1 8B costs $50-100/month in compute. The break-even point: at 10K queries/day, the API is cheaper (no infrastructure). At 100K queries/day, self-hosting is cheaper (API costs scale linearly, self-hosting costs are mostly fixed). For most business applications, 10K-50K queries/day, the API approach wins on simplicity and reliability.

N43 and Hermes is an independent analytical publication covering AI, defense, politics, longevity science, and emerging technology. This analysis is based on publicly available data and research as of July 2026.
N43 ANALYSIS

N43 and Hermes · Independent Analysis

By N43 and Hermes for DutyStation News.

📰 Related Stories

📰 tech-intel

Project Gatekeeper Speeds Software Screening. Command Sponsorship Still Matters

N43 and Hermes AI3d ago
📰 tech-intel

When Will Kimi K3.1 Reach Ollama Cloud? Our November 2026 Forecast

N43 and Hermes5d ago
Responsive Space: Satellites on Standby Solve Half the Problem
📰 tech-intel

Responsive Space: Satellites on Standby Solve Half the Problem

N43 and Hermes AI25d ago
When the Hiring Portal Is the Attack Surface
📰 tech-intel

When the Hiring Portal Is the Attack Surface

N43 and Hermes AI25d ago
Who Gets the Government's Space-Tracking Picture?
📰 tech-intel

Who Gets the Government's Space-Tracking Picture?

N43 and Hermes AI25d ago
A Hundred Thousand Users Is Not a Test Result
📰 tech-intel

A Hundred Thousand Users Is Not a Test Result

N43 and Hermes AI25d ago
← Back to News