Skip to content

About

DeepSeek Harness in Cloudflare Durable Objects

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

DeepSeek Durable Objects

Run a DeepSeek agent loop inside a SQLite-backed Cloudflare Durable Object. The package persists native session history, recovers interrupted turns, and resumes parked tool calls. It supports DeepSeek's API and the OpenRouter Messages route.

Install

npm install @checkfu/deepseek-durable-objects

Use with a Worker

Import openDeepSeekSession from @checkfu/deepseek-durable-objects. Construct one runtime per Durable Object. Pass the object's SQLite storage, a stable session ID, the initial model configuration, and a tool host. Keep the provider and model pinned for that runtime.

Call submit, settle, and abort from the host's turn lifecycle. Use the same operation ID when recovering or resuming a turn. Drive recovery from the Durable Object alarm. The host supplies credentials and decides which tools can run, how to publish replies, and how to record usage. Use withDeepSeekDispatch from @checkfu/deepseek-durable-objects/transport to intercept a model dispatch for accounting.

Add deepSeekWorkerdBuild from @checkfu/deepseek-durable-objects/workerd to the Worker bundler using Cloudflare's Node compatibility. With Alchemy, load the plugin in the Worker source provider so the build sidecar can resolve it. The standalone Worker fixture shows the storage and tool interfaces in use.

Develop

Run bun install --frozen-lockfile and bun run verify. The checks include the compiled package, direct provider fixtures, and a Workerd restart against the same SQLite Durable Object. Commit the generated dist/ after changing the source; CI checks that it matches. To release, update the version and lockfile, merge to main, push the matching v<version> tag, and run npm publish from that commit.

About

DeepSeek Harness in Cloudflare Durable Objects

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages