Skip to content

v0.15.0

Choose a tag to compare

@snonux snonux released this 07 Feb 19:48
· 377 commits to main since this release

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_KEY or HEXAI_OPENROUTER_API_KEY via environment variable.
    • Adds [openrouter] section to your config.toml for model, base URL, and temperature.
  • Per-request model selection:
    • Use any model offered by OpenRouter. Defaults to openrouter/auto so you can get started quickly.
  • OpenRouter-specific headers and logging:
    • Required headers (Authorization, HTTP-Referer, X-Title) are sent automatically.
    • Log messages provide clear context for troubleshooting.
  • 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.
  • Documentation updated:
    • Quickstart in README.md, docs/configuration.md, and example config.toml now cover OpenRouter setup and usage.
  • Robustness:
    • Comprehensive unit tests for the OpenRouter provider.
  • Default models and behavior:
    • If no model is set, openrouter/auto is used, ensuring successful completions/configurations out of the box.

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 your config.toml to 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:
    Set OPENROUTER_API_KEY or HEXAI_OPENROUTER_API_KEY with your credential.

Usage

  • Provider selection:
    Choose openrouter as 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

  1. Obtain an OpenRouter API key from https://openrouter.ai.
  2. Set your environment variable:
    export OPENROUTER_API_KEY=sk-...
  3. Add to your config file:
    [provider]
    name = "openrouter"
    
    [openrouter]
    model = "openrouter/auto"
  4. 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


Thank you to all contributors! As always, feedback and issues are welcome.