← All projects

Chamfer

Chamfer creates parametric CAD models from a text prompt or reference image, checks dimensions and features, and exports the result for CAD or fabrication workflows.

Role
Creator / Engineer
Year
2026
Status
Open source · Active
VerificationGeometry checks + rendered views
InputText or reference image
DeliveryParametric, exportable CAD

How it’s built

Edge
One Cloudflare Worker (Hono) serves the landing page, the app, and the API. Sign-in uses better-auth with Google and GitHub; sessions live in D1.
Per-user state
Each user gets a SQLite-backed Durable Object that stores conversations, transcripts, settings, and demo spend. It runs the same route code as the local server.
Agent runtime
The agent runs in a per-user Cloudflare Container that scales to zero after five minutes idle. CAD code runs through build123d over MCP inside the container.
Model access
The container never holds a provider key. It calls a Worker proxy with a short-lived, conversation-scoped token, and the Durable Object adds the user’s own key or a metered demo key.
Durability
A stored turn marker and Durable Object alarms let a turn finish with every tab closed. If a container is evicted, the next one reloads the conversation from the Durable Object.
Storage
R2 holds image attachments and exported models. D1 holds accounts and the monthly demo budget.

What Chamfer does

A rendered image does not reveal every CAD error. A model may still contain the wrong dimensions, missing holes, or invalid geometry when it is exported.

Chamfer converts a request into a plan, writes build123d code or operates Autodesk Fusion, and executes the result in a geometry engine. Before export, it checks the model against the requested dimensions and features.

Generation and inspection

The agent works through a small set of CAD-specific tools. It can retrieve relevant documentation, load task-specific CAD instructions, inspect the current model, and revise its plan. Long sessions retain the requirements, current plan, and latest verification state when older conversation history is compacted.

For image-based requests, the agent tracks every reference image and compares each one with the latest rendered views. The geometry engine checks body count, dimensions, holes, and feature presence. Rendered views are used for shape and appearance checks that the geometry engine cannot determine directly.

Evaluation

The evaluation suite runs the same parts through multiple agents and validates their exported geometry. It records correctness, tool calls, context use, output, cost, and wall time so changes to prompts and tools can be compared against a fixed baseline.

Running on Cloudflare

The hosted version keeps three concerns apart: state, compute, and secrets. State lives in one Durable Object per user. Compute runs in a container named after the same user, so data and execution share one isolation boundary. Provider keys stay in the Durable Object and are never sent to the machine that runs generated CAD code.

The container holds no data that is not also stored elsewhere. When it is evicted, a new container rebuilds context from the Durable Object’s transcript. An end-to-end test kills the container mid-conversation to check this. A version handshake stops the Worker from talking to a container image built from different code, and a cron probe checks health and the demo budget every 15 minutes.

Demo usage is capped twice: per account in the user’s Durable Object and globally per month in D1. Users who bring their own key are not metered.

Running locally

When launched with npx chamfer, conversations, CAD execution, and geometry remain on the user’s computer. The user selects a model provider, inspects the finished model in the browser, and exports it for later CAD or fabrication work.