opencad-agent
Natural-language CAD modelling on top of the opencad core.
The agent generates OpenCAD Python, validates it against an isolated analytic kernel, repairs it once if validation fails, then executes it — returning the generated code, the operations executed, and the updated feature tree.
Install:
pip install "opencad-agent[llm]" # [llm] pulls LiteLLM for code generation
Use it against an existing runtime:
from opencad import reset_default_context
from opencad_agent import run_chat
ctx = reset_default_context()
response, operations = run_chat(ctx, "Create a mounting bracket with 4 standoffs")
Or drive the service directly:
from opencad_agent import OpenCadAgentService
from opencad_agent.models import ChatRequest
service = OpenCadAgentService()
result = service.chat(ChatRequest(message="Build a cog", tree_state=tree))
Configure the model with OPENCAD_LLM_MODEL and, when the provider needs it,
OPENCAD_LLM_PROVIDER.
Kernel access
The agent never speaks HTTP. It takes a KernelClient
(opencad.kernel.client) and the caller picks the transport — an in-process
LocalKernelClient, or the HTTP client that opencad-backend supplies.
Tests
pytest
tests/agent/test_runtime_chat.py requires a configured live LLM; the rest of
the suite runs offline with an injected completion function.
Metadata
Release files for opencad-agent 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| opencad_agent-0.2.3.tar.gz | 17.9 kB | Without provenance | Details for opencad_agent-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opencad_agent-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for opencad_agent-0.2.3-py3-none-any.whl |
Total release size: 37.5 kB
Release files / opencad_agent-0.2.3.tar.gz
| Download URL | opencad_agent-0.2.3.tar.gz |
|---|---|
| Size | 17.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d924548ed6ba96c7c96cafb1348313a39faabd988d4f934c26c8426c5bdd3a1
|
|
BLAKE2b-256 checksum How to use checksums |
725180b6ee804a2a12b18dfb9cdd07020d8efddd1d2b05744c921cd7de8bc470
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / opencad_agent-0.2.3-py3-none-any.whl
| Download URL | opencad_agent-0.2.3-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac1cc34a43254a091108dbadf8eec45a1bf05de83b51c4e904d155900898f068
|
|
BLAKE2b-256 checksum How to use checksums |
54c9f13fd9baa14925c126beafc7d97d17fb81cc481e1cf4f620ad4652161502
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Security for opencad-agent 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.