Deployment¶
Everything you need to run and deploy the Worker.
Local Development¶
Install dependencies:
Run locally:
or:
Deploy:
or:
Dry-run bundle check:
Cloudflare Configuration¶
wrangler.toml:
name = "puter-api"
main = "src/index.js"
compatibility_date = "2026-04-21"
[observability.logs]
enabled = true
invocation_logs = true
[[durable_objects.bindings]]
name = "CHAT_MEMORY"
class_name = "ChatMemorySQLite"
[[migrations]]
tag = "v2"
new_sqlite_classes = ["ChatMemorySQLite"]
Important
The Worker expects the CHAT_MEMORY Durable Object binding to exist in production.
If the binding is unavailable, the code has an in-memory fallback map. That fallback is only useful for local/non-persistent execution and should not be treated as durable production memory.
Project Files¶
src/index.js Main deployed Worker and Durable Object.
src/model-tier-pools.js Puter fallback model pools.
wrangler.toml Cloudflare Worker configuration.
package.json npm scripts and dependencies.
chat (1) (1).html Standalone browser chat client.
test-chat.js Puppeteer smoke test for the HTML client.
README.md This documentation.
There are also root-level older/stale copies:
Warning
Wrangler deploys src/index.js, not the root index.js.
Dependencies¶
Runtime/imported by the Worker:
Development/testing/client-related dependencies:
Operational Notes¶
The Worker uses:
Multiple upstream AI providers in a waterfall pattern
Authentication backend for caller API key validation
Durable Objects for memory and model-usage rotation
MiniSearch for BM25 text recall
Background compaction for long conversation efficiency