AI Integration
LLM reasoning is optional and off by default. Enable it with the --ai flag. Hawk-i routes all model calls through litellm, so it works with several providers behind one interface.
Command-line flags
--ai- Enable LLM reasoning.--ai-model- Specify the model, e.g.gemini/gemini-1.5-flash,openai/gpt-4,ollama/codellama.--api-key- Provide the API key directly (alternative to environment variables).
The default model is gemini/gemini-1.5-flash.
Environment variables
Keys can be supplied via environment variables (recommended). Hawk-i routes to the right one by model prefix:
export GEMINI_API_KEY=your_key_here # Google Geminiexport OPENAI_API_KEY=your_key_here # OpenAIexport ANTHROPIC_API_KEY=your_key_here # AnthropicYour keys stay on your machine. Hawk-i passes them straight to the provider you chose and never routes them through any Hawk-i service.
Local models with Ollama
To keep everything offline, run a local model through Ollama. Specify the model as ollama/<model_name>:
$ hawki scan ./contracts --ai --ai-model ollama/codellamaMake sure Ollama is running locally and the model is pulled.
Fallback behavior
When --ai is not used, Hawk-i falls back to the explanation and impact templates provided by each rule. Every finding still ships with a clear description and remediation guidance, even with no LLM in the loop.