Skip to content

feat: add Cloudflare Workers AI model provider plugin (puspoaditya) - #2927

Open
puspoaditya wants to merge 40 commits into
langgenius:mainfrom
puspoaditya:add-cloudflare-workers-ai-plugin
Open

feat: add Cloudflare Workers AI model provider plugin (puspoaditya)#2927
puspoaditya wants to merge 40 commits into
langgenius:mainfrom
puspoaditya:add-cloudflare-workers-ai-plugin

Conversation

@puspoaditya

@puspoaditya puspoaditya commented Aug 20, 2026

Copy link
Copy Markdown

Plugin Submission

Plugin information

Submission type

  • New plugin
  • Version update

What changed

Adds Cloudflare Workers AI as a model provider for Dify — serverless inference over Cloudflare's open-model catalog (Llama 3.3 70B FP8, Llama 3.1 8B, Llama 4 Scout 17B, Qwen 2.5 Coder 32B, DeepSeek R1 Distill Qwen 32B) with a generous free tier.

  • OpenAI-compatible endpoint (/client/v4/accounts/{account_id}/ai/v1) — full chat, streaming, and tool calls verified
  • Dedicated Account ID credential field — no manual endpoint URL or raw model IDs (unlike the generic OpenAI-compatible provider)
  • Pre-filled model catalog with pricing
  • Tested live on Dify Community Edition: 5/5 models respond, tool calls flow through the agent pipeline correctly

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 Developer Agreement.
  • 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.

Testing notes

  • Tested on Dify Community Edition (Docker) with FORCE_VERIFYING_SIGNATURE=false for the unsigned community package.
  • Verified: Llama 3.3 70B FP8, Infire Llama 3.1 8B, Llama 4 Scout, Qwen 2.5 Coder 32B, DeepSeek R1 Distill — all respond correctly; Llama 3.3 tool calls reach Dify's agent pipeline (finish_reason: tool_calls).
  • Note: @cf/meta/llama-3.1-8b-instruct is deprecated upstream (2026-05) — replaced with @cf/meta/infire-llama-3.1-8b-instruct.

Security and privacy notes

None. This plugin only sends chat completion requests to the Cloudflare Workers AI API using the account's own API token (CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID). It does not execute code, access local files, or fetch arbitrary URLs. See PRIVACY.md for the privacy policy.

Local validation

  • uv run pytest — 2 tests passed (endpoint URL construction, Account ID requirement)
  • Installed the .difypkg on Dify Community Edition (Docker, FORCE_VERIFYING_SIGNATURE=false) — provider listed as Ready
  • All 5 models responded live: @cf/meta/llama-3.3-70b-instruct-fp8-fast, @cf/meta/infire-llama-3.1-8b-instruct, @cf/meta/llama-4-scout-17b-16e-instruct, @cf/qwen/qwen2.5-coder-32b-instruct, @cf/deepseek-ai/deepseek-r1-distill-qwen-32b
  • Tool calls verified: Llama 3.3 70B and Llama 4 Scout returned finish_reason: tool_calls (code interpreter), and Dify's agent_thought displayed the executed tool result

@github-actions github-actions Bot added the risk: low Low-risk Marketplace submission label Aug 20, 2026
@crazywoola

Copy link
Copy Markdown
Member

Please submit a package only

@puspoaditya

Copy link
Copy Markdown
Author

Updated the PR to match the current marketplace validator: it now contains exactly one filepuspoaditya/cloudflare_workers_ai.difypkg (the validator requires a single .difypkg change per PR; source, README, and privacy policy are all inside the package).

The pre-check runs are waiting for approval (action_required) — could you approve them so the checks can run? Thanks!

@puspoaditya

Copy link
Copy Markdown
Author

Fixed all pre-check findings: manifest now includes privacy, repo, contact (and recommended meta.minimum_dify_version); PR body now has the required Security and privacy notes and Local validation sections; the .difypkg was rebuilt and re-uploaded. Could you approve the re-run? Thanks!

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

Labels

risk: low Low-risk Marketplace submission

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants