OGX is an open-source, OpenAI-compatible API server designed to provide a standardized interface for building AI applications across any model and infrastructure pyproject.toml15-18 It acts as a unified abstraction layer, allowing developers to swap between local models (e.g., via Ollama), hosted providers (e.g., Anthropic, Gemini), or production inference engines (e.g., vLLM) without changing application code README.md23-28
Beyond simple inference, OGX standardizes agentic building blocks including server-side orchestration (Responses API), vector storage, and safety shields README.md38-45
OGX follows a "pluggable provider" architecture. The system is divided into three distinct layers to ensure protocol stability while allowing for rapid integration of new backends:
ogx-api): Defines the strict interface contracts (Protocols) and Pydantic data types for all APIs pyproject.toml40ogx): Contains the core server logic, provider implementations, and distribution management pyproject.toml15ogx-ui): An optional web-based playground and management console for interacting with the server.The following diagram illustrates how high-level system components map to specific entities within the codebase.
Diagram: System to Code Entity Mapping
Sources: pyproject.toml32-68 .pre-commit-config.yaml98-106 CONTRIBUTING.md27-36
The project is managed as a monorepo with several core dependencies and optional feature groups:
| Package / Group | Role | Key Dependencies |
|---|---|---|
ogx | The core server and provider logic pyproject.toml15 | fastapi, uvicorn, pydantic |
ogx-api | Protocol definitions and shared types pyproject.toml40 | pydantic |
starter | Extra dependencies for local/remote providers pyproject.toml74 | ollama, chromadb-client, faiss-cpu, sentence-transformers |
dev | Tooling for contributors pyproject.toml129 | pytest, ruff, mypy, pre-commit |
Sources: pyproject.toml32-68 pyproject.toml74-126 pyproject.toml128-144
OGX introduces three primary abstractions to manage the complexity of AI infrastructure:
starter distribution for prototyping) README.md65transformers) pyproject.toml125-126 pyproject.toml160-170This diagram shows how a request moves from a standard client through the OGX routing logic to a specific provider.
Diagram: Request Dispatching Architecture
Sources: README.md28-36 pyproject.toml35-52 .pre-commit-config.yaml107-115
This wiki is organized into sections that follow the complexity of the system:
uv and run your first "Hello World" with Ollama or OpenAI README.md55-70pre-commit hooks CONTRIBUTING.md46-80Sources: README.md72-85 CONTRIBUTING.md1-25 pyproject.toml1-31