Skip to content

feat: add 54 OpenAI-compatible providers with namespace-based model organization#82

Merged
ishaksebsib merged 17 commits into
mainfrom
feat/macro-based-openai-compatablity
Feb 5, 2026
Merged

feat: add 54 OpenAI-compatible providers with namespace-based model organization#82
ishaksebsib merged 17 commits into
mainfrom
feat/macro-based-openai-compatablity

Conversation

@surafelfikru

@surafelfikru surafelfikru commented Jan 29, 2026

Copy link
Copy Markdown
Member

This PR adds 54 new OpenAI-compatible providers to the SDK, bringing comprehensive provider coverage. It consolidates the provider code generation system and fixes critical issues with model naming and struct `duplication.

Major Changes

New Providers (54 total):

  • Core providers: Mistral, Chutes, CloudflareAiGateway, FireworksAi
  • Regional providers: AlibabaCn, MoonshotaiCn, SiliconflowCn
  • GitHub integration: GithubCopilot, GithubModels
  • Specialized tiers: ZaiCodingPlan, ZhipuaiCodingPlan
  • Plus 42 additional OpenAI-compatible providers

Public API Additions:

  • New provider exports in src/providers/mod.rs (all 54 providers)
  • Individual feature flags for each provider (e.g., chutes, fireworks-ai, github-copilot)
  • Updated full feature flag to include all new providers

Code Generation Improvements:

  • Consolidated provider-codegen.py as single source of truth
  • Enhanced duplicate struct name detection and resolution
  • Improved Pro/ prefix model handling (differentiates variants)
  • Better namespace organization for slash-based model IDs

Bug Fixes

  1. Duplicate Struct Names: Fixed conflicting implementations where models with version variants (e.g., claude-3-5-haiku vs claude-3.5-haiku) generated identical struct names. Now properly differentiated (e.g.,
    Claude35Haiku vs Claude3Dot5Haiku).

  2. Pro Prefix Models: Models with Pro/ prefix now generate distinct struct names with Pro prefix to avoid conflicts with non-Pro variants (e.g., ProDeepseekR1 vs DeepseekR1).

  3. Special Character Handling: Proper handling of:

    • Module names starting with digits (302ai → ai_302)
    • Hyphenated provider names (github-copilot → github_copilot)
    • PascalCase struct generation consistency

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have read the Contributing Guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (CHANGELOG.md)
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@surafelfikru surafelfikru changed the title Feat/macro based OpenAI compatablity feat: add 54 OpenAI-compatible providers with namespace-based model organization Feb 2, 2026
@surafelfikru surafelfikru marked this pull request as ready for review February 2, 2026 21:34
@surafelfikru surafelfikru force-pushed the feat/macro-based-openai-compatablity branch 2 times, most recently from 6313636 to 11b8cb0 Compare February 4, 2026 14:19
@surafelfikru surafelfikru force-pushed the feat/macro-based-openai-compatablity branch from 11b8cb0 to fef6fdb Compare February 4, 2026 14:20
@ishaksebsib ishaksebsib merged commit aaad1a0 into main Feb 5, 2026
6 checks passed
@ishaksebsib ishaksebsib deleted the feat/macro-based-openai-compatablity branch February 5, 2026 10:26
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.

2 participants