--- title: OpenCode Hub emoji: 🤖 colorFrom: blue colorTo: indigo sdk: docker pinned: false license: mit short_description: OpenCode AI coding agent with AirLLM + ChromaDB + turbo --- # OpenCode Hub — HF Space Open-source AI coding agent with memory-optimized inference. ## Features - **AirLLM** — Run 70B models on 4GB GPU via layer-by-layer loading - **ChromaDB** — Vector store for RAG (retrieval-augmented generation) - **turbo (turbopuffer)** — High-performance vector search index - **OpenCode** — Full open-source AI coding agent API - **FastAPI** — REST API compatible with the Replit OpenCode Hub frontend ## Models Supported - `meta-llama/Meta-Llama-3-70B-Instruct` (4GB VRAM via AirLLM) - `Qwen/Qwen2.5-72B-Instruct` - `mistralai/Mistral-7B-Instruct-v0.3` - Any HuggingFace model ## API Endpoints ``` GET /health — Health check GET /models — List available models POST /generate — Generate text with AirLLM POST /embed — Generate embeddings GET /collections — List ChromaDB collections POST /collections/{n}/search — Semantic search POST /collections/{n}/add — Add documents GET /stats — Memory and performance stats ``` ## Environment Variables - `HF_TOKEN` — Hugging Face access token (auto-configured) - `MODEL_ID` — Default model (default: `meta-llama/Meta-Llama-3-70B-Instruct`) - `MAX_GPU_MEMORY_GB` — GPU memory limit in GB (default: `4`)