Skip to content

feat: add Avian as LLM provider#3369

Open
avianion wants to merge 1 commit intosimstudioai:mainfrom
avianion:feat/avian-provider
Open

feat: add Avian as LLM provider#3369
avianion wants to merge 1 commit intosimstudioai:mainfrom
avianion:feat/avian-provider

Conversation

@avianion
Copy link

Summary

Adds Avian as a new LLM provider. Avian is an OpenAI-compatible inference API offering competitive pricing on frontier models.

Models:

Model Context Window Input (per 1M) Output (per 1M)
deepseek/deepseek-v3.2 164K $0.26 $0.38
moonshotai/kimi-k2.5 131K $0.45 $2.20
z-ai/glm-5 131K $0.30 $2.55
minimax/minimax-m2.5 1M $0.30 $1.10

Features supported:

  • Chat completions
  • Streaming responses
  • Function/tool calling
  • Temperature control

Changes

  • components/icons.tsx — Add AvianIcon SVG component
  • providers/types.ts — Add 'avian' to ProviderId union type
  • providers/models.ts — Add Avian provider definition with model pricing and capabilities
  • providers/avian/index.ts — Provider implementation using OpenAI SDK (follows DeepSeek pattern)
  • providers/avian/utils.ts — Streaming utility using shared createOpenAICompatibleStream
  • providers/registry.ts — Register avianProvider in the provider registry
  • providers/utils.ts — Add Avian to provider metadata map

Implementation

The provider follows the same pattern as other OpenAI-compatible providers (DeepSeek, Cerebras). It uses the openai npm package with baseURL: 'https://api.avian.io/v1' and supports all standard features including tool calling loops, forced tool usage, and streaming with cost tracking.

Authentication is via user-provided API key (AVIAN_API_KEY as Bearer token).

Test plan

  • Verify Avian models appear in model selector dropdown
  • Test chat completion with deepseek/deepseek-v3.2 model
  • Test streaming response
  • Test function calling with a tool-enabled workflow
  • Verify cost tracking displays correct pricing

cc @waleedlatif1 @emir-karabeg

Add Avian (https://avian.io) as a new LLM provider with OpenAI-compatible
API support including chat completions, streaming, and function calling.

Models:
- deepseek/deepseek-v3.2 (164K context, $0.26/$0.38 per 1M tokens)
- moonshotai/kimi-k2.5 (131K context, $0.45/$2.20 per 1M tokens)
- z-ai/glm-5 (131K context, $0.30/$2.55 per 1M tokens)
- minimax/minimax-m2.5 (1M context, $0.30/$1.10 per 1M tokens)

Changes:
- Add AvianIcon to components/icons.tsx
- Add 'avian' to ProviderId type
- Add Avian provider definition with model pricing in models.ts
- Create providers/avian/ with index.ts and utils.ts
- Register provider in registry.ts and utils.ts
@vercel
Copy link

vercel bot commented Feb 27, 2026

@avianion is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Added Avian as a new LLM provider with OpenAI-compatible API integration. The implementation follows the established DeepSeek provider pattern, reusing proven architecture for OpenAI SDK-based providers. The integration includes proper tool calling support, streaming responses, cost tracking, and provider metadata registration. All 4 models are correctly configured with pricing and context window specifications.

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • The implementation is a well-executed pattern replication of the existing DeepSeek provider with appropriate naming changes. All imports follow established conventions, model definitions are accurate, and the provider is properly registered across all necessary files. No logic changes or risks introduced.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/providers/avian/index.ts New provider implementation following established DeepSeek pattern with OpenAI SDK, supports tool calling, streaming, and cost tracking
apps/sim/providers/models.ts Added Avian provider definition with 4 models, pricing, and configuration
apps/sim/providers/registry.ts Registered avianProvider in the provider registry map
apps/sim/providers/types.ts Added 'avian' to ProviderId union type
apps/sim/providers/utils.ts Added Avian to provider metadata map using buildProviderMetadata

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User selects Avian provider] --> B[Provider Registry]
    B --> C[avianProvider from /providers/avian/index.ts]
    C --> D[Initialize OpenAI SDK]
    D --> E[baseURL: api.avian.io/v1]
    E --> F{Request Type?}
    F -->|Streaming + No Tools| G[Create stream response]
    F -->|With Tools| H[Tool execution loop]
    F -->|Standard| I[Standard completion]
    H --> J[Execute tools with prepareToolsWithUsageControl]
    J --> K[Track forced tool usage]
    K --> L[Iterate up to MAX_TOOL_ITERATIONS]
    L --> M{Stream final?}
    M -->|Yes| G
    M -->|No| N[Return response with timing]
    G --> O[Calculate costs using model pricing]
    I --> O
    N --> O
    O --> P[Return to user with tokens & cost]
Loading

Last reviewed commit: f77f80c

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant