Skip to content

[codex] Add Modelsell provider - #2043

Merged
zhangmo8 merged 1 commit into
ThinkInAIXYZ:devfrom
modelsell:codex/add-modelsell-provider
Jul 28, 2026
Merged

[codex] Add Modelsell provider#2043
zhangmo8 merged 1 commit into
ThinkInAIXYZ:devfrom
modelsell:codex/add-modelsell-provider

Conversation

@modelsell

@modelsell modelsell commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add Modelsell as a disabled built-in OpenAI-compatible provider preset
  • use https://modelsell.com/v1 and discover models dynamically from /v1/models
  • add Modelsell website, API key, documentation, and model endpoint metadata
  • register the official Modelsell brand icon
  • cover the provider defaults, runtime model discovery, Bearer authentication, and icon mapping

Closes #2042

Implementation

  • Provider ID: modelsell
  • API type/runtime: existing openai-completions / OpenAI-compatible runtime
  • Credentials: existing main-process provider API-key settings
  • Model source and connection check: live OpenAI-compatible GET /v1/models
  • Deeplink: existing built-in provider/install flow; no Modelsell-specific route
  • Special adapter: none

The integration does not hardcode a model catalog or introduce provider-specific request behavior.

Validation

  • pnpm run format
  • pnpm run format:check
  • pnpm run i18n
  • pnpm run lint
  • pnpm run typecheck
  • pnpm run icons:check
  • pnpm exec vitest run --config vitest.config.ts test/main/provider/defaultProviders.test.ts test/main/provider/basicApiKeyProviders.test.ts (19 tests passed)
  • pnpm exec vitest run --config vitest.config.renderer.ts test/renderer/components/ModelIcon.test.ts (6 tests passed)

No live authenticated Modelsell API call was performed.

Summary by CodeRabbit

  • New Features

    • Added Modelsell as a built-in OpenAI-compatible provider.
    • Added Modelsell links for setup, documentation, model browsing, and API access.
    • Added Modelsell branding and icon support throughout the interface.
  • Bug Fixes

    • Improved Modelsell model discovery using its compatible models endpoint.
  • Tests

    • Added coverage for provider configuration, model retrieval, authentication, and icon rendering.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Modelsell as a disabled OpenAI-compatible provider preset, validates /v1/models discovery with Bearer authentication, and registers its model icon for renderer lookups.

Changes

Modelsell provider integration

Layer / File(s) Summary
Provider preset and model discovery
src/main/provider/defaults.ts, test/main/provider/defaultProviders.test.ts, test/main/provider/basicApiKeyProviders.test.ts
Registers Modelsell with its OpenAI-compatible endpoint and website metadata, and tests provider configuration, authenticated model discovery, and returned model mapping.
Provider icon registration
src/renderer/src/components/icons/modelIconRegistry.ts, test/renderer/components/ModelIcon.test.ts
Adds the Modelsell icon mapping and verifies that ModelIcon renders the corresponding asset.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: zerob13

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds the Modelsell preset, metadata, icon, and tests, but the requested i18n updates are not shown in the reviewed changes. Add the missing i18n entries and verify any deeplink/install wiring if it is part of the expected preset flow.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main change: adding the Modelsell provider.
Out of Scope Changes check ✅ Passed All reviewed changes support the Modelsell preset; no unrelated edits are evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zerob13
zerob13 marked this pull request as ready for review July 28, 2026 01:56

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/main/provider/basicApiKeyProviders.test.ts`:
- Around line 170-177: Update the AiSdkProvider construction in the basic API
key provider test to pass the required third ProviderLocalePort argument,
reusing the existing locale fixture or a suitable mock. Preserve the current
provider and settings arguments while ensuring the constructor never receives
undefined for its locale dependency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 22251ea9-1e86-46a6-8142-4e1b7fe57847

📥 Commits

Reviewing files that changed from the base of the PR and between 13f0c6c and a609b4c.

⛔ Files ignored due to path filters (1)
  • src/renderer/src/assets/llm-icons/modelsell.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • src/main/provider/defaults.ts
  • src/renderer/src/components/icons/modelIconRegistry.ts
  • test/main/provider/basicApiKeyProviders.test.ts
  • test/main/provider/defaultProviders.test.ts
  • test/renderer/components/ModelIcon.test.ts

Comment on lines +170 to +177
const provider = new AiSdkProvider(
createProvider({
id: 'modelsell',
name: 'Modelsell',
baseUrl: 'https://modelsell.com/v1'
}),
createProviderSettings()
)

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.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Pass the required locale dependency to AiSdkProvider.

Line [170] constructs AiSdkProvider with only two arguments, but its constructor requires a third ProviderLocalePort argument. Add the existing locale fixture or a suitable mock as the third argument; otherwise type checking should fail and runtime initialization may receive undefined.

This cross-file finding relies on the constructor contract in src/main/provider/providers/aiSdkProvider.ts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/main/provider/basicApiKeyProviders.test.ts` around lines 170 - 177,
Update the AiSdkProvider construction in the basic API key provider test to pass
the required third ProviderLocalePort argument, reusing the existing locale
fixture or a suitable mock. Preserve the current provider and settings arguments
while ensuring the constructor never receives undefined for its locale
dependency.

@zhangmo8
zhangmo8 merged commit a3dfe05 into ThinkInAIXYZ:dev Jul 28, 2026
12 checks passed
zerob13 pushed a commit that referenced this pull request Aug 2, 2026
Registers OrcaRouter as a disabled built-in OpenAI-compatible provider,
mirroring the Modelsell registration (#2043): a DEFAULT_PROVIDERS entry, the
model icon, and a provider-import mapping so configs pointing at
api.orcarouter.ai land on the built-in provider instead of a custom one.

Models are discovered live from /v1/models, so no provider-db entry is needed.
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.

[Feature] Add Modelsell as an OpenAI-compatible provider preset

2 participants