Quick Start Guide¶
Estimated time to read: 3 minutes
This guide gets the LLMTrace proxy running and verifies that traces and findings are captured. All steps below map to the current codebase.
Prerequisites¶
- OpenAI API key (or another OpenAI-compatible upstream)
- Either Rust toolchain or Docker
Environment Setup¶
Set your LLM provider API key before running the proxy:
The proxy forwards this key to the upstream provider. Without it, proxied requests will fail with 401 Unauthorized.
Option A: One-line Install (Fastest)¶
This downloads the latest binary for your platform and a starter config.yaml. Then run:
Option B: Cargo Install¶
Option C: Docker (GHCR)¶
docker pull ghcr.io/epappas/llmtrace-proxy:latest
docker run -p 8080:8080 ghcr.io/epappas/llmtrace-proxy:latest
Option D: From Source¶
git clone https://github.com/epappas/llmtrace
cd llmtrace
cargo build --release --bin llmtrace-proxy --features ml
cp config.example.yaml config.yaml
./target/release/llmtrace-proxy --config config.yaml
The --features ml flag enables the DeBERTa ML-based security detectors. Without it, only regex-based detection is available.
Optional: Start Infra + Dashboard (Docker Compose)¶
compose.yaml starts ClickHouse/Postgres/Redis and the dashboard. Run the proxy separately.
Test the Proxy¶
1) Send a test request¶
curl http://localhost:8080/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4", "messages": [{"role": "user", "content": "Hello, LLMTrace!"}]}'
You should receive a normal OpenAI-compatible response.
2) Fetch traces¶
3) Fetch security findings¶
Quick Integration Example (OpenAI SDK)¶
import openai
client = openai.OpenAI(
base_url="http://localhost:8080/v1",
api_key="your-key"
)
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello"}]
)
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
401 Unauthorized from upstream | Missing or invalid API key | export OPENAI_API_KEY="sk-..." |
connection refused on :8080 | Proxy not running | Check proxy logs, ensure --config config.yaml is passed |
| No security findings | ML features not compiled | Rebuild with --features ml (source builds only) |
config.yaml not found | Missing config file | cp config.example.yaml config.yaml |