Repository navigation
Description
Summary
Follow-up to inference-gateway/cli#646, which adds a d1 conversation storage backend (Cloudflare D1 over its HTTP query API). The CLI write path now supports D1, but cli.md does not mention it yet. This issue tracks updating the storage-backends documentation to cover Cloudflare D1 alongside the existing backends (config keys, env vars, and notes).
Why D1
Headless infer on ephemeral GitHub Actions runners needs an external, control-plane-readable conversation store:
sqlite/jsonl/memorylive on the runner's disk, which is wiped on recycle and unreadable externally.postgres/redisspeak wire protocols D1 does not.- D1 is external to the runner, and the gateway already reads it back via its native binding. PR [DOCS] Update go version references to 1.26.7 #646 adds the CLI write path.
What to update in cli.md
-
Storage Backends list - Configuration overview (currently SQLite, PostgreSQL, Redis, In-memory). Add a Cloudflare D1 entry, e.g.
Cloudflare D1 - external SQLite-compatible store over HTTP (for ephemeral CI runners). (Side note: JSONL is also missing from this particular list while it is present in the Conversation Management list - worth aligning.) -
Storage Backends list - Conversation Management (SQLite, PostgreSQL, Redis, JSONL, In-memory). Add
**Cloudflare D1**: External SQLite over Cloudflare's HTTP query API. -
Backend-agnostic inspection note - the line that reads "works the same across
jsonl,sqlite,postgres,redis, andmemory" should included1. -
Config keys - document the
storage.d1block:
storage:
enabled: true
type: d1
d1:
account_id: "<cloudflare-account-id>"
database_id: "<d1-database-id>"
api_token: "<api-token-with-d1-edit>" # inject via INFER_STORAGE_D1_API_TOKEN
base_url: "https://api.cloudflare.com/client/v4" # optional-
Environment variables - add to the env-var reference:
INFER_STORAGE_D1_ACCOUNT_IDINFER_STORAGE_D1_DATABASE_IDINFER_STORAGE_D1_API_TOKEN(secret - inject, never commit)INFER_STORAGE_D1_BASE_URL(optional; defaults tohttps://api.cloudflare.com/client/v4)
-
Migrations - the
infer migratedocs should note that Cloudflare D1 creates its schema automatically on connect (no manual migration step), matchingjsonl/redis/memoryin not requiring an explicit migration run.
Notes worth capturing
- Schema parity: the D1 driver runs the SQLite migrations verbatim over HTTP, so
conversations/session_groupsstay byte-for-byte compatible with the SQLite backend - either side can initialise the database. - Timestamps are stored as UTC RFC3339 for stable lexical
ORDER BY updated_at DESCacross runners in any timezone and unambiguous external reads. - Secret handling:
api_tokenfollows the existing plaintext-config + env-override convention (like the Postgres password) and is never logged; inject viaINFER_STORAGE_D1_API_TOKEN.
References
- CLI PR: feat(storage): add Cloudflare D1 conversation storage driver cli#646
- Original CLI issue: feat(storage): add Cloudflare D1 conversation storage driver cli#645
- Driver:
internal/infra/storage/d1.go; config:config/config.go(D1StorageConfig); factory:internal/infra/storage/factory.go
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Jun 23, 2026
@claude Can you document it?
inference-gateway-maintainer commentedon Jun 23, 2026
Claude finished @edenreich's task in 5m 45s —— View job •
docs/issue-273-20260623-1819• [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-273-20260623-1819?quick_pull=1&title=Issue%20%23273%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23273%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Documented the Cloudflare D1 storage backend
All updates from the issue are implemented in
cli.mdand pushed.cli.mdand locate the storage backend sectionsd1to the backend-agnostic inspection notestorage.d1config blockINFER_STORAGE_D1_*environment variableslint:mdandformat:check(andbuild) - all passWhat changed
A new Cloudflare D1 backend subsection was added under Conversation Management, plus three smaller edits to keep the existing lists/notes consistent:
Cloudflare D1 - external SQLite-compatible store over HTTP (for ephemeral CI runners), and also added the previously-missing JSONL entry to align this list with the Conversation Management one.**Cloudflare D1**: External SQLite over Cloudflare's HTTP query API.jsonl,sqlite,postgres,redis,d1, andmemory.storage.d1config block - documentedaccount_id,database_id,api_token, and optionalbase_url.INFER_STORAGE_D1_ACCOUNT_ID,INFER_STORAGE_D1_DATABASE_ID,INFER_STORAGE_D1_API_TOKEN(secret),INFER_STORAGE_D1_BASE_URL(optional).api_tokensecret handling.Notes on the approach
cli.mdhad no pre-existingstorage:YAML block,INFER_STORAGE_*reference, orinfer migratesection, so the migration guidance is captured as a "No manual migration" note inside the new D1 subsection rather than inventing aninfer migratecommand/page that isn't documented here.bun run format:check,bun run lint:md, andbun run buildall pass.PR: inference-gateway/docs#274 (Closes #273)
docs/issue-273-20260623-1819inference-gateway-releaser commentedon Jun 24, 2026
🎉 This issue has been resolved in version 0.6.113 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀