Repository navigation
v0.15.0
Release v0.15.0
Release Notes
Overview
This release introduces integrated support for OpenRouter.ai, expanding Hexai’s large language model (LLM) provider options alongside OpenAI, GitHub Copilot, and Ollama. The OpenRouter provider allows Hexai users to access a wider range of models for code completions, chat, and CLI workflows, with full configuration and environment variable support. Several enhancements and bug fixes improve multi-provider selection, configuration, and documentation.
Features
OpenRouter.ai Provider Integration
- Full OpenRouter support for completions, chat, and CLI:
Hexai can now use OpenRouter.ai as an LLM backend. You can select OpenRouter at the global or per-surface level for completions, code actions, chat, or CLI. - API-Key and configuration management:
- Accepts
OPENROUTER_API_KEYorHEXAI_OPENROUTER_API_KEYvia environment variable. - Adds
[openrouter]section to yourconfig.tomlfor model, base URL, and temperature.
- Accepts
- Per-request model selection:
- Use any model offered by OpenRouter. Defaults to
openrouter/autoso you can get started quickly.
- Use any model offered by OpenRouter. Defaults to
- OpenRouter-specific headers and logging:
- Required headers (
Authorization,HTTP-Referer,X-Title) are sent automatically. - Log messages provide clear context for troubleshooting.
- Required headers (
- Unit tests included:
- Confidence in headers, request format, streaming, and error handling.
Why is this useful?
OpenRouter brings access to a broad spectrum of models—including Anthropic, Google Gemini, and more—helping users experiment, compare, and leverage the best LLMs for their workflow directly in Hexai.
Improvements
- Provider selection logic enhanced:
- OpenRouter can be set as the global or per-surface provider in CLI flags, LSP, or configuration, including in concurrent multi-provider completions.
- Environment variable support extended:
- New variables (
HEXAI_OPENROUTER_*) for model, base URL, and temperature.
- New variables (
- Documentation updated:
- Quickstart in
README.md,docs/configuration.md, and exampleconfig.tomlnow cover OpenRouter setup and usage.
- Quickstart in
- Robustness:
- Comprehensive unit tests for the OpenRouter provider.
- Default models and behavior:
- If no model is set,
openrouter/autois used, ensuring successful completions/configurations out of the box.
- If no model is set,
Bug Fixes
- Provider construction code, CLI, and LSP now properly accept three API key arguments for future extensibility and improved error handling.
- Multi-provider completion and chat selection code updated to fully support OpenRouter-specific settings.
- Tests updated and expanded to cover OpenRouter flows and catch configuration missteps.
Migration Notes
Configuration Changes
- [openrouter] section:
Add the following to yourconfig.tomlto configure OpenRouter:[openrouter] model = "openrouter/auto" # Use any OpenRouter model (see https://openrouter.ai) base_url = "https://openrouter.ai/api/v1" # Usually you can omit; defaults provided temperature = 0.2 # Optional, default is 0.2
- Environment variables:
SetOPENROUTER_API_KEYorHEXAI_OPENROUTER_API_KEYwith your credential.
Usage
- Provider selection:
Chooseopenrouteras your provider name in global or per-surface configuration, or via CLI flags. - Nothing in your workflow changes unless you opt in to OpenRouter as your provider.
Breaking Changes
- None. All prior provider configurations (
openai,copilot,ollama) remain supported and unaffected. - If you wish to use OpenRouter, ensure you have a valid API key and model name.
How to Get Started with OpenRouter in Hexai
- Obtain an OpenRouter API key from https://openrouter.ai.
- Set your environment variable:
export OPENROUTER_API_KEY=sk-... - Add to your config file:
[provider] name = "openrouter" [openrouter] model = "openrouter/auto"
- Select OpenRouter for concurrent completions or specific features (like chat) by adding entries under
[models.completion]or[models.chat]as described in the documentation.
Documentation
- See the updated configuration documentation and the example config.toml.example for more details.
Thank you to all contributors! As always, feedback and issues are welcome.