LLMTrace — drop-in security and observability gateway for LLM apps (fork of techlab-innov/llmtrace)
Rust
0
582 commits
updated Sep 17, 2026
Security-aware LLM observability for production.
LLMTrace is a transparent proxy that sits between your application and any OpenAI-compatible LLM provider. It captures traces, scans for prompt injection and PII, enforces cost controls, and exposes a dashboard — without requiring you to change application code beyond pointing the client at a different base URL.
This repository is a fork of the original LLMTrace project. See Credits and Fork Contributions.
Your app talks to LLMTrace instead of the provider. LLMTrace forwards the request upstream, then asynchronously:
Email/password signup provisions a dedicated tenant and Operator session. Operators can retrieve or rotate their workspace API token from Settings.
/v1/chat/completions and related routes)flowchart LR
App[YourApplication] -->|HTTP_OpenAI_SDK| Proxy[LLMTraceProxy]
Proxy -->|Forward| Provider[LLMProvider]
Proxy -->|Async| Security[SecurityEngine]
Proxy -->|Async| Storage[StorageLayer]
Security --> Meta[(PostgreSQL)]
Storage --> Traces[(ClickHouse)]
Storage --> Cache[(Redis)]
Dashboard[NextjsDashboard] -->|REST| Proxy
Request path
| Layer | Technology |
|---|---|
| Proxy | Rust, Axum |
| Security | Regex detectors + ML ensemble (optional preload) |
| Metadata | PostgreSQL (or SQLite in lite mode) |
| Traces | ClickHouse (or SQLite in lite mode) |
| Cache | Redis |
| Dashboard | Next.js 15, TypeScript |
| Crate / package | Purpose |
|---|---|
llmtrace-core | Shared types and traits |
llmtrace / llmtrace-proxy | HTTP proxy binary |
llmtrace-security | Security analysis engine |
llmtrace-storage | Storage backends |
dashboard/ | Web UI |
This is the path validated for local development on this fork.
OPENAI_API_KEY)git clone https://github.com/GabrielJuniorNdlovu/llmtrace.git
cd llmtrace
cp .env.example .env
Edit .env:
OPENAI_API_KEY (or point LLMTRACE_UPSTREAM_URL at your provider)LLMTRACE_AUTH_ADMIN_KEY from the placeholder before any shared useLLMTRACE_AUTH_ENABLED=1 when the dashboard login gate is enableddocker compose up -d --build
Services:
| Service | URL |
|---|---|
| Dashboard | http://localhost:3000 |
| Proxy | http://localhost:8080 |
| Health | http://localhost:8080/health |
| PostgreSQL | localhost:5432 |
| ClickHouse | localhost:8123 |
| Redis | localhost:6379 |
First build of the Rust proxy image can take 20–30 minutes. Subsequent rebuilds use cache.
import openai
client = openai.OpenAI(
base_url="http://localhost:8080/v1",
api_key="YOUR_WORKSPACE_API_TOKEN",
)
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}],
)
curl http://localhost:8080/v1/chat/completions \
-H "Authorization: Bearer YOUR_WORKSPACE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4","messages":[{"role":"user","content":"Hello!"}]}'
docker compose ps
docker compose logs -f llmtrace-proxy
docker compose logs -f dashboard
curl http://localhost:8080/health
docker compose down
Copy .env.example to .env. Important variables:
| Variable | Purpose |
|---|---|
LLMTRACE_STORAGE_PROFILE | production, lite, or memory |
LLMTRACE_UPSTREAM_URL | Provider base URL (for example https://api.openai.com) |
OPENAI_API_KEY | Upstream credential (or your provider equivalent) |
LLMTRACE_AUTH_ENABLED | Require API-key / session auth on the proxy |
LLMTRACE_AUTH_ADMIN_KEY | Bootstrap operator key for dashboard admin login |
LLMTRACE_DASHBOARD_AUTH_DISABLED | 0 = login required, 1 = local demo bypass |
Proxy YAML configuration is documented under docs/getting-started/configuration.md. Compose mounts config.yaml into the proxy container.
| Endpoint | Description |
|---|---|
POST /v1/chat/completions | OpenAI-compatible chat |
GET /api/v1/traces | List traces |
GET /api/v1/security/findings | Security findings |
GET /api/v1/tenants/:id/token | Tenant API token (admin or own operator) |
POST /api/v1/auth/signup | Email/password signup |
POST /api/v1/auth/login | Email/password login |
GET /health | Health and subsystem status |
# Rust toolchain (1.75+)
cargo build --workspace
cargo test --workspace
cargo clippy --workspace -- -D warnings
# Dashboard
cd dashboard
npm install
npm run dev
For a host-side proxy against Compose storage, point .env URLs at localhost published ports instead of Compose DNS names (postgres, clickhouse, redis).
Work added or hardened in this fork includes:
next redirect sanitisation after login009 migration)127.0.0.1)This project is a fork of LLMTrace, originally created by Evangelos Pappas and contributors.
Please keep the license notice when redistributing.
docs/README.md — documentation indexdocs/getting-started/ — install and configurationdocs/guides/ — API and integration guidesCONTRIBUTING.md — contribution guidelines (upstream)MIT — free for commercial and personal use, subject to the copyright notice in the license file.
Rust
78.9%
Python
12.2%
TypeScript
7.6%
LLMTrace — drop-in security and observability gateway for LLM apps (fork of techlab-innov/llmtrace)
Rust
0
582 commits
updated Sep 17, 2026
Security-aware LLM observability for production.
LLMTrace is a transparent proxy that sits between your application and any OpenAI-compatible LLM provider. It captures traces, scans for prompt injection and PII, enforces cost controls, and exposes a dashboard — without requiring you to change application code beyond pointing the client at a different base URL.
This repository is a fork of the original LLMTrace project. See Credits and Fork Contributions.
Your app talks to LLMTrace instead of the provider. LLMTrace forwards the request upstream, then asynchronously:
Email/password signup provisions a dedicated tenant and Operator session. Operators can retrieve or rotate their workspace API token from Settings.
/v1/chat/completions and related routes)flowchart LR
App[YourApplication] -->|HTTP_OpenAI_SDK| Proxy[LLMTraceProxy]
Proxy -->|Forward| Provider[LLMProvider]
Proxy -->|Async| Security[SecurityEngine]
Proxy -->|Async| Storage[StorageLayer]
Security --> Meta[(PostgreSQL)]
Storage --> Traces[(ClickHouse)]
Storage --> Cache[(Redis)]
Dashboard[NextjsDashboard] -->|REST| Proxy
Request path
| Layer | Technology |
|---|---|
| Proxy | Rust, Axum |
| Security | Regex detectors + ML ensemble (optional preload) |
| Metadata | PostgreSQL (or SQLite in lite mode) |
| Traces | ClickHouse (or SQLite in lite mode) |
| Cache | Redis |
| Dashboard | Next.js 15, TypeScript |
| Crate / package | Purpose |
|---|---|
llmtrace-core | Shared types and traits |
llmtrace / llmtrace-proxy | HTTP proxy binary |
llmtrace-security | Security analysis engine |
llmtrace-storage | Storage backends |
dashboard/ | Web UI |
This is the path validated for local development on this fork.
OPENAI_API_KEY)git clone https://github.com/GabrielJuniorNdlovu/llmtrace.git
cd llmtrace
cp .env.example .env
Edit .env:
OPENAI_API_KEY (or point LLMTRACE_UPSTREAM_URL at your provider)LLMTRACE_AUTH_ADMIN_KEY from the placeholder before any shared useLLMTRACE_AUTH_ENABLED=1 when the dashboard login gate is enableddocker compose up -d --build
Services:
| Service | URL |
|---|---|
| Dashboard | http://localhost:3000 |
| Proxy | http://localhost:8080 |
| Health | http://localhost:8080/health |
| PostgreSQL | localhost:5432 |
| ClickHouse | localhost:8123 |
| Redis | localhost:6379 |
First build of the Rust proxy image can take 20–30 minutes. Subsequent rebuilds use cache.
import openai
client = openai.OpenAI(
base_url="http://localhost:8080/v1",
api_key="YOUR_WORKSPACE_API_TOKEN",
)
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}],
)
curl http://localhost:8080/v1/chat/completions \
-H "Authorization: Bearer YOUR_WORKSPACE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4","messages":[{"role":"user","content":"Hello!"}]}'
docker compose ps
docker compose logs -f llmtrace-proxy
docker compose logs -f dashboard
curl http://localhost:8080/health
docker compose down
Copy .env.example to .env. Important variables:
| Variable | Purpose |
|---|---|
LLMTRACE_STORAGE_PROFILE | production, lite, or memory |
LLMTRACE_UPSTREAM_URL | Provider base URL (for example https://api.openai.com) |
OPENAI_API_KEY | Upstream credential (or your provider equivalent) |
LLMTRACE_AUTH_ENABLED | Require API-key / session auth on the proxy |
LLMTRACE_AUTH_ADMIN_KEY | Bootstrap operator key for dashboard admin login |
LLMTRACE_DASHBOARD_AUTH_DISABLED | 0 = login required, 1 = local demo bypass |
Proxy YAML configuration is documented under docs/getting-started/configuration.md. Compose mounts config.yaml into the proxy container.
| Endpoint | Description |
|---|---|
POST /v1/chat/completions | OpenAI-compatible chat |
GET /api/v1/traces | List traces |
GET /api/v1/security/findings | Security findings |
GET /api/v1/tenants/:id/token | Tenant API token (admin or own operator) |
POST /api/v1/auth/signup | Email/password signup |
POST /api/v1/auth/login | Email/password login |
GET /health | Health and subsystem status |
# Rust toolchain (1.75+)
cargo build --workspace
cargo test --workspace
cargo clippy --workspace -- -D warnings
# Dashboard
cd dashboard
npm install
npm run dev
For a host-side proxy against Compose storage, point .env URLs at localhost published ports instead of Compose DNS names (postgres, clickhouse, redis).
Work added or hardened in this fork includes:
next redirect sanitisation after login009 migration)127.0.0.1)This project is a fork of LLMTrace, originally created by Evangelos Pappas and contributors.
Please keep the license notice when redistributing.
docs/README.md — documentation indexdocs/getting-started/ — install and configurationdocs/guides/ — API and integration guidesCONTRIBUTING.md — contribution guidelines (upstream)MIT — free for commercial and personal use, subject to the copyright notice in the license file.
Rust
78.9%
Python
12.2%
TypeScript
7.6%