Get Started with NTK
NTK is a single Rust binary. The setup takes under 5 minutes.
NTK requires Claude Code (the CLI) installed and configured. Layer 3 inference requires Ollama (recommended) or a compatible backend. CPU-only mode works without any AI backend.
# Check Claude Code is installed claude --version # Install Ollama (optional, recommended for L3) curl -fsSL https://ollama.ai/install.sh | sh ollama serve &
The install script downloads the latest release binary for your OS and architecture:
curl -fsSL https://ntk.valraw.com/install.sh | sh
irm https://ntk.valraw.com/install.ps1 | iex
Or install from source:
cargo install ntk
This patches ~/.claude/settings.json to add the PostToolUse hook, copies the hook script, creates ~/.ntk/config.json, and automatically launches the model setup wizard to configure your inference backend:
ntk init -g
The -g flag patches the global settings. Use without it for per-project setup. The operation is idempotent - safe to run multiple times. Use --hook-only to skip the model wizard.
Pull Phi-3 Mini (~2GB) via Ollama for Layer 3 semantic compression:
ntk model pull # pulls phi3:mini Q5_K_M # Or choose a specific quantization: ntk model pull --quant q4_k_m # smaller, faster ntk model pull --quant q6_k # higher quality
Skip this step to run in L1+L2 only mode (no neural inference, <5ms latency).
ntk start # CPU mode - opens live TUI dashboard ntk start --gpu # GPU acceleration (CUDA/Metal auto-detected) # Daemon already running? ntk start attaches to the live TUI without restarting. # Ctrl+C exits the TUI - daemon stays running. # For a quick non-interactive snapshot: ntk dashboard # status + gain + bar chart → stdout, then exit
ntk status # daemon status + model info ntk test-compress file # test on a captured output ntk gain # view token savings
Edit ~/.ntk/config.json or place a .ntk.json in your project root for per-project overrides:
{
"compression": {
"inference_threshold_tokens": 300
},
"model": {
"provider": "ollama",
"quantization": "q5_k_m",
"gpu_layers": -1,
"fallback_to_layer1_on_timeout": true
},
"exclusions": {
"commands": ["cat", "echo"]
},
"telemetry": { "enabled": true }
}
ntk stop ntk init --uninstall # removes hook from settings.json rm -rf ~/.ntk # remove config & data