NanoGPT + LibreChat Setup Guide 2026
librechat is the best open-source chatgpt alternative i've used. NanoGPT gives it access to 400+ models. together, they're basically the ultimate self-hosted AI setup - and it costs me about $8/month total.
tl;dr: LibreChat plus NanoGPT is the ultimate self-hosted AI setup for $8/month. it runs on a Raspberry Pi 5, supports 400+ models, has conversation search, presets, and multi-user sharing. setup takes 15 minutes with Docker.
Key Takeaways:
- LibreChat + NanoGPT costs about $8/month total, running on hardware as small as a Raspberry Pi 5
- setup takes 15 minutes: clone, configure .env with NanoGPT key, docker compose up, done
- LibreChat has more plugins and customization than Open WebUI, with better conversation organization via folders and tags
i run this on a raspberry pi 5 at home. if that tells you anything about how lightweight it is.
what is librechat
librechat is an open-source AI chat interface you host yourself. think of it as a self-hosted chatgpt that supports multiple AI providers. it's free, runs on your own server, and your data stays on your machine.
why use it with NanoGPT specifically:
| benefit | explanation |
|---|---|
| self-hosted | your data stays on your server |
| multi-model | NanoGPT provides 400+ models |
| free UI | no subscription for the interface |
| customizable | themes, plugins, behavior tweaks |
| privacy | no tracking, no data collection |
| multi-user | share with family or small team |
compared to using NanoGPT's web interface directly, librechat gives you a better UI, conversation history, presets, and plugins. it's worth the 15-minute setup.
what you need
- a NanoGPT account with credits and an API key (sign up here)
- Docker installed on your machine or server
- Git installed
- 15 minutes (30 if Docker is new to you)
system requirements
short answer: minimum 2GB RAM, 5GB storage, 1 core CPU. runs fine on Raspberry Pi 4/5 with 4GB RAM.
| component | minimum | recommended |
|---|---|---|
| RAM | 2 GB | 4 GB |
| storage | 5 GB | 10 GB |
| CPU | 1 core | 2 cores |
| OS | linux, mac, windows | linux (ubuntu 22.04+) |
runs fine on a raspberry pi 4/5 with 4GB RAM. the heavy lifting happens on NanoGPT's servers - librechat is just the UI.
installation
step 1: clone librechat
short answer: git clone the LibreChat repo and cd into the directory.
git clone https://github.com/danny-avila/LibreChat.git
cd LibreChat
step 2: configure environment
short answer: copy .env.example to .env and add your NanoGPT API key and base URL.
cp .env.example .env
edit .env and add your NanoGPT configuration:
NANOGPT_API_KEY=your-nanogpt-api-key-here
NANOGPT_BASE_URL=https://api.nano-gpt.com/v1
step 3: start with Docker
short answer: docker compose up -d starts LibreChat and MongoDB. first run takes a few minutes.
docker compose up -d
this starts librechat and its MongoDB database. first run takes a few minutes to download images. grab a coffee.
step 4: access librechat
short answer: open http://localhost:3080. create your admin account on first visit.
open your browser, go to:
http://localhost:3080
create your admin account on first visit.
step 5: add NanoGPT as endpoint
short answer: in Settings, Endpoints, Add Custom Endpoint with NanoGPT base URL, API key, and model list.
- go to Settings (gear icon)
- click Endpoints
- click Add Custom Endpoint
- fill in:
- Name: NanoGPT
- Base URL:
https://api.nano-gpt.com/v1 - API Key: your NanoGPT API key
- Models: select the models you want (or add manually)
- click Save
step 6: test it
short answer: select a model from the dropdown, send a test message. if you get a response, you're done.
select a model from the dropdown and send a test message. if you get a response, you're done. if not, check the troubleshooting section below.
model configuration
if models don't appear automatically, add them manually:
- go to Settings → Endpoints → NanoGPT
- in the Models field, add model IDs:
gpt-4oclaude-3-5-sonnetgemini-1.5-promistral-largedeepseek-v3gpt-4o-mini
my recommended presets
short answer: gpt-4o for general chat, Claude 3.5 for writing, DeepSeek for budget. create presets with different temperatures for each task.
| use case | model | why |
|---|---|---|
| general chat | gpt-4o | best all-around |
| writing | claude 3.5 sonnet | better prose |
| coding | gpt-4o | most consistent code |
| quick answers | gpt-4o-mini | fast and cheap |
| long documents | gemini 1.5 pro | huge context window |
| budget use | deepseek v3 | 10x cheaper than gpt-4o |
advanced stuff
custom system prompts
short answer: set default system prompts in Settings. keep them focused for better results.
go to Settings → System Prompt and set defaults:
You are a helpful assistant. Be concise and direct.
presets for different tasks
short answer: create presets with different models and temperatures: coding at 0.3, creative writing at 0.9, quick answers at 0.5.
- click the Preset dropdown
- click Create Preset
- configure name, model, system prompt, temperature, max tokens
- save
i have presets for "coding helper" (gpt-4o, temp 0.3), "creative writing" (claude sonnet, temp 0.9), and "quick answers" (gpt-4o-mini, temp 0.5).
organizing conversations
short answer: use folders to group by project, full-text search across all conversations, export as JSON or markdown, pin important chats.
librechat supports folders and tags:
- folders - group by project or topic
- search - full-text search across all conversations
- export - download as JSON or markdown
- pin - keep important chats at the top
i separate work and personal conversations with folders. simple but effective.
multi-user setup
short answer: set ALLOW_REGISTRATION=true in .env. others create accounts at your server URL. shared NanoGPT API key and balance.
for sharing with family or a small team:
ALLOW_REGISTRATION=true
others create accounts at http://your-server:3080. each user gets their own conversation history. all users share the same NanoGPT API key and balance.
troubleshooting
| problem | cause | fix |
|---|---|---|
| "invalid API key" | wrong key or base URL | check settings in Endpoints |
| no models showing | endpoint not configured | add models manually |
| slow responses | server resources | increase Docker memory limit |
| connection refused | Docker not running | run docker compose up -d |
| "rate limited" | too many requests | wait or top up NanoGPT balance |
| blank responses | model error | try a different model |
Docker commands you'll need
short answer: docker compose ps to check status, docker compose logs for debugging, docker compose down && up -d to restart.
# check if containers are running
docker compose ps
# view logs
docker compose logs
# restart everything
docker compose down && docker compose up -d
# rebuild after updates
git pull
docker compose build
docker compose up -d
testing your API key directly
short answer: curl the NanoGPT models endpoint. if it returns model data, your key works and the issue is in LibreChat config.
curl https://api.nano-gpt.com/v1/models \
-H "Authorization: Bearer YOUR_KEY_HERE"
if this returns a list of models, your key works. the issue is in librechat configuration.
performance tuning
short answer: allocate 2GB+ RAM to Docker, use SSD storage, reduce context size, close unused conversations for faster responses.
if librechat feels slow:
- allocate at least 2GB RAM to Docker
- use SSD storage (MongoDB loves SSDs)
- reduce context size in model settings
- close unused conversations
- use faster models (gpt-4o-mini responds faster than gpt-4o)
librechat vs other interfaces
| feature | librechat | open webui | NanoGPT web |
|---|---|---|---|
| self-hosted | yes | yes | no |
| multi-model | yes | yes | yes |
| plugins | yes | limited | no |
| multi-user | yes | yes | no |
| mobile friendly | yes | yes | yes |
| setup difficulty | medium | medium | none |
| conversation search | yes | yes | basic |
| presets | yes | yes | no |
see our Open WebUI setup guide for an alternative. open webui is easier to set up, librechat has more plugins and customization.
updating librechat
cd LibreChat
git pull
docker compose build
docker compose up -d
check for updates weekly or so. the project is actively maintained.
data privacy
everything runs on your machine. the only external connection is to NanoGPT's API when you send a message. librechat doesn't phone home or collect analytics. your conversations are stored in MongoDB on your server.
if you want maximum privacy, run it on a local machine (not a VPS). if you need remote access, use a VPN or reverse proxy with HTTPS - don't expose port 3080 to the public internet.
my setup
raspberry pi 5 at home. connected to NanoGPT via VPN. total cost: ~$8/month for NanoGPT credits, $0 for librechat.
compared to $20/month for chatgpt plus, i get a better interface, more models, and full control over my data. setup took 30 minutes including Docker installation. if you already have Docker, expect 15 minutes.
Last updated: July 2026
Related Articles
- NanoGPT + Open WebUI Setup - alternative interface
- NanoGPT API Key Setup - get your key first
- NanoGPT Pricing - how much you'll spend
- Best NanoGPT Models - full model list
- NanoGPT Privacy Review - data handling details
- SillyTavern + NanoGPT Setup - for roleplay users
Disclosure: This article contains affiliate links. If you sign up through our referral link, you get a 5% discount and we earn a small commission. This doesn't affect our reviews - we pay for all services ourselves.