Rust-based LLM proxy: zero-copy piping, bankruptcy shield, and multi-tier token budgeting.
2.1K
Kilovolt (kvlt) is a hyper-optimized, high-throughput asynchronous reverse proxy gateway written in Rust. It acts as an active financial circuit breaker and Bankruptcy Shield for independent developers, startups, and autonomous coding agents running AI integrations on low-resource hardware.
š Want a hosted version? Join the Kilovolt Cloud Waitlist.
Kilovolt is engineered in Rust to target resource-constrained $5/month virtual private servers (VPS) where every megabyte of RAM and CPU cycle counts.
| Dimension | Rust (Kilovolt) ā” | Go Gateways | Python Proxies |
|---|---|---|---|
| Idle Memory (RAM) | ~12 MB | ~60 MB | ~110 MB |
| Active Memory (Peak) | <15 MB | ~90 MB | ~250 MB |
| Proxy Latency Overhead | <0.05 ms (Compiled) | ~0.50 ms (Runtime scheduler) | ~15.00 ms (Interpreted loop) |
| GC Jitter / Stalls | None (Deterministic ownership) | Periodic GC sweeps | Stop-the-world GC |
| BPE Tokenization | Native (tiktoken-rs compiled) | CGo wrapper (Slow context shifts) | Fast but CPU-heavy libraries |
| VPS Cost Footprint | Optimized for $5 VPS | Medium | Heavy |
429 errors before querying upstream APIs.Create a .env file containing your configurations:
KILOVOLT_PORT=8080
KILOVOLT_DEFAULT_BUDGET=5.00
RUST_LOG=info
# Optional: Configure Token Budgeting Limits
KILOVOLT_PER_STEP_TOKENS=2048
KILOVOLT_PER_PIPELINE_TOKENS=10000
KILOVOLT_PER_DAY_TOKENS=100000
Expose the proxy port and pass the environment variables file:
docker run -d \
--name kilovolt-proxy \
--env-file .env \
-p 8080:8080 \
yodsarun/kilovolt-proxy:1.3.1
Mount settings inside a docker-compose.yml config:
version: '3.8'
services:
kilovolt-proxy:
image: yodsarun/kilovolt-proxy:1.3.1
container_name: kilovolt-proxy
ports:
- "8080:8080"
env_file: .env
deploy:
resources:
limits:
memory: 30M
restart: unless-stopped
Redirect your OpenAI SDK to Kilovolt and track spend ledger using the X-User-ID header.
Python SDK Integration
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY", "your-api-key"),
base_url="<http://127.0.0.1:8080/v1>" # Target local Kilovolt instance
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Explain zero-copy streams."}],
stream=True,
extra_headers={
"X-User-ID": "developer_alice",
"X-Pipeline-ID": "pipeline_run_456",
"X-Pipeline-Name": "DocumentSummarization",
"X-Step-Name": "BPETextChunking"
}
)
for chunk in response:
content = chunk.choices[0].delta.content
if content:
print(content, end="", flush=True)
š Analytics Dashboard Kilovolt exposes a built-in admin dashboard. Navigate to http://localhost:8080/dashboardā in your browser to inspect memory usage, average latencies, active agents, and rolling transaction costs.
Content type
Image
Digest
sha256:85da7fd22ā¦
Size
38.9 MB
Last updated
about 2 months ago
docker pull yodsarun/kilovolt-proxy