Text Generation
llama-cpp-python
GGUF
English
code-generation
coding-assistant
llama.cpp
qwen2.5
python
javascript
fine-tuned
conversational
Instructions to use neuralbroker/blitzkode with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use neuralbroker/blitzkode with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="neuralbroker/blitzkode", filename="blitzkode.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - llama-cpp-python
How to use neuralbroker/blitzkode with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="neuralbroker/blitzkode", filename="blitzkode.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use neuralbroker/blitzkode with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf neuralbroker/blitzkode # Run inference directly in the terminal: llama-cli -hf neuralbroker/blitzkode
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf neuralbroker/blitzkode # Run inference directly in the terminal: llama-cli -hf neuralbroker/blitzkode
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf neuralbroker/blitzkode # Run inference directly in the terminal: ./llama-cli -hf neuralbroker/blitzkode
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf neuralbroker/blitzkode # Run inference directly in the terminal: ./build/bin/llama-cli -hf neuralbroker/blitzkode
Use Docker
docker model run hf.co/neuralbroker/blitzkode
- LM Studio
- Jan
- vLLM
How to use neuralbroker/blitzkode with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "neuralbroker/blitzkode" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "neuralbroker/blitzkode", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/neuralbroker/blitzkode
- Ollama
How to use neuralbroker/blitzkode with Ollama:
ollama run hf.co/neuralbroker/blitzkode
- Unsloth Studio new
How to use neuralbroker/blitzkode with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for neuralbroker/blitzkode to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for neuralbroker/blitzkode to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for neuralbroker/blitzkode to start chatting
- Pi new
How to use neuralbroker/blitzkode with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf neuralbroker/blitzkode
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "neuralbroker/blitzkode" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use neuralbroker/blitzkode with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf neuralbroker/blitzkode
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default neuralbroker/blitzkode
Run Hermes
hermes
- Docker Model Runner
How to use neuralbroker/blitzkode with Docker Model Runner:
docker model run hf.co/neuralbroker/blitzkode
- Lemonade
How to use neuralbroker/blitzkode with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull neuralbroker/blitzkode
Run and chat with the model
lemonade run user.blitzkode-{{QUANT_TAG}}List all available models
lemonade list
Update clean backend-only project docs and eval
Browse files- docs/PRODUCTION_RUNBOOK.md +178 -0
docs/PRODUCTION_RUNBOOK.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BlitzKode Production Runbook
|
| 2 |
+
|
| 3 |
+
This runbook captures the operational path for serving BlitzKode as a local or self-hosted coding assistant.
|
| 4 |
+
|
| 5 |
+
## 1. Release artifacts
|
| 6 |
+
|
| 7 |
+
Expected production artifacts:
|
| 8 |
+
|
| 9 |
+
- `blitzkode.gguf` — local GGUF model mounted into the container at `/app/blitzkode.gguf`.
|
| 10 |
+
- Docker image built from `Dockerfile` — includes `server.py` and Python dependencies only.
|
| 11 |
+
- Optional HuggingFace repos:
|
| 12 |
+
- `neuralbroker/blitzkode` — GGUF distribution repo.
|
| 13 |
+
- `neuralbroker/blitzkode-1.5b-lora` — 1.5B adapter repo.
|
| 14 |
+
- `neuralbroker/blitzkode-lora-0.5b` — 0.5B adapter repo.
|
| 15 |
+
|
| 16 |
+
Do not commit model weights, checkpoints, `.env` files, or HuggingFace tokens to git.
|
| 17 |
+
|
| 18 |
+
## 2. Required environment
|
| 19 |
+
|
| 20 |
+
Minimum runtime:
|
| 21 |
+
|
| 22 |
+
- Python 3.11+ when running directly.
|
| 23 |
+
- Docker 24+ when running in containers.
|
| 24 |
+
- 4 GB+ RAM for the Q8_0 1.5B GGUF artifact.
|
| 25 |
+
- Optional NVIDIA container toolkit for GPU offload.
|
| 26 |
+
|
| 27 |
+
Key server variables:
|
| 28 |
+
|
| 29 |
+
| Variable | Production guidance |
|
| 30 |
+
|---|---|
|
| 31 |
+
| `BLITZKODE_MODEL_PATH` | Set to `/app/blitzkode.gguf` in Docker or an absolute local path outside Docker. |
|
| 32 |
+
| `BLITZKODE_PRELOAD_MODEL` | Use `true` for production so startup fails fast if the model cannot load. |
|
| 33 |
+
| `BLITZKODE_API_KEY` | Set a strong bearer token for any network-accessible deployment. |
|
| 34 |
+
| `BLITZKODE_CORS_ORIGINS` | Restrict to trusted API client origins instead of `*`. |
|
| 35 |
+
| `BLITZKODE_RATE_LIMIT` | Keep `true` unless running behind another trusted limiter. |
|
| 36 |
+
| `BLITZKODE_RATE_LIMIT_MAX` | Tune based on expected users and hardware. |
|
| 37 |
+
| `BLITZKODE_WEB_SEARCH` | Set `false` for fully offline operation; keep `true` for research mode. |
|
| 38 |
+
| `BLITZKODE_GPU_LAYERS` | `0` for CPU only, `-1` for all possible layers on GPU, or tune gradually. |
|
| 39 |
+
| `BLITZKODE_N_CTX` | Start with `2048`; increase to `4096` or higher only if memory allows. |
|
| 40 |
+
| `BLITZKODE_BATCH` / `BLITZKODE_UBATCH` | Start with `256` / `128`; increase only after latency and memory checks. |
|
| 41 |
+
| `BLITZKODE_PROMPT_CACHE` | Keep `true` for repeated system/history prefixes if supported by the installed `llama-cpp-python`. |
|
| 42 |
+
|
| 43 |
+
## 3. Pre-deployment validation
|
| 44 |
+
|
| 45 |
+
Run these checks before tagging or deploying a release:
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
python -m pytest tests/ -v
|
| 49 |
+
python -m ruff check .
|
| 50 |
+
python -m mypy server.py --ignore-missing-imports
|
| 51 |
+
docker build -t blitzkode:ci .
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
For CI smoke tests without the real model, start the container with `BLITZKODE_PRELOAD_MODEL=false` and verify `/health` returns HTTP 200.
|
| 55 |
+
|
| 56 |
+
## 4. CPU Docker deployment
|
| 57 |
+
|
| 58 |
+
Place `blitzkode.gguf` next to `docker-compose.yml`, then run:
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
docker compose up --build -d
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
The default compose service mounts the model read-only into `/app/blitzkode.gguf` and exposes the app on `http://localhost:7860`.
|
| 65 |
+
|
| 66 |
+
Check service state:
|
| 67 |
+
|
| 68 |
+
```bash
|
| 69 |
+
docker compose ps
|
| 70 |
+
docker compose logs --tail=100 blitzkode
|
| 71 |
+
curl -sf http://localhost:7860/health
|
| 72 |
+
curl -sf http://localhost:7860/info
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
A healthy deployment should report:
|
| 76 |
+
|
| 77 |
+
- `status` is `healthy` when the model file exists.
|
| 78 |
+
- `model_exists` is `true`.
|
| 79 |
+
- `last_error` is empty or `null`.
|
| 80 |
+
- `batch`, `ubatch`, and thread settings match the intended deployment profile.
|
| 81 |
+
|
| 82 |
+
## 5. GPU Docker deployment
|
| 83 |
+
|
| 84 |
+
Prerequisites:
|
| 85 |
+
|
| 86 |
+
1. NVIDIA driver installed on the host.
|
| 87 |
+
2. `nvidia-container-toolkit` installed.
|
| 88 |
+
3. Docker configured for the NVIDIA runtime.
|
| 89 |
+
4. A `llama-cpp-python` build with compatible GPU acceleration.
|
| 90 |
+
|
| 91 |
+
Start the GPU profile:
|
| 92 |
+
|
| 93 |
+
```bash
|
| 94 |
+
BLITZKODE_GPU_LAYERS=35 docker compose --profile gpu up --build -d
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
If startup fails or inference crashes, lower `BLITZKODE_GPU_LAYERS` and restart. Use `0` to force CPU-only fallback.
|
| 98 |
+
|
| 99 |
+
## 6. Direct local deployment
|
| 100 |
+
|
| 101 |
+
For non-container operation:
|
| 102 |
+
|
| 103 |
+
```bash
|
| 104 |
+
pip install -r requirements.txt
|
| 105 |
+
BLITZKODE_MODEL_PATH=blitzkode.gguf BLITZKODE_PRELOAD_MODEL=true python server.py
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
On Windows shells, set environment variables using the shell-specific syntax before running `python server.py`.
|
| 109 |
+
|
| 110 |
+
## 7. Health checks and smoke tests
|
| 111 |
+
|
| 112 |
+
Recommended checks after each deployment:
|
| 113 |
+
|
| 114 |
+
```bash
|
| 115 |
+
curl -sf http://localhost:7860/health
|
| 116 |
+
curl -sf http://localhost:7860/info
|
| 117 |
+
curl -sf -X POST http://localhost:7860/generate \
|
| 118 |
+
-H "Content-Type: application/json" \
|
| 119 |
+
-d '{"prompt":"Return a short Python hello-world function.","max_tokens":64}'
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
If `BLITZKODE_API_KEY` is configured, include `Authorization: Bearer <token>` on protected requests.
|
| 123 |
+
|
| 124 |
+
## 8. Rollback plan
|
| 125 |
+
|
| 126 |
+
Rollback should be artifact-based and fast:
|
| 127 |
+
|
| 128 |
+
1. Keep the last known-good Docker image tag available locally or in the registry.
|
| 129 |
+
2. Keep the last known-good `blitzkode.gguf` artifact available outside the container.
|
| 130 |
+
3. Stop the current service.
|
| 131 |
+
4. Restore the previous image tag and/or previous model file.
|
| 132 |
+
5. Start the service and run the health checks from section 7.
|
| 133 |
+
|
| 134 |
+
Example container rollback flow:
|
| 135 |
+
|
| 136 |
+
```bash
|
| 137 |
+
docker compose down
|
| 138 |
+
docker tag blitzkode:previous blitzkode:latest
|
| 139 |
+
docker compose up -d
|
| 140 |
+
curl -sf http://localhost:7860/health
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
## 9. HuggingFace publishing
|
| 144 |
+
|
| 145 |
+
Use a token only through environment variables or CI secrets:
|
| 146 |
+
|
| 147 |
+
```bash
|
| 148 |
+
HF_TOKEN=hf_xxx python scripts/push_all_to_hub.py
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
Before publishing, confirm:
|
| 152 |
+
|
| 153 |
+
- `blitzkode.gguf` exists and loads locally.
|
| 154 |
+
- Adapter directories contain `adapter_config.json` and adapter weights.
|
| 155 |
+
- `MODEL_CARD.md`, `README.md`, and `datasets/MANIFEST.md` match the artifact versions.
|
| 156 |
+
- The token has write access to the intended repos.
|
| 157 |
+
|
| 158 |
+
Never paste real tokens into documentation, committed scripts, or issue comments.
|
| 159 |
+
|
| 160 |
+
## 10. Common failure modes
|
| 161 |
+
|
| 162 |
+
| Symptom | Likely cause | Fix |
|
| 163 |
+
|---|---|---|
|
| 164 |
+
| `/health` returns `degraded` | Model file missing from configured path | Mount or copy `blitzkode.gguf`; verify `BLITZKODE_MODEL_PATH`. |
|
| 165 |
+
| Startup hangs while loading | Large context/batch or slow CPU disk load | Reduce `BLITZKODE_N_CTX` / `BLITZKODE_BATCH`, check disk and RAM. |
|
| 166 |
+
| Container exits on first request | llama.cpp cannot load model | Verify GGUF file integrity and llama-cpp-python compatibility. |
|
| 167 |
+
| Browser cannot call API | CORS origin mismatch | Set `BLITZKODE_CORS_ORIGINS` to the deployed UI origin. |
|
| 168 |
+
| HTTP 401 | Missing or wrong bearer token | Send `Authorization: Bearer <BLITZKODE_API_KEY>`. |
|
| 169 |
+
| HTTP 429 | Rate limit exceeded | Increase `BLITZKODE_RATE_LIMIT_MAX` or add an upstream queue/limit policy. |
|
| 170 |
+
| Research mode fails | Web search disabled or network blocked | Set `BLITZKODE_WEB_SEARCH=true` and verify outbound HTTP access. |
|
| 171 |
+
|
| 172 |
+
## 11. Operational notes
|
| 173 |
+
|
| 174 |
+
- Treat generated code as assistant output, not an automatically trusted patch.
|
| 175 |
+
- Prefer `/generate/research` for current APIs or documentation-sensitive questions.
|
| 176 |
+
- Keep logs free of prompts if prompts may contain private code or secrets.
|
| 177 |
+
- Rotate `BLITZKODE_API_KEY` and HuggingFace tokens regularly.
|
| 178 |
+
- Re-run the full validation suite after changing dependencies, model artifacts, or Docker base images.
|