Skip to content

Add Qwen, Z.ai, and Claude Code providers with improved validation - #50

Merged
hbmartin merged 4 commits into
mainfrom
claude/open-issues-prioritization-3k55wy
Jul 6, 2026
Merged

hbmartin merged 4 commits into
mainfrom
claude/open-issues-prioritization-3k55wy

Conversation

@hbmartin

@hbmartin hbmartin commented Jul 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR adds three new AI model providers (Qwen, Z.ai, and Claude Code) to the model picker, along with improvements to configuration validation and LM Studio model discovery.

Key Changes

New Providers

  • QwenProvider: Support for Alibaba Cloud's Qwen 3 and other DashScope models (qwen3-max, qwen3-coder-plus, qwen-plus, qwen-turbo)
  • ZaiProvider: Support for Zhipu AI's GLM models (GLM 4.6, 4.5, 4.5 Air) via the Z.ai API
  • ClaudeCodeProvider: Support for Claude models through the Claude Code CLI with subscription-based authentication (no API key required)

Configuration & Validation Improvements

  • Enhanced validateField() method to accept an optional record parameter, allowing field validators to access other form values for context-aware validation
  • Updated API key validation to only warn about key prefix format when using the default base URL (custom endpoints/proxies may use different formats)
  • Modified AddModelForm to pass form values to field validators for cross-field validation support

LM Studio Provider Enhancements

  • Improved model discovery to handle JIT-loaded models (both 'llm' and 'vlm' types)
  • Made model type validation more flexible to support future model types beyond the currently documented set
  • Changed model list parsing to skip malformed entries instead of rejecting the entire list
  • Added proper handling for empty model IDs

Icons

  • Added QwenIcon (geometric pattern)
  • Added ZaiIcon (stylized "Z" design)

Testing

  • Added comprehensive test suites for QwenProvider, ZaiProvider, and ClaudeCodeProvider
  • Added tests for LM Studio model discovery with JIT loading
  • Added validation tests for context-aware field validation with custom base URLs

Documentation & Configuration

  • Updated README to list new providers
  • Updated package.json version to 0.5.0
  • Added ai-sdk-provider-claude-code to Vite's external dependencies (dynamic peer import, never bundled)
  • Exported new providers from main library index

Notable Implementation Details

  • All new providers use dynamic imports for their dependencies to avoid unnecessary bundling
  • QwenProvider and ZaiProvider leverage the OpenAI-compatible SDK with custom base URLs
  • ClaudeCodeProvider handles authentication through the Claude Code CLI rather than API keys
  • Configuration validation now supports cross-field validation by passing the entire form record to validators

https://claude.ai/code/session_01HhfPeyDkq6rxAh87EC11HR

Review in cubic

claude added 4 commits July 5, 2026 18:57
Adds a ClaudeCodeProvider backed by ai-sdk-provider-claude-code so
users can run Claude Opus/Sonnet/Haiku through their Claude Code CLI
subscription without configuring an API key.

- No required configuration: auth is handled by the CLI login; optional
  cwd and pathToClaudeCodeExecutable string settings are exposed
- Registered in allProviders/createDefaultRegistry and exported for
  consumers that build their own registry
- ai-sdk-provider-claude-code added as an optional peer dependency,
  pinned to <3.0.0 (3.x targets AI SDK v6 / LanguageModelV3)
- Marked external in the vite build so the Node-only SDK is never
  bundled into the browser bundle
- Bump version to 0.5.0

hbmartin/secure-design#46

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HhfPeyDkq6rxAh87EC11HR
…artin/secure-design#64

Users pointing a provider at a custom OpenAI-compatible endpoint often
have keys that do not start with the vendor's usual prefix (e.g. "sk-"),
and the "API key typically starts with..." nag was misleading there.

- Field validators now optionally receive the full config record
- apiKeyField only warns about the vendor prefix when no custom baseURL
  is configured
- AddModelForm passes current form values into field validation so the
  warning also clears live in the form
- Add coverage for both validateCredentials and validateField paths

hbmartin/secure-design#64

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HhfPeyDkq6rxAh87EC11HR
…martin/secure-design#81

With just-in-time model loading enabled, LM Studio's /api/v0/models
returns every downloaded model (loaded or not) — including entries with
type 'vlm'. The response validator only accepted 'llm' and 'embeddings',
so a single vision model caused the entire list to be rejected with
"Unexpected LM Studio model list response payload", leaving users with
no models unless they preloaded them manually.

- Accept any string model type; only embeddings are filtered out of the
  chat model list
- Skip malformed entries instead of failing the whole payload
- Mark 'vlm' / 'vision'-capable models as supporting vision
- Add fetchModels coverage for JIT-style responses

hbmartin/secure-design#81

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HhfPeyDkq6rxAh87EC11HR
Adds two OpenAI-compatible providers requested by users:

- Qwen: qwen3-max (default), qwen3-coder-plus, qwen-plus, qwen-turbo
  against Alibaba Cloud Model Studio (DashScope); the base URL is
  configurable for mainland-China accounts
- Z.ai (GLM): glm-4.6 (default), glm-4.5, glm-4.5-air against the Z.ai
  API; base URL configurable for open.bigmodel.cn accounts
- Both use the existing @ai-sdk/openai-compatible optional peer
  dependency, registered in allProviders and exported for custom
  registries; icons and README updated

Provides native Qwen model access requested in
hbmartin/secure-design#64

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HhfPeyDkq6rxAh87EC11HR
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 543c9274-e51a-4b7e-bcf0-d6f83bbd543b

📥 Commits

Reviewing files that changed from the base of the PR and between 1d63848 and d97cd66.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • README.md
  • package.json
  • src/lib/components/AddModelForm.tsx
  • src/lib/icons/index.ts
  • src/lib/index.ts
  • src/lib/providers/ClaudeCodeProvider.ts
  • src/lib/providers/LmStudioProvider.ts
  • src/lib/providers/QwenProvider.ts
  • src/lib/providers/ZaiProvider.ts
  • src/lib/providers/configuration.ts
  • src/lib/providers/index.ts
  • tests/providers.claudeCode.test.ts
  • tests/providers.lmstudio.test.ts
  • tests/providers.qwenZai.test.ts
  • tests/providers.validation.test.ts
  • vite.config.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/open-issues-prioritization-3k55wy

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

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedai-sdk-provider-claude-code@​2.3.09510010092100

View full report

@hbmartin
hbmartin merged commit c72e1ad into main Jul 6, 2026
5 of 7 checks passed
@hbmartin
hbmartin deleted the claude/open-issues-prioritization-3k55wy branch July 6, 2026 00:58
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