mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
Make hanzo-node natively serve the canonical Hanzo inference engine (OpenAI / Anthropic / Responses HTTP API) in-process, alongside the existing gRPC server, behind a new default-off `engine` Cargo feature. Purely additive: with the feature off the node builds and behaves exactly as before. - Cargo.toml: optional path-deps on hanzo-server-core (default-features=false) and hanzo-engine; `engine` feature gating them; cuda/cudnn/metal/rocm/vulkan/ accelerate/mkl/nccl/flash-attn[-v3] features each forwarding to the matching engine + server-core features (mirrors hanzo-server/Cargo.toml). default = []. - .cargo/config.toml: rustflags target-cpu=native (engine's candle fork needs it). - lib.rs: add EngineConfig (enabled/cpu/engine_api_addr default 0.0.0.0:36900, + cfg-gated ModelSelected) to NodeConfig; cfg-gated hanzo_state on HanzoNode built in new() via HanzoForServerBuilder; start() runs gRPC + axum engine API concurrently (spawn + tokio::join!) when state is present, else unchanged. All engine code is #[cfg(feature = "engine")]; errors map to crate::Error, no unwrap/expect. - bin: --engine-port/HANZO_ENGINE_ADDR, --model/HANZO_ENGINE_MODEL, --engine-cpu; logs the engine URL on startup. Validation (CPU box, GPU-blocked, no weights): - cargo check -p hanzo-node (no features): pass, 0 warnings. - cargo check -p hanzo-node --features engine: pass; warnings only from upstream hanzo-engine/hanzo-server-core, none from hanzo-node. GPU feature graphs (cuda/rocm/metal/...) resolve via cargo metadata but are not compiled here (no GPU toolchains).
hanzo-node
Hanzo Dev CLI - AI-powered development assistant for Node.js projects.
Installation
# Global installation
npm install -g hanzo-node
# Or run directly with npx
npx hanzo-node
Usage
# Start the interactive CLI
hanzo
# Or use the full command name
hanzo-dev
# Run with a specific prompt
hanzo "explain this codebase"
Features
- AI-powered code generation and explanation
- Context-aware assistance that understands your project
- Multi-provider support (OpenAI, Anthropic, etc.)
- Terminal-based UI with streaming responses
- MCP (Model Context Protocol) integration
Platform Support
- macOS (Apple Silicon and Intel)
- Linux (x64 and ARM64)
- Windows (x64)
Configuration
Configuration is stored in ~/.hanzo/config.toml:
[default]
model = "claude-sonnet-4-20250514"
provider = "anthropic"
Environment Variables
ANTHROPIC_API_KEY- Anthropic API keyOPENAI_API_KEY- OpenAI API keyHANZO_MODEL- Override default modelHANZO_PROVIDER- Override default provider
Related Packages
@hanzo/dev- Same CLI with different package name@hanzo/dev- Primary CLI package
License
Apache-2.0