Skip to main content

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.

Download files

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

Source Distribution

opencad_agent-0.2.3.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

opencad_agent-0.2.3-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file opencad_agent-0.2.3.tar.gz.

File metadata

  • Download URL: opencad_agent-0.2.3.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for opencad_agent-0.2.3.tar.gz
Algorithm Hash digest
SHA256 3d924548ed6ba96c7c96cafb1348313a39faabd988d4f934c26c8426c5bdd3a1
MD5 b93824176853f63c72b67b8abb5fe784
BLAKE2b-256 725180b6ee804a2a12b18dfb9cdd07020d8efddd1d2b05744c921cd7de8bc470

See more details on using hashes here.

File details

Details for the file opencad_agent-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: opencad_agent-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for opencad_agent-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ac1cc34a43254a091108dbadf8eec45a1bf05de83b51c4e904d155900898f068
MD5 c59f1f62f9a0dadc1b87dcf3e0b8a28d
BLAKE2b-256 54c9f13fd9baa14925c126beafc7d97d17fb81cc481e1cf4f620ad4652161502

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 files

0.2.1

2 files

0.2.0

2 files

Supported by

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