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 Settings
- 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
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
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
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BlitzKode
|
| 2 |
+
|
| 3 |
+
BlitzKode is a local AI coding assistant that runs entirely on your machine. It generates code in Python, JavaScript, Java, C++, and other languages through a web interface or API. The model is fine-tuned from Qwen2.5-1.5B and quantized to GGUF format for fast inference.
|
| 4 |
+
|
| 5 |
+
## Tech Stack
|
| 6 |
+
|
| 7 |
+
- Model: Qwen2.5-1.5B (fine-tuned, GGUF format)
|
| 8 |
+
- Backend: Python, FastAPI, uvicorn
|
| 9 |
+
- Inference: llama.cpp / llama-cpp-python
|
| 10 |
+
- Frontend: Vanilla HTML, CSS, JavaScript
|
| 11 |
+
- Training: HuggingFace Transformers, PEFT, TRL
|
| 12 |
+
|
| 13 |
+
## Features
|
| 14 |
+
|
| 15 |
+
- Local code generation without external API calls
|
| 16 |
+
- Real-time streaming responses (token-by-token)
|
| 17 |
+
- Web UI with dark theme, conversation history, copy-to-clipboard
|
| 18 |
+
- REST API with streaming (SSE) support
|
| 19 |
+
- Multi-language support: Python, JavaScript, Java, C++, TypeScript, SQL
|
| 20 |
+
- Conversation context across multiple turns
|
| 21 |
+
- Configurable via environment variables
|
| 22 |
+
- Optional API key authentication
|
| 23 |
+
- CPU and GPU inference support
|
| 24 |
+
- Docker support
|
| 25 |
+
|
| 26 |
+
## Prerequisites
|
| 27 |
+
|
| 28 |
+
- Python 3.9+
|
| 29 |
+
- GGUF model file (`blitzkode.gguf`)
|
| 30 |
+
- 4GB+ RAM recommended
|
| 31 |
+
|
| 32 |
+
## Installation
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
# Clone the repository
|
| 36 |
+
git clone https://github.com/neuralbroker/blitzkode.git
|
| 37 |
+
cd blitzkode
|
| 38 |
+
|
| 39 |
+
# Install dependencies
|
| 40 |
+
pip install -r requirements.txt
|
| 41 |
+
|
| 42 |
+
# Ensure model file exists
|
| 43 |
+
# Place blitzkode.gguf in the project root, or set BLITZKODE_MODEL_PATH
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Usage
|
| 47 |
+
|
| 48 |
+
Start the server:
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
python server.py
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
Open `http://localhost:7860` in your browser.
|
| 55 |
+
|
| 56 |
+
### Docker
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
docker build -t blitzkode .
|
| 60 |
+
docker run -p 7860:7860 -v ./blitzkode.gguf:/app/blitzkode.gguf blitzkode
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
### API Examples
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
# Generate code
|
| 67 |
+
curl -X POST http://localhost:7860/generate -H 'Content-Type: application/json' -d '{
|
| 68 |
+
\"prompt\": \"Write a Python function to reverse a string\"
|
| 69 |
+
}'
|
| 70 |
+
|
| 71 |
+
# Stream tokens
|
| 72 |
+
curl -X POST http://localhost:7860/generate/stream -H 'Content-Type: application/json' -d '{
|
| 73 |
+
\"prompt\": \"Binary search implementation in Python\"
|
| 74 |
+
}'
|
| 75 |
+
|
| 76 |
+
# With conversation history
|
| 77 |
+
curl -X POST http://localhost:7860/generate -H 'Content-Type: application/json' -d '{
|
| 78 |
+
\"prompt\": \"Add error handling to that function\",
|
| 79 |
+
\"messages\": [
|
| 80 |
+
{\"role\": \"user\", \"content\": \"Write a Python function to reverse a string\"},
|
| 81 |
+
{\"role\": \"assistant\", \"content\": \"def reverse_string(s): return s[::-1]\"}
|
| 82 |
+
]
|
| 83 |
+
}'
|
| 84 |
+
|
| 85 |
+
# Check server health
|
| 86 |
+
curl http://localhost:7860/health
|
| 87 |
+
|
| 88 |
+
# Get API info
|
| 89 |
+
curl http://localhost:7860/info
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
### API Parameters
|
| 93 |
+
|
| 94 |
+
| Parameter | Type | Default | Description |
|
| 95 |
+
|-----------|------|---------|-------------|
|
| 96 |
+
| prompt | string | required | Your question or request |
|
| 97 |
+
| messages | array | [] | Conversation history (last 8 messages) |
|
| 98 |
+
| temperature | float | 0.5 | Response randomness (0.0-2.0) |
|
| 99 |
+
| max_tokens | int | 256 | Maximum tokens to generate |
|
| 100 |
+
| top_p | float | 0.95 | Nucleus sampling threshold |
|
| 101 |
+
| top_k | int | 20 | Top-k sampling |
|
| 102 |
+
| repeat_penalty | float | 1.05 | Repetition penalty |
|
| 103 |
+
|
| 104 |
+
## Project Structure
|
| 105 |
+
|
| 106 |
+
```
|
| 107 |
+
blitzkode/
|
| 108 |
+
βββ server.py # FastAPI backend, main entry point
|
| 109 |
+
βββ blitzkode.gguf # Quantized model file (~3GB)
|
| 110 |
+
βββ Dockerfile # Docker container
|
| 111 |
+
βββ requirements.txt # Serving dependencies
|
| 112 |
+
βββ requirements-training.txt # Training dependencies
|
| 113 |
+
βββ LICENSE # MIT License
|
| 114 |
+
βββ .env.example # Environment variable template
|
| 115 |
+
βββ frontend/
|
| 116 |
+
β βββ index.html # Web UI (HTML/CSS/JS)
|
| 117 |
+
βββ tests/
|
| 118 |
+
β βββ test_server.py # HTTP endpoint tests
|
| 119 |
+
βββ scripts/
|
| 120 |
+
β βββ train_sft.py # Supervised fine-tuning (LoRA)
|
| 121 |
+
β βββ train_grpo.py # Reward-based SFT continuation
|
| 122 |
+
β βββ train_dpo.py # Direct Preference Optimization
|
| 123 |
+
β βββ export_gguf.py # Merge checkpoints and export GGUF
|
| 124 |
+
β βββ test_inference.py # Direct model inference test
|
| 125 |
+
βββ checkpoints/ # Trained LoRA adapter checkpoints
|
| 126 |
+
βββ exported/ # Merged model for GGUF export
|
| 127 |
+
βββ datasets/
|
| 128 |
+
β βββ raw/ # Training datasets
|
| 129 |
+
βββ models/ # Base model files
|
| 130 |
+
βββ .github/workflows/
|
| 131 |
+
β βββ ci.yml # GitHub Actions CI
|
| 132 |
+
βββ MODEL_CARD.md # Model documentation
|
| 133 |
+
βββ README.md # This file
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
## Environment Variables
|
| 137 |
+
|
| 138 |
+
| Variable | Default | Description | Example |
|
| 139 |
+
|----------|---------|-------------|---------|
|
| 140 |
+
| BLITZKODE_PORT | 7860 | Server port | 8080 |
|
| 141 |
+
| BLITZKODE_HOST | 0.0.0.0 | Server bind address | 127.0.0.1 |
|
| 142 |
+
| BLITZKODE_GPU_LAYERS | 0 | GPU layers (0=CPU only) | 35 |
|
| 143 |
+
| BLITZKODE_N_CTX | 2048 | Context window size | 4096 |
|
| 144 |
+
| BLITZKODE_THREADS | auto | CPU threads for inference | 8 |
|
| 145 |
+
| BLITZKODE_BATCH | 128 | Batch size for processing | 256 |
|
| 146 |
+
| BLITZKODE_WORKERS | 2 | Concurrent request workers | 4 |
|
| 147 |
+
| BLITZKODE_MODEL_PATH | blitzkode.gguf | Path to model file | /path/to/model.gguf |
|
| 148 |
+
| BLITZKODE_FRONTEND_PATH | frontend/index.html | Path to frontend file | ./ui.html |
|
| 149 |
+
| BLITZKODE_MAX_PROMPT_LENGTH | 4000 | Max prompt characters | 8000 |
|
| 150 |
+
| BLITZKODE_PRELOAD_MODEL | false | Load model on startup | true |
|
| 151 |
+
| BLITZKODE_CORS_ORIGINS | * | CORS origins (comma-separated) | http://localhost:3000 |
|
| 152 |
+
| BLITZKODE_API_KEY | empty | API key (empty=disabled) | my-secret-key |
|
| 153 |
+
|
| 154 |
+
## Tests
|
| 155 |
+
|
| 156 |
+
```bash
|
| 157 |
+
python -m unittest discover -s tests -v
|
| 158 |
+
```
|
| 159 |
+
|
| 160 |
+
## Contributing
|
| 161 |
+
|
| 162 |
+
Contributions are welcome. Open an issue first for major changes.
|
| 163 |
+
|
| 164 |
+
## License
|
| 165 |
+
|
| 166 |
+
MIT License. See LICENSE file for details.
|