[KongchangAI]
Productpgw

Palimpsest Gateway

An open-source, self-hosted LLM API key pool gateway compatible with the OpenAI interface. It supports multi-vendor API key pool management, automatic failover, cross-vendor context continuation, and encrypted key storage. The project is built with Python and FastAPI.

Timeline (last 90 days)

Oct 12

Palimpsest Gateway is a self-hosted, OpenAI-compatible LLM key-pool gateway that provides unified key pooling and automatic failover while maintaining conversation continuity during switching.

Unverified50%
Oct 12

Palimpsest Gateway is open-sourced under the MIT license, written in Python/FastAPI, and can be run via docker compose up.

Unverified50%
Oct 12

The core of Palimpsest Gateway consists of the gateway itself plus Redis, where Redis handles the key registry, session history, usage counters, and audit logs.

Unverified50%
Oct 12

Palimpsest Gateway supports forwarding requests to OpenAI, Anthropic, Google Gemini, or OpenRouter.

Unverified50%
Oct 12

Applications make calls through a gateway key (pgw_live_...) and never touch the actual vendor keys.

Unverified50%
Oct 12

To achieve streaming failover without breaking the client, the gateway fully buffers the entire vendor stream in memory before sending anything to the client, with failover completing before any bytes leave the gateway.

Unverified50%
Oct 12

The failover loop categorizes exceptions: transient errors trigger a cooldown before switching to the next key, exhaustion triggers a switch to the next key, rejection suspends that key, and only fatal errors are actually thrown.

Unverified50%
Oct 12

For cross-vendor context continuation, the gateway stores each conversation turn in Redis by session; during failover it reconstructs a sliding window, defaulting to the most recent 4 turns plus the system prompt and current message.

Unverified50%
Oct 12

Vendor keys are encrypted at rest using a Fernet master key; the master key is generated at first startup, persisted to a Docker volume, and never leaves the container.

Unverified50%
Oct 12

Rotating the master key is a destructive operation (make rotate-secrets), by intentional design.

Unverified50%

5 more timeline events

All Facts (15)

Unverified

The Palimpsest Gateway project is located at github.com/hammrouni/palimpsest-gateway, and the image can be pulled via docker pull ghcr.io/hammrouni/palimpsest-gateway:latest.

50%
Unverified

Palimpsest Gateway is open-sourced under the MIT license, written in Python/FastAPI, and can be run via docker compose up.

50%
Unverified

The core of Palimpsest Gateway consists of the gateway itself plus Redis, where Redis handles the key registry, session history, usage counters, and audit logs.

50%
Unverified

Palimpsest Gateway supports forwarding requests to OpenAI, Anthropic, Google Gemini, or OpenRouter.

50%
Unverified

Applications make calls through a gateway key (pgw_live_...) and never touch the actual vendor keys.

50%
Unverified

To achieve streaming failover without breaking the client, the gateway fully buffers the entire vendor stream in memory before sending anything to the client, with failover completing before any bytes leave the gateway.

50%
Unverified

The failover loop categorizes exceptions: transient errors trigger a cooldown before switching to the next key, exhaustion triggers a switch to the next key, rejection suspends that key, and only fatal errors are actually thrown.

50%
Unverified

For cross-vendor context continuation, the gateway stores each conversation turn in Redis by session; during failover it reconstructs a sliding window, defaulting to the most recent 4 turns plus the system prompt and current message.

50%
Unverified

Vendor keys are encrypted at rest using a Fernet master key; the master key is generated at first startup, persisted to a Docker volume, and never leaves the container.

50%
Unverified

Rotating the master key is a destructive operation (make rotate-secrets), by intentional design.

50%
Unverified

The key selection algorithm first prioritizes keys with a request cap that still have remaining quota (with more remaining quota preferred), then keys with no cap, in order to use free keys first with paid keys as a fallback.

50%
Unverified

Palimpsest Gateway's API starts at http://localhost:8000 by default; including the X-Session-ID header in requests enables server-side conversation history management.

50%
Unverified

In Palimpsest Gateway's dashboard, model pricing is entered by the user themselves, with no pre-configured presets bundled in.

50%
Unverified

Palimpsest Gateway is a self-hosted, OpenAI-compatible LLM key-pool gateway that provides unified key pooling and automatic failover while maintaining conversation continuity during switching.

50%
Unverified

Palimpsest Gateway's project roadmap includes multi-gateway clustering, vendor quota synchronization, and request transformation, with OpenRouter already supporting real quota reading.

50%

Source Articles