Skip to main content

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 router
  • api_app.py — shared FastAPI factory with production CORS/docs defaults
  • http_kernel_client.py — the only outbound HTTP client to the kernel; implements opencad.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencad_backend-0.2.1.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencad_backend-0.2.1-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

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

Hashes for opencad_backend-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ef7d6b77d6505aa6e5448e419698a35bc5ad2c5ec42cdfdb52e542cd4a8fab07
MD5 f24723d92efc7bdf6993dec37bb77e43
BLAKE2b-256 5ab2c9a359c4cd53fedd169a18749ff792d0e255843f0d220836bee38f165979

See more details on using hashes here.

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

Hashes for opencad_backend-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 101fa4eacc55f1f72a8d442dc70f14194a5b6e5683f4d3a5cc1aae12d7ae7b8f
MD5 282ce77d2270856e59bcb87cd4b42f23
BLAKE2b-256 5fe7555228fd32ab97a456e6777ff934890eeb599cbcd445c662cc92f8062d15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page