How chaitanya-sharmaa/axon works
Axon Bridge is an OpenAI-compatible LLM proxy and cost-optimization layer. An application sends an OpenAI-style request to Axon; the proxy applies caching, request protections and payload optimization, chooses a model/provider, forwards the request and returns a compatible response. Separate product paths provide agentic dispatch and loop protections, Assistants threads and file-backed RAG, and an admin dashboard for live operational visibility. The graph follows the documented capabilities and sampled route/service behavior; several internal links are omitted where implementation wiring was not sampled.
Main entry points: v1_openai_routes.py OpenAI-compatible routes · app.py FastAPI application · proxy_routes.py HTTP upstream proxy · v1_assistants_routes.py Assistants API
Components 20
Proxy workflow
- FastAPI application
axon/app.py - OpenAI-compatible routes
axon/api/routes/v1_openai_routes.py - HTTP upstream proxy
axon/api/routes/proxy_routes.py
Optimization and safety
- Token optimization
axon/services/token_optimizer.py - Model routing
axon/services/smart_router.py - Prompt and PII safety
axon/services/security_policy.py - Vision optimization
axon/services/vision_optimizer.py
Memory and state
- Assistants API
axon/api/routes/v1_assistants_routes.py - Thread memory
axon/services/memory_store.py - RAG vector search
axon/services/vector_store.py - Exact-match cache
axon/services/kv_cache.py
Agent workflows
- Agentic middleware
axon/services/agentic/pipeline.py - Loop detection
axon/services/agentic/loop_detector.py - Agent dispatch routes
axon/api/routes/agent_routes.py - Agent orchestrator
axon/services/agent_orchestrator.py
Operations and UI
- Admin dashboard
axon/dashboard/src/App.jsx - Admin routes
axon/api/routes/dashboard_routes.py - Request and event logs
axon/services/request_logger.py
Other components
- Client application
- LLM provider
Connections 23
- Client application → FastAPI application: sends requests
- FastAPI application → OpenAI-compatible routes: mounts routes
- FastAPI application → HTTP upstream proxy: mounts routes
- FastAPI application → Agent dispatch routes: mounts routes
- FastAPI application → Assistants API: mounts routes
- FastAPI application → Admin routes: mounts routes
- OpenAI-compatible routes → Exact-match cache: checks and reads
- OpenAI-compatible routes → Vision optimization: downscales images
- OpenAI-compatible routes → Token optimization: optimizes payload
- OpenAI-compatible routes → Model routing: selects model
- OpenAI-compatible routes → Prompt and PII safety: applies protections
- OpenAI-compatible routes → LLM provider: forwards request
- LLM provider → OpenAI-compatible routes: returns response
- HTTP upstream proxy → LLM provider: forwards HTTP
- HTTP upstream proxy → Token optimization: encodes response
- HTTP upstream proxy → Thread memory: logs session event
- Agent dispatch routes → Agent orchestrator: dispatches work
- Agent dispatch routes → Thread memory: records swarm event
- Agentic middleware → Loop detection: checks tool loops
- Assistants API → Thread memory: reads and writes threads
- Assistants API → RAG vector search: searches attached files
- Admin dashboard → Admin routes: queries operations
- Admin routes → Request and event logs: reads request logs