Skip to content

feat(assistant): can use cloudflare for assistant - #1421

Closed
Barbapapazes wants to merge 2 commits into
nuxt-content:mainfrom
Barbapapazes:feat/cloudflare
Closed

feat(assistant): can use cloudflare for assistant#1421
Barbapapazes wants to merge 2 commits into
nuxt-content:mainfrom
Barbapapazes:feat/cloudflare

Conversation

@Barbapapazes

Copy link
Copy Markdown
Contributor

Hello 👋,

This PR add support for the Cloudflare AI Gateway in the Docus Assistant module. It update the default model to workers-ai/@cf/zai-org/glm-4.7-flash when using the Cloudflare provider, and adds the necessary configuration options for the Cloudflare AI Gateway. Everything is configured via environment variables, and the module will automatically use the correct model based on the selected provider.

The backward compatibility is maintained, and the Vercel provider remains the default for users who do not specify a provider.

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

@Barbapapazes is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Aug 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/create-docus@1421
npm i https://pkg.pr.new/docus@1421

commit: 8ddef0f

Comment thread layer/modules/assistant/runtime/server/api/search.ts Outdated
Comment thread docs/content/fr/4.ai/1.assistant.md Outdated
Comment thread docs/content/en/4.ai/1.assistant.md Outdated
Co-authored-by: Estéban <esteban.soubiran@insa-cvl.fr>
@Barbapapazes Barbapapazes changed the title feat: can use cloudflare for assistant feat(assistant): can use cloudflare for assistant Aug 18, 2026
@larbish

larbish commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Hey @Barbapapazes, thanks for this PR. I'd rather not add Cloudflare as a first-class provider in core though: it doesn't scale to the next provider request.

I went with generic primitives instead (#1414): docus.assistant.enabled+ an auto-imported assistantSearchHandler(event, { model, systemPrompt, providerOptions }).

Cloudflare can then lives in user-land:

// server/api/assistant.ts
import { createAiGateway } from 'ai-gateway-provider'
import { createUnified } from 'ai-gateway-provider/providers/unified'

const gateway = createAiGateway({ accountId, gateway: gatewayId, apiKey })

export default defineEventHandler(event => assistantSearchHandler(event, {
  model: gateway(createUnified()('workers-ai/@cf/zai-org/glm-4.7-flash'))
}))

Can you ensure it fits your needs? 🙏

Closing in favor of #1427

@larbish larbish closed this Aug 25, 2026
@Barbapapazes

Copy link
Copy Markdown
Contributor Author

Hey @larbish,

Yes, that makes sense and I prefer the idea of having a generic way to allow anyone to set up the provider that fits their needs. I'll try it in a couple of days but from what I can read, it fits my needs 🙇‍♂️

Thanks 💯

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