Component Implementation
Clew (Constraint Extraction)
Tree-sitter AST parsing with C FFI integration. Hybrid confidence scoring: AST-based extraction (0.95 confidence) with pattern-matching fallback (0.75). 101 built-in constraint patterns across six categories.
Supported Languages: TypeScript, JavaScript, Python, Rust, Go, Zig, C, C++, Java
Braid (Constraint Compilation)
Just-in-time constraint compilation to multiple intermediate representations:
- JSON Schema: For structured outputs API integration
- Context-Free Grammars: EBNF for syntactic constraints
- Regular Expressions: For pattern matching constraints
- Token Masks: Direct token-level constraint enforcement
LRU cache provides ~1µs hit latency with 20x speedup on repeated compilations. Topological sorting (Kahn's algorithm) handles dependency ordering and cycle detection.
Maze (Orchestration)
Token-level constraint enforcement via llguidance integration. Deployed on Modal Labs with scale-to-zero GPU infrastructure.
- Runtime: vLLM 0.11.0 for model serving
- Constraints: llguidance 0.7.11 for token masking
- Models: Qwen2.5-Coder-32B-Instruct, Llama 3.1, DeepSeek Coder, Mistral
- Hardware: A100-80GB GPUs with automatic scaling