Instructions to use numinousmuses/C3D-v0-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use numinousmuses/C3D-v0-gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="numinousmuses/C3D-v0-gguf") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("numinousmuses/C3D-v0-gguf", dtype="auto") - llama-cpp-python
How to use numinousmuses/C3D-v0-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="numinousmuses/C3D-v0-gguf", filename="unsloth.q8_0.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use numinousmuses/C3D-v0-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf numinousmuses/C3D-v0-gguf:Q8_0 # Run inference directly in the terminal: llama-cli -hf numinousmuses/C3D-v0-gguf:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf numinousmuses/C3D-v0-gguf:Q8_0 # Run inference directly in the terminal: llama-cli -hf numinousmuses/C3D-v0-gguf:Q8_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf numinousmuses/C3D-v0-gguf:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf numinousmuses/C3D-v0-gguf:Q8_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf numinousmuses/C3D-v0-gguf:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf numinousmuses/C3D-v0-gguf:Q8_0
Use Docker
docker model run hf.co/numinousmuses/C3D-v0-gguf:Q8_0
- LM Studio
- Jan
- vLLM
How to use numinousmuses/C3D-v0-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "numinousmuses/C3D-v0-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "numinousmuses/C3D-v0-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/numinousmuses/C3D-v0-gguf:Q8_0
- SGLang
How to use numinousmuses/C3D-v0-gguf with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "numinousmuses/C3D-v0-gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "numinousmuses/C3D-v0-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "numinousmuses/C3D-v0-gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "numinousmuses/C3D-v0-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use numinousmuses/C3D-v0-gguf with Ollama:
ollama run hf.co/numinousmuses/C3D-v0-gguf:Q8_0
- Unsloth Studio new
How to use numinousmuses/C3D-v0-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for numinousmuses/C3D-v0-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for numinousmuses/C3D-v0-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for numinousmuses/C3D-v0-gguf to start chatting
- Docker Model Runner
How to use numinousmuses/C3D-v0-gguf with Docker Model Runner:
docker model run hf.co/numinousmuses/C3D-v0-gguf:Q8_0
- Lemonade
How to use numinousmuses/C3D-v0-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull numinousmuses/C3D-v0-gguf:Q8_0
Run and chat with the model
lemonade run user.C3D-v0-gguf-Q8_0
List all available models
lemonade list
C3D-v0: AI-Powered CAD Code Generation Model
Fine-tuned Gemma 3n model for generating CADQuery Python code from natural language descriptions
Model Description
C3D-v0 is a specialized language model fine-tuned for generating 3D CAD models through Python code. Built on Google's Gemma 3n architecture, this model transforms natural language descriptions into executable CADQuery scripts that can be rendered as 3D models.
This model is part of the C3D project - a complete text-to-CAD pipeline featuring an interactive CLI, 3D web viewer, and local AI inference.
Key Features
- ๐ฏ Specialized for CAD: Fine-tuned specifically on CAD generation tasks
- ๐ง CADQuery Focus: Generates clean, executable Python CADQuery code
- ๐ Local Inference: Designed to run locally via Ollama
- ๐ 3D Understanding: Trained on geometric and mechanical design concepts
- โก Optimized Performance: GGUF quantized for efficient inference
Training Details
Base Model
- Architecture: Google Gemma 3n (4B parameters)
- Base Model:
unsloth/gemma-3n-E4B-it
Dataset
- Source: Text-to-CadQuery Dataset
- Training Size: ~48,000 examples (50% of full dataset)
- Validation: Full validation set maintained
Training Configuration
- Method: LoRA (Low-Rank Adaptation) fine-tuning
- Epochs: 1 (due to resource constraints)
- Batch Size: 2 per device, 4 gradient accumulation steps
- Learning Rate: 2e-4
- Platform: Trained on Kaggle/Colab free tier
Usage
Via Ollama (Recommended)
# Install the model
ollama pull joshuaokolo/C3Dv0
# Generate CAD code
ollama run joshuaokolo/C3Dv0 "Create a simple gear with 12 teeth"
Via C3D CLI (Full Experience)
# Install C3D
npm install -g c3d
# Generate with interactive 3D viewer
c3d generate "a phone case for iPhone 15"
Direct Model Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load model and tokenizer
model_name = "numinousmuses/C3D-v0"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Generate CAD code
prompt = "Create a simple rectangular bracket"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.8,
top_p=0.9,
do_sample=True
)
generated_code = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_code)
Prompt Format
The model works best with direct, descriptive prompts:
"Create a simple gear with 12 teeth"
"Generate a phone case for iPhone 15"
"Make a rectangular bracket with mounting holes"
"Design a simple pulley with a 50mm diameter"
Model Performance
- Context Length: Up to 32k tokens (though trained at 16k)
- Code Quality: Generates syntactically correct CADQuery code
- Geometric Understanding: Handles basic to intermediate 3D shapes
- Memory Usage: ~10GB RAM for full context inference
Example Output
Input: "Create a simple gear with 12 teeth"
Output:
import cadquery as cq
# Create a gear with 12 teeth
gear = (
cq.Workplane("XY")
.circle(25) # Outer radius
.circle(20) # Inner radius for teeth
.extrude(5) # Thickness
)
# Add teeth around the circumference
for i in range(12):
angle = i * 30 # 360/12 = 30 degrees
tooth = (
cq.Workplane("XY")
.transformed(rotate=(0, 0, angle))
.rect(3, 8)
.extrude(5)
)
gear = gear.union(tooth)
result = gear
Limitations
- Training Scope: Limited to 50% of dataset due to resource constraints
- Complexity: Best suited for simple to moderate complexity objects
- Vision: Text-only model (multimodal version planned)
- Domain: Focused on mechanical/geometric objects from training data
Roadmap
- ๐ Full Dataset Training: Complete training on entire dataset
- ๐๏ธ Multimodal Support: Image-to-CAD generation capabilities
- ๐ฏ Improved Prompting: Enhanced prompt engineering for better results
- ๐ Performance Optimization: Additional fine-tuning iterations
Related Links
- Main Project: C3D on GitHub
- Ollama Model: joshuaokolo/C3Dv0
- GGUF Version: C3D-v0-gguf
- Dataset: Text-to-CadQuery
Citation
@misc{c3d-v0-2024,
title={C3D-v0: AI-Powered CAD Code Generation},
author={Joshua Okolo},
year={2024},
url={https://github.com/unxversal/c3d}
}
Acknowledgments
- Google DeepMind: For the Gemma 3n base model and competition opportunity
- Unsloth: For providing efficient fine-tuning infrastructure
- Text-to-CadQuery Team: For the comprehensive training dataset
- Ollama: For local inference capabilities
License
This model inherits the license from the base Gemma 3n model. Please refer to the original Gemma license for usage terms.
Contact: Joshua Okolo | Mechanical Engineering + Computer Science @ Harvard | Portfolio
- Downloads last month
- 233
8-bit
Model tree for numinousmuses/C3D-v0-gguf
Base model
google/gemma-3n-E4BEvaluation results
- Code Execution Success Rate on text-to-cadqueryself-reportedHigh