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.0.tar.gz (17.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.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file opencad_backend-0.2.0.tar.gz.

File metadata

  • Download URL: opencad_backend-0.2.0.tar.gz
  • Upload date:
  • Size: 17.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.0.tar.gz
Algorithm Hash digest
SHA256 720031b9a318f01d344e5d0eb8c5b7a3859d41d73ff167ff2a1cdfb4f78304db
MD5 7894a73d0c089d2b2b9458e978009990
BLAKE2b-256 27842e27bafce1d3838fe0ec64a5aab60b840d76b6b84a4f94269611d16d090b

See more details on using hashes here.

File details

Details for the file opencad_backend-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: opencad_backend-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db96d0f0d4e8a8051f3cae83a31c6a805b7363fdeedb513ca9302a9cefa2e73b
MD5 ef566b662af1c2a0ec170b6bd3d995c4
BLAKE2b-256 90726ef7aa0c8cf8b9fa10e10719598ee73203033b809079396094fe9663ea1f

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