Skip to content

Production-ready, self-hosted LLM server with RAG, OpenAI-compatible API, Telegram admin bot, and child bot management. Python, Supabase, ChromaDB, llama.cpp. One-click setup for GPU VPS.

Notifications You must be signed in to change notification settings

iceyxsm/all-in-one-llm-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

All-in-One Self-Hosted LLM Server with RAG, API, and Telegram Admin Bot

Features

  • One-click setup for GPU-enabled VPS (Linux)
  • Production-ready: Secure, robust, and fully automated
  • OpenAI-compatible API with RAG (ChromaDB + Instructor-XL)
  • Telegram admin bot: Button-based control for all features
  • Child bot management: Add/revoke, usage_scope, isolation
  • System monitoring: Alerts, watchdog, resource stats
  • Exception logging for audit/debug
  • No hardcoded secrets: All config via environment variables

System Requirements

  • Linux VPS (recommended: Ubuntu 20.04+)
  • Python 3.10+
  • NVIDIA GPU (for LLM acceleration)
  • sudo/root access

One-Click Setup

  1. Clone the repo:
    git clone https://github.com/iceyxsm/all-in-one-llm-server.git && cd all-in-one-llm-server
  2. Run the setup script:
    bash setup.sh
  3. Follow prompts to configure environment variables and select/download your LLM model.
  4. Wait for setup to finish (NGINX, SSL, Python venv, models, etc.).
  5. Start all services:
    sudo systemctl start api
    sudo systemctl start ollama
    sudo systemctl start telegram-bot

Environment Variables

Copy .envtemplate to .env and fill in:

  • MODEL_PATH, MODEL_NAME: Path/name of your GGUF model
  • SUPABASE_URL, SUPABASE_SERVICE_KEY: Your Supabase project
  • TELEGRAM_BOT_TOKEN, TELEGRAM_OWNER_ID: For admin bot
  • LLM_API_URL: (optional) Override API endpoint

API Usage

  • POST /v1/chat/completions (OpenAI-compatible)
  • POST /upload (file upload for RAG)
  • All endpoints require a valid API key (managed via Supabase)

Telegram Admin Bot

  • Start/stop services, manage admins, manage API keys, upload files, view logs/stats, and more—all via Telegram buttons
  • Only the main owner can add/revoke admins and child bots
  • All admin actions are protected

Child Bot Management

  • Add a child bot: Provide token, username, and usage scope (everyone/admins/custom)
  • Each child bot is isolated, gets its own API key and RAG collection
  • Revoking a child bot stops its process and deletes its folder
  • Usage scope is enforced (admins only, custom coming soon)

Security

  • All sensitive actions require admin rights
  • All system commands use sudo (passwordless sudo recommended for specific commands)
  • No hardcoded secrets
  • Exception logging to server.log and child_bot.log

Troubleshooting

  • Check server.log and child_bot.log for errors
  • Use Telegram admin bot to view system logs and status
  • Ensure all environment variables are set
  • For GPU issues, check nvidia-smi and driver installation

Extending

  • Add rate limiting, custom usage scopes, or more logging as needed
  • Automated tests recommended for future changes

Ready for production.

About

Production-ready, self-hosted LLM server with RAG, OpenAI-compatible API, Telegram admin bot, and child bot management. Python, Supabase, ChromaDB, llama.cpp. One-click setup for GPU VPS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published