Status: Stub — content pending.
Status: Stub — content pending.
Redis is obleth's hot cache and the real-time token budget store. All Redis data is derivable from Postgres and can be rebuilt on cache miss.
| Key pattern | Type | TTL | Contents |
|---|---|---|---|
obleth:key:{sha256_hex} | String | 300s | JSON blob of ResolvedKey (tenant_id, key_id, weight, tpm, group) |
obleth:model:{model_name} | String | 300s | JSON blob of model config |
obleth:mcp:{mcp_name} | String | 300s | JSON blob of MCP server config |
obleth:budget:{tenant_uuid} | Hash | sliding | tokens (remaining this window), ts (window start timestamp ms) |
obleth:cache:{sha256_of_prompt} | String | model-configured TTL | Cached response body |
{
"tenant_id": "550e8400-...",
"key_id": "661f9500-...",
"weight": 100,
"tokens_per_minute": 50000,
"group_name": "default",
"disabled": false
}
The obleth:budget:{tenant_uuid} key is a Redis hash with two fields:
| Field | Type | Meaning |
|---|---|---|
tokens | integer | Tokens remaining in the current 60-second window |
ts | integer | Window start time (Unix milliseconds) |
On each request, a Lua script atomically:
ts; if so, resets tokens to tpm.tokens.-1 if exhausted.obleth:cache:{sha256} stores the cached response for a chat completion request. The cache key is a SHA-256 of the canonicalized request body (model + messages + parameters). TTL is set per-model via cache_ttl_secs.
Channel: obleth:invalidate
When a config change is made via the Management API, obleth publishes a JSON invalidation message to this channel. All pods subscribed to the channel delete their moka and Redis cache entries for the affected resource.
{
"kind": "key",
"id": "sha256-hex-of-changed-key"
}
On a Redis miss for any obleth:key:* or obleth:model:* key, obleth:
This means a Redis restart does not require any manual action — the cache self-heals on first use.