You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+14-23Lines changed: 14 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This document describes the internal architecture of OGX for contributors and AI
4
4
5
5
## System Overview
6
6
7
-
OGX is a server that exposes a unified API for AI capabilities: inference, agents, safety, vector storage, evaluation, and more. It is provider-agnostic: the same API works whether the backend is Ollama, OpenAI, vLLM, Fireworks, or dozens of other services.
7
+
OGX is a server that exposes a unified API for AI capabilities: inference, responses orchestration, vector storage, tool execution, evaluation, and more. It is provider-agnostic: the same API works whether the backend is Ollama, OpenAI, vLLM, Fireworks, or dozens of other services.
8
8
9
9
The codebase is split into two packages:
10
10
@@ -30,7 +30,7 @@ Route Dispatch
30
30
v
31
31
Router (src/ogx/core/routers/)
32
32
|
33
-
|-- Looks up the resource (model, shield, etc.) in the RoutingTable
33
+
|-- Looks up the resource (model, vector store, tool group, etc.) in the RoutingTable
34
34
|-- Resolves which provider handles this resource
35
35
|-- Enforces access control policies
36
36
|
@@ -80,7 +80,7 @@ Each provider spec declares:
80
80
81
81
### Provider Registry
82
82
83
-
`src/ogx/providers/registry/` contains one file per API (e.g., `inference.py`, `safety.py`). Each file defines an `available_providers()` function that returns all `ProviderSpec` objects for that API. The registry is loaded at startup by `get_provider_registry()` in `core/distribution.py`.
83
+
`src/ogx/providers/registry/` contains one file per API (e.g., `inference.py`, `responses.py`). Each file defines an `available_providers()` function that returns all `ProviderSpec` objects for that API. The registry is loaded at startup by `get_provider_registry()` in `core/distribution.py`.
The full list of auto-routed pairs is defined in `builtin_automatically_routed_apis()` in `core/distribution.py`:
107
107
108
-
| Routing Table API | Router API |
109
-
|-----------------------|------------------|
110
-
|`Api.models`|`Api.inference`|
111
-
|`Api.shields`|`Api.safety`|
112
-
|`Api.datasets`|`Api.datasetio`|
113
-
|`Api.scoring_functions`|`Api.scoring`|
114
-
|`Api.benchmarks`|`Api.eval`|
115
-
|`Api.tool_groups`|`Api.tool_runtime`|
116
-
|`Api.vector_stores`|`Api.vector_io`|
108
+
| Routing Table API | Router API |
109
+
|---------------------|--------------------|
110
+
|`Api.models`|`Api.inference`|
111
+
|`Api.tool_groups`|`Api.tool_runtime`|
112
+
|`Api.vector_stores`|`Api.vector_io`|
117
113
118
114
## The API Layer (`ogx_api`)
119
115
120
116
The `ogx_api` package defines all public-facing types and protocols:
121
117
122
-
-**Protocols** -- Python `Protocol` classes like `Inference`, `Safety` that define the API contract. HTTP routes are defined via FastAPI routers in `fastapi_routes.py` modules.
123
-
-**Data Types** -- Pydantic models for requests, responses, and resources (e.g., `Model`, `Shield`, `ChatCompletionRequest`).
118
+
-**Protocols** -- Python `Protocol` classes like `Inference`, `Responses` that define the API contract. HTTP routes are defined via FastAPI routers in `fastapi_routes.py` modules.
119
+
-**Data Types** -- Pydantic models for requests, responses, and resources (e.g., `Model`, `VectorStore`, `ChatCompletionRequest`).
124
120
-**Provider Specs** -- `InlineProviderSpec`, `RemoteProviderSpec`, and related types that define how providers are declared.
125
121
-**Internal utilities** -- KVStore and SqlStore abstract interfaces live here so third-party providers can use them without depending on the full server.
126
122
@@ -171,7 +167,7 @@ Used by: inference store (chat completion logs), conversations, prompts.
171
167
172
168
### Distribution Registry
173
169
174
-
`src/ogx/core/store/`implements `DistributionRegistry`, which tracks all registered resources (models, shields, datasets, etc.) across providers. It persists to the configured KVStore so resources survive server restarts.
170
+
`src/ogx/core/store/`implements `DistributionRegistry`, which tracks all registered resources (models, vector stores, tool groups, prompts, etc.) across providers. It persists to the configured KVStore so resources survive server restarts.
0 commit comments