$ show ogx-ai/ogx
OGX (formerly Llama Stack) is a production-grade, open-source AI inference platform that provides a drop-in replacement for the OpenAI API. It is a multi-provider API gateway supporting chat completions, embeddings, the Responses API (agentic turns with tool use), vector stores, file processing, conversations, prompts, skills, and connectors. The system is built on a clean provider plugin architecture where inline (built-in) and remote providers (30+ including Anthropic, Bedrock, Gemini, Ollama, vLLM, NVIDIA) are registered via ProviderSpec and dynamically routed. The FastAPI server auto-discovers API protocols and generates routes with telemetry (OpenTelemetry), authentication, multi-tenancy, and ABAC access control. The repository includes a Next.js admin UI, a Python CLI, OpenAPI-generated client SDKs (Python, TypeScript), benchmarking tools (RAG eval, vertical scaling), and comprehensive integration tests with recording/replay. It is designed for self-hosted or cloud deployment with Kubernetes and Docker support.
The LLM identified 4 files worth highlighting for reuse:
Implements ExceptionTranslatingRoute, a custom FastAPI APIRoute that catches ValueError and exceptions with a status_code attribute and converts them to HTTPException. This pattern ensures consistent error responses across all API routers without cluttering route handlers with try/except blocks. It is self-contained (depends only on FastAPI and standard library) and can be extracted into any FastAPI project to standardize error handling.
Defines an abstract KVStore interface with methods like get, set, delete, range, and values_in_range. Multiple backends (in-memory, SQLite, PostgreSQL, Redis, MongoDB) implement this interface, allowing pluggable persistence. The abstraction is clean, with namespace isolation, expiration, and batch operations. It can be extracted as a reusable library for any Python application needing a generic key-value store.
Provides a simple DSL parser for access control conditions (e.g., 'user is owner', 'user with admin in roles'). The parse_conditions function splits a string into Condition objects with left operand, operator, and right operand. It demonstrates non-obvious skill in building a maintainable, testable mini-parser for policy rules. This component could be extracted and reused in any application requiring attribute-based access control with a human-readable condition language.
Defines OpenTelemetry metrics for inference operations: counters for completions, tool calls, tokens; histograms for latency and token counts. It uses standard OTel instruments and provides reusable metric definitions that can be applied to any inference service. The pattern of centralizing metric definitions in a dedicated module is clean and promotes consistency across the codebase.