Skip to content

Add QuickRouter model provider 0.0.1 - #4093

Open
YunSongMax wants to merge 3 commits into
langgenius:mainfrom
YunSongMax:add-quickrouter-0.0.1
Open

YunSongMax wants to merge 3 commits into
langgenius:mainfrom
YunSongMax:add-quickrouter-0.0.1

Conversation

@YunSongMax

@YunSongMax YunSongMax commented Dec 3, 2026 •

Copy link
Copy Markdown

Plugin Submission

Plugin information

Submission type

  • New plugin
  • Version update

What changed

Adds a dedicated QuickRouter LLM provider for Dify workflows. It ships 13 QuickRouter catalog IDs, defaults to the QuickRouter HTTPS endpoint, and validates credentials through the model list. Users can add custom IDs and opt in to the capabilities of their routes. Compatible routes support streamed chat, function tools, inline image inputs, and native JSON Schema.

  • GPT: gpt-6.2-astra, gpt-6.2-sol, gpt-6.1-terra
  • Claude: claude-opus-5-5, claude-fable-5-2, claude-sonnet-5-5, claude-haiku-5-5
  • Gemini: gemini-4-carbon, gemini-4-hydrogen, gemini-4-neon
  • DeepSeek: deepseek-v4.1-flash, deepseek-v4-pro
  • Grok: grok-4.7

Gateway differentiation (curation policy Section 4)

  • Routing: models/llm/llm.py → _invoke accepts the optional fallback_model parameter. With quickrouter_api.py → route_completion, an eligible failure can switch the request to that model on the configured key. The plugin never replays a stream once it has yielded any chunk to Dify.
  • Resilience: quickrouter_api.py → route_completion applies the per-model max_retries setting (default 2, range 0–3). Transient gateway statuses and connection failures are retried with exponential backoff. quickrouter_api.py → retry_after_seconds handles delay seconds and HTTP dates. When the delay exceeds the remaining 10-second wait budget, the plugin returns the error without replaying early. HTTP 400, 401, and 403 stop immediately.
  • Metering: models/pricing.py → PricingCatalog caches the public price catalog in memory. models/pricing.py → usage_prices and models/llm/llm.py → usage_of apply the successful model's configured public group rate to the reported token counts and return USD unit prices and total in Dify's LLMUsage. Without a group override, the plugin selects the published group nearest multiplier 1.0. Unknown prices or a catalog failure produce zero cost fields. These estimates cover the successful response. The actual bill can include separate charges or failed attempts.

The archive keeps the controlled agent tag used on the previously reviewed package.

Risk level

  • Low risk
  • Medium risk
  • High risk

Required checks

  • I have read and followed the Marketplace submission requirements.
  • I have read and comply with the Plugin Development Guidelines.
  • I tested this plugin on Dify Community Edition and Dify Cloud, or documented any limitation below.
  • The package contains only files needed at runtime.
  • The package does not contain secrets, local credentials, .env files, .git directories, virtual environments, caches, logs, or IDE files.
  • The package does not contain executables or bundled binaries, or I explained why they are required below.
  • The plugin README includes setup steps, usage instructions, required APIs or credentials, connection requirements, and the source repository link.
  • The plugin includes PRIVACY.md or a hosted privacy policy, and manifest.yaml references it.
  • All user-facing text is primarily in English, with any localized README files following the i18n guidance.

Security and privacy notes

The plugin sends workflow inputs, tool data, and the API credential only to the fixed HTTPS inference host api.quickrouter.ai. A retry or an explicitly configured fallback can resend those inputs on the same key. The public price request only reaches quickrouter.ai and sends no credentials, prompts, model IDs, or group IDs. Redirects and environment proxies are disabled for both hosts. The plugin caches public rates in memory and omits credentials and response bodies from errors. It does not persist prompts or credentials. Dify controls execution of model-requested tools.

Local validation

  • 38 pytest tests passed in Python 3.12. Mock HTTP cases cover Retry-After, immediate authentication failure, fallback in non-streaming and streaming calls, interruption after the first chunk, pricing cache expiry, group selection, USD usage fields, and timeout degradation. See the recovery and metering tests.
  • Dify CLI v0.6.16 rebuilt quickrouter-0.0.1.difypkg. The unpacked provider loaded through the Dify SDK and exposed both recovery settings.
  • The Marketplace Toolkit found zero blocking findings. Gitleaks found no credentials in the source, package contents, or submitted description.

Reviewer notes

The package is unsigned. These checks used the Dify SDK and mocked requests. Dify Community Edition and Dify Cloud UI installation and paid inference were outside this validation. The estimates use public rates for the successful model and depend on the configured group. GPT presets still use Chat Completions, which does not expose GPT tool calling in this plugin.

@crazywoola

Copy link
Copy Markdown
Member

Thank you for submitting QuickRouter. Pre Check Plugin now passes, but the latest Governance run is blocked because manifest.yaml in yunsongmax/quickrouter/quickrouter-0.0.1.difypkg has no tags.

Please add 1–3 tags from the controlled vocabulary in docs/marketplace-curation-policy.md (choose one that the packaging CLI also accepts), rebuild the package, and push it so a fresh Governance run can pass. As this is a model gateway, please also briefly explain in the PR description which capabilities it adds beyond proxying (Section 4 of the same policy).

@YunSongMax

YunSongMax commented Dec 3, 2026 •

Copy link
Copy Markdown
Author

Thanks for the review, @crazywoola. I added the controlled agent tag, rebuilt and pushed the package in c792949, and documented the gateway’s routing, metering, and Dify workflow support under Section 4 in the PR description. The released CLI v0.6.16 rejects llm, while agent passes both the packager and the Marketplace tag check. All 16 unit tests pass, and the Toolkit reports zero blocking findings.

GitHub currently shows action_required for the new Governance and Pre Check runs. Could you approve the reruns when convenient?

@crazywoola

Copy link
Copy Markdown
Member

Thanks for adding the agent tag and documenting the gateway features. Pre Check Plugin and Governance now pass on this head.

I'm still holding the merge under marketplace curation policy §4: QuickRouter is a new OpenAI-compatible multi-model gateway. The capabilities described (catalog, streaming, tools, vision) are the usual Chat Completions surface; please point to where the plugin itself adds routing, metering, resilience, caching, evaluation or governance beyond forwarding to api.quickrouter.ai/v1, or extend it accordingly. I'll hold until then (or until a maintainer explicitly clears this PR).

@YunSongMax

YunSongMax commented Dec 5, 2026 •

Copy link
Copy Markdown
Author

Thanks for the guidance, @crazywoola. I rebuilt the 0.0.1 package with three plugin-level changes:

All 38 offline pytest tests pass, including the recovery and metering tests, and the Marketplace Toolkit reports zero blocking findings. Could you re-review the updated package for §4?

GitHub marks the new Pre Check Plugin and Governance runs as action_required. Could you also approve those runs?

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