ll_ocadr — Usage
ll_ocadr encodes a global, full-resolution view of an object together with tiled local chunks, projects those features into a language model’s embedding space, and lets the LLM reason over the combined tokens.
CLI (HF-native)
Section titled “CLI (HF-native)”python ll_ocadr/run_ll_ocadr_hf.py \ --model Qwen/Qwen2-1.8B \ --mesh part.step \ --prompt "Describe this CAD part: <mesh>" \ --max-new-tokens 64- The
<mesh>placeholder token is registered and the LM embeddings are resized at build time. n_embedis derived automatically from the chosen language model.--no-croppinguses the global view only; otherwise the mesh is spatially chunked into local tiles.
Programmatic
Section titled “Programmatic”from ll_ocadr.run_ll_ocadr_hf import build_model_and_tokenizer, run_inference
model, tokenizer, config, processor = build_model_and_tokenizer("Qwen/Qwen2-1.8B")text = run_inference(model, processor, tokenizer, "part.stl", "Describe <mesh>")print(text)How the pieces fit
Section titled “How the pieces fit”mesh / STEP file │ vllm/process/ (chunkers, mesh/STEP loaders, tokenizer glue) ▼GeometryNet (PointNet++ local) + ShapeNet (ViT global) │ concatenate → MLP projector → LLM embedding space ▼LatticelabsOCADRForCausalLM → HF language model (forward / generate)vllm/latticelabs_ocadr.py—LatticelabsOCADRForCausalLM.vllm/lattice_encoder/—GeometryNet,ShapeNet, MLP projector.
# Fast unit tests (encoders, chunkers, fixtures) — no model download:cd ll_ocadr && pytest tests/ -m "not slow"
# End-to-end + CLI tests (tiny offline LM, still no network):cd ll_ocadr && pytest tests/ -m slowRelated
Section titled “Related”- Overview · Installation
- Background: The reality of AI CAD generation.