Status: Stub — content pending.
Status: Stub — content pending.
obleth uses SQLx with embedded migrations. Migrations run automatically on startup and are idempotent.
tenantsStores all tenants. Introduced in migration 0001.
| Column | Type | Notes |
|---|---|---|
id | UUID PRIMARY KEY | gen_random_uuid() |
name | TEXT NOT NULL UNIQUE | Human-readable name |
weight | BIGINT NOT NULL DEFAULT 100 | Fairshare weight |
tokens_per_minute | BIGINT NOT NULL DEFAULT 0 | TPM quota (0 = unlimited) |
group_name | TEXT | Fairshare group assignment |
created_at | TIMESTAMPTZ | Auto-set |
updated_at | TIMESTAMPTZ | Auto-updated |
api_keysStores API key hashes. The raw key is never stored. Introduced in 0001.
| Column | Type | Notes |
|---|---|---|
id | UUID PRIMARY KEY | |
tenant_id | UUID NOT NULL | FK → tenants.id |
name | TEXT NOT NULL | Display name |
key_hash | TEXT NOT NULL UNIQUE | SHA-256 of the full secret |
key_prefix | TEXT NOT NULL | First 18 chars (safe to display) |
disabled | BOOLEAN NOT NULL DEFAULT false | |
created_at | TIMESTAMPTZ | |
updated_at | TIMESTAMPTZ |
modelsModel registry. Introduced in 0002; cache_enabled/cache_ttl_secs added in 0004.
| Column | Type | Notes |
|---|---|---|
id | UUID PRIMARY KEY | |
model_name | TEXT NOT NULL UNIQUE | Name used in client requests |
upstream_model | TEXT | Model name sent to upstream |
api_base | TEXT | Per-model upstream override |
api_key | TEXT | Injected upstream credential |
input_cost_per_token | FLOAT8 | For billing |
output_cost_per_token | FLOAT8 | For billing |
context_window | BIGINT | |
admission_weight | FLOAT8 DEFAULT 1.0 | Scales fairshare cost |
supports_function_calling | BOOLEAN | |
supports_system_messages | BOOLEAN | |
enabled | BOOLEAN DEFAULT true | |
cache_enabled | BOOLEAN DEFAULT false | Response cache toggle |
cache_ttl_secs | BIGINT | Cache TTL |
created_at | TIMESTAMPTZ | |
updated_at | TIMESTAMPTZ |
fairshare_groupsScheduler groups for hierarchical mode. Introduced in 0003.
| Column | Type | Notes |
|---|---|---|
name | TEXT PRIMARY KEY | Group name |
weight | BIGINT NOT NULL DEFAULT 100 | Group-level weight |
created_at | TIMESTAMPTZ |
mcp_serversMCP server registry. Introduced in 0005.
| Column | Type | Notes |
|---|---|---|
id | UUID PRIMARY KEY | |
name | TEXT NOT NULL UNIQUE | |
base_url | TEXT NOT NULL | |
auth_header | TEXT | Injected auth header value |
enabled | BOOLEAN DEFAULT true | |
created_at | TIMESTAMPTZ | |
updated_at | TIMESTAMPTZ |
audit_logImmutable record of all Management API mutations. Introduced in 0001.
| Column | Type | Notes |
|---|---|---|
id | UUID PRIMARY KEY | |
action | TEXT NOT NULL | e.g. create_tenant, delete_key |
entity_type | TEXT NOT NULL | e.g. tenant, api_key |
entity_id | TEXT | UUID of the affected entity |
payload | JSONB | Before/after snapshot |
created_at | TIMESTAMPTZ |
Migrations live in obleth-config/migrations/ and are embedded in the binary. They run in order on startup. You can inspect the applied migrations:
SELECT filename, installed_on
FROM _sqlx_migrations
ORDER BY installed_on;