OpenCAD HTTP backend — FastAPI transport over the OpenCAD core and agent
Project description
opencad-backend
FastAPI transport over the OpenCAD core. This is the only distribution in the
repository that depends on a web framework — opencad and opencad-agent
carry no FastAPI, Starlette, httpx, or uvicorn.
Run
uv run --package opencad-backend --extra occt \
python -m uvicorn opencad_server.app:app --reload --port 8000
opencad_server.app mounts every service router in one process:
| Prefix | Router | Service |
|---|---|---|
/kernel |
opencad_server.kernel_router |
Geometry operations, topology, mesh |
/solver |
opencad_server.solver_router |
2-D constraint solving and diagnostics |
/tree |
opencad_server.tree_router |
Feature DAG CRUD, rebuild, branching |
/agent |
opencad_server.agent_router |
Natural-language modelling |
Each router module also exposes create_app() and a module-level app, so any
service can run standalone — for example opencad_server.kernel_router:app.
Modules
app.py— aggregate app, mounts every routerapi_app.py— shared FastAPI factory with production CORS/docs defaultshttp_kernel_client.py— the only outbound HTTP client to the kernel; implementsopencad.kernel.client.KernelClient*_router.py— one router per service
Kernel transport
Core packages depend on the KernelClient protocol, never on a transport. This
app chooses the implementation at startup: HttpKernelClient when
OPENCAD_TREE_LIVE_KERNEL / OPENCAD_AGENT_LIVE_KERNEL are true, otherwise the
in-process default.
Tests
OPENCAD_KERNEL_BACKEND=analytic pytest
tests/test_core_boundary.py parses every core module and fails if any of them
imports FastAPI, Starlette, httpx, uvicorn, python-dotenv, or opencad_server.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opencad_backend-0.2.1.tar.gz.
File metadata
- Download URL: opencad_backend-0.2.1.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef7d6b77d6505aa6e5448e419698a35bc5ad2c5ec42cdfdb52e542cd4a8fab07
|
|
| MD5 |
f24723d92efc7bdf6993dec37bb77e43
|
|
| BLAKE2b-256 |
5ab2c9a359c4cd53fedd169a18749ff792d0e255843f0d220836bee38f165979
|
File details
Details for the file opencad_backend-0.2.1-py3-none-any.whl.
File metadata
- Download URL: opencad_backend-0.2.1-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
101fa4eacc55f1f72a8d442dc70f14194a5b6e5683f4d3a5cc1aae12d7ae7b8f
|
|
| MD5 |
282ce77d2270856e59bcb87cd4b42f23
|
|
| BLAKE2b-256 |
5fe7555228fd32ab97a456e6777ff934890eeb599cbcd445c662cc92f8062d15
|