Skip to content

About

replay engine

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

mini_ghost

Shadow Replay Engine for LLM Cost Optimization.

Extracts LLM prompts from SigNoz traces, replays against cheaper models via Oxlo.ai, computes semantic similarity, and injects ghost traces back into SigNoz.

Setup

uv sync
source .venv/bin/activate

Copy .env.example to .env and fill in your values.

Usage

1. Seed synthetic traces

python scripts/seed.py --count 3

2. Run the web UI

uvicorn mini_ghost.web:app --reload --port 8080

Visit http://localhost:8080/ghost?trace_id=<trace_id>

3. Create SigNoz dashboard

python -m mini_ghost.dashboard

Architecture

Module Purpose
seed_traces.py Synthetic OTLP trace generator
clickhouse_client.py Query SigNoz ClickHouse for LLM spans
replay_engine.py Multi-model replay via Oxlo.ai
similarity.py BGE-Large embedding + cosine similarity
ghost_injector.py OTLP ghost trace injection
web.py FastAPI UI + JSON API
dashboard.py SigNoz dashboard builder

About

replay engine

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages