Skip to content

feat: add Avian as a named LLM provider - #396

Closed
avianion wants to merge 1 commit into
nearai:mainfrom
avianion:feat/add-avian-provider
Closed

avianion wants to merge 1 commit into
nearai:mainfrom
avianion:feat/add-avian-provider

Conversation

@avianion

Copy link
Copy Markdown

Summary

Adds first-class support for Avian as a named LLM provider, following the same pattern as the Tinfoil provider added in #62.

Avian is an OpenAI-compatible inference service providing access to DeepSeek, Kimi, GLM, and MiniMax models. This PR adds it as a dedicated backend (LLM_BACKEND=avian) rather than requiring users to configure it through the generic openai_compatible path.

Changes

  • src/config/llm.rs — LlmBackend::Avian enum variant, AvianConfig struct, AVIAN_API_KEY / AVIAN_MODEL env var resolution (default model: deepseek/deepseek-v3.2)
  • src/config/mod.rs — Export AvianConfig
  • src/llm/mod.rs — create_avian_provider() using Chat Completions API via rig-core's OpenAI adapter, routed from LlmBackend::Avian match arm
  • src/setup/wizard.rs — Avian in provider selection list, setup_avian() API key flow, model picker with all 4 models (DeepSeek V3.2, Kimi K2.5, GLM-5, MiniMax M2.5)
  • docs/LLM_PROVIDERS.md — Avian section with env config and model table
  • FEATURE_PARITY.md — Avian row in provider matrix and design decisions

Available models

Model ID Context
DeepSeek V3.2 deepseek/deepseek-v3.2 164K
Kimi K2.5 moonshotai/kimi-k2.5 131K
GLM-5 z-ai/glm-5 131K
MiniMax M2.5 minimax/minimax-m2.5 1M

Usage

LLM_BACKEND=avian
AVIAN_API_KEY=your-key-here
AVIAN_MODEL=deepseek/deepseek-v3.2  # optional, this is the default

Or via the setup wizard: ironclaw onboard and select "Avian".

cc @ilblackdragon @serrrfirat — would appreciate a review when you get a chance. This follows the same pattern as the Tinfoil provider (#62).

Add first-class support for Avian AI (https://avian.io), an
OpenAI-compatible inference provider offering DeepSeek, Kimi, GLM,
and MiniMax models.

- New `LlmBackend::Avian` variant with `AVIAN_API_KEY` / `AVIAN_MODEL`
  env vars (default model: deepseek/deepseek-v3.2)
- `AvianConfig` struct and `create_avian_provider()` using the
  Chat Completions API via rig-core's OpenAI adapter
- Setup wizard integration: provider selection, API key flow, and
  model picker with all four models
- Documentation in LLM_PROVIDERS.md and FEATURE_PARITY.md
@github-actions github-actions Bot added scope: llm LLM integration scope: setup Onboarding / setup scope: docs Documentation size: M 50-199 changed lines risk: high Safety, secrets, auth, or critical infrastructure labels Feb 27, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the system's flexibility by introducing a new, dedicated large language model provider. This integration streamlines the process for users who wish to leverage Avian's diverse model offerings, moving beyond a generic OpenAI-compatible setup. The changes ensure a consistent user experience, whether configuring via environment variables or an interactive wizard, and update internal configurations and documentation to reflect this new capability.

Highlights

  • New LLM Provider Integration: Added first-class support for Avian as a named LLM provider, allowing users to select it directly via LLM_BACKEND=avian or through the setup wizard.
  • Configuration and Model Support: Implemented AvianConfig to handle AVIAN_API_KEY and AVIAN_MODEL environment variables, with deepseek/deepseek-v3.2 as the default model. Avian supports DeepSeek, Kimi, GLM, and MiniMax models.
  • Setup Wizard Integration: Integrated Avian into the interactive setup wizard, providing a guided flow for API key configuration and model selection.
  • Documentation Updates: Updated docs/LLM_PROVIDERS.md with a dedicated section for Avian, including environment variable configuration and a table of available models. Also updated FEATURE_PARITY.md to reflect Avian's support.
Changelog
  • FEATURE_PARITY.md
    • Added Avian to the LLM provider feature parity matrix.
    • Included Avian in the list of IronClaw's intentional differences from OpenClaw.
  • docs/LLM_PROVIDERS.md
    • Added Avian to the main table of LLM providers.
    • Created a new section detailing Avian configuration, including environment variables and a list of supported models.
  • src/config/llm.rs
    • Added Avian variant to the LlmBackend enum.
    • Implemented FromStr and Display traits for LlmBackend to recognize and display avian.
    • Defined the AvianConfig struct to hold API key and model information.
    • Included avian in the LlmConfig struct.
    • Added logic to parse AVIAN_API_KEY and AVIAN_MODEL environment variables when LLM_BACKEND is set to avian.
  • src/config/mod.rs
    • Exported AvianConfig for broader use within the configuration module.
  • src/llm/mod.rs
    • Added a match arm for LlmBackend::Avian to create_llm_provider.
    • Implemented create_avian_provider function to initialize the Avian LLM provider using the rig::providers::openai adapter.
  • src/setup/wizard.rs
    • Added 'Avian' to the list of known LLM providers in the setup wizard.
    • Included 'Avian' in the provider selection prompt for new setups.
    • Implemented the setup_avian asynchronous function to guide users through configuring their Avian API key.
    • Added a model selection list specifically for Avian, featuring DeepSeek, Kimi, GLM, and MiniMax models.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@github-actions github-actions Bot added the contributor: new First-time contributor label Feb 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for Avian as a named LLM provider. The changes are well-structured, following the existing patterns for adding new providers, and include updates to configuration, the setup wizard, and documentation. I have one suggestion to improve the maintainability of the model list in the setup wizard.

Comment thread src/setup/wizard.rs
Comment on lines +1138 to +1152
let models: Vec<(String, String)> = vec![
(
"deepseek/deepseek-v3.2".into(),
"DeepSeek V3.2 (164K context)".into(),
),
(
"moonshotai/kimi-k2.5".into(),
"Kimi K2.5 (131K context)".into(),
),
("z-ai/glm-5".into(), "GLM-5 (131K context)".into()),
(
"minimax/minimax-m2.5".into(),
"MiniMax M2.5 (1M context)".into(),
),
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve readability and avoid repeated .into() calls, you can define the models as an array of string slices and then map it to a Vec<(String, String)>. This makes the data definition cleaner and more idiomatic.

Suggested change
let models: Vec<(String, String)> = vec![
(
"deepseek/deepseek-v3.2".into(),
"DeepSeek V3.2 (164K context)".into(),
),
(
"moonshotai/kimi-k2.5".into(),
"Kimi K2.5 (131K context)".into(),
),
("z-ai/glm-5".into(), "GLM-5 (131K context)".into()),
(
"minimax/minimax-m2.5".into(),
"MiniMax M2.5 (1M context)".into(),
),
];
let models: Vec<(String, String)> = [
(
"deepseek/deepseek-v3.2",
"DeepSeek V3.2 (164K context)",
),
(
"moonshotai/kimi-k2.5",
"Kimi K2.5 (131K context)",
),
("z-ai/glm-5", "GLM-5 (131K context)"),
(
"minimax/minimax-m2.5",
"MiniMax M2.5 (1M context)",
),
].iter().map(|(id, desc)| (id.to_string(), desc.to_string())).collect();

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Thanks for clarifying! Maintaining consistency with existing patterns for other providers is a valid approach. The current implementation is acceptable.

@zmanian zmanian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is well-written and follows the Tinfoil provider pattern cleanly -- nice work on the implementation quality. However, I don't think this should be a named provider.

Avian is an OpenAI-compatible endpoint. Users can already use it today with zero code changes:

LLM_BACKEND=openai_compatible
LLM_BASE_URL=https://api.avian.io/v1
LLM_API_KEY=your-avian-key
LLM_MODEL=deepseek/deepseek-v3.2

Our project guidelines say "prefer generic/extensible architectures over hardcoding specific integrations." Tinfoil got a named provider because it has unique TEE/attestation properties that require special handling. Avian uses the standard OpenAI Chat Completions API with no technical differentiation that warrants a dedicated backend variant.

Each named provider adds ongoing maintenance: config structs, setup wizard flows, feature parity tracking, documentation, and test fixtures that need updating whenever LlmConfig changes (as you can see from the avian: None additions in test helpers and wizard.rs). That cost is justified when there's a technical need, but not for convenience when the generic path already works.

If there's something Avian-specific that the openai_compatible path can't handle, I'd be interested to hear about it -- but as it stands, I'd recommend closing this PR and instead contributing a section to docs/LLM_PROVIDERS.md under "OpenAI-Compatible Endpoints" showing users how to configure Avian via the generic path.

@avianion avianion closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: new First-time contributor risk: high Safety, secrets, auth, or critical infrastructure scope: docs Documentation scope: llm LLM integration scope: setup Onboarding / setup size: M 50-199 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants