Skip to content

Support custom AI SDK providers without requiring Vercel AI Gateway #1414

Description

@remihuigen

The Docus assistant currently requires either AI_GATEWAY_API_KEY or VERCEL_OIDC_TOKEN to be present at build time.

This makes sense when using Vercel AI Gateway, but also hard-couples the assistant module's enablement to Gateway authentication.

I'd like to use the existing Docus assistant with @ai-sdk/mistral and connect directly to the Mistral API using createMistral(). The rest of the assistant architecture already appears provider-agnostic and built on the AI SDK.

Proposed solution

Add an explicit enabled option to the assistant configuration:

export default defineNuxtConfig({
  docus: {
    assistant: {
      enabled: true,
    },
  },
})

When explicitly enabled, Docus would register the assistant components and API path without requiring AI_GATEWAY_API_KEY or VERCEL_OIDC_TOKEN.

Vercel AI Gateway could remain the default and recommended setup.

This would provide an escape hatch for users who want to supply or override the server handler with their own AI SDK implementation and provider.

Current workaround

My current plan is to provide a dummy AI_GATEWAY_API_KEY so the module is enabled, then override the assistant server route locally with an AI SDK implementation using createMistral().

This should work, but relying on a fake Gateway credential to enable a provider-agnostic AI SDK implementation feels unnecessary.

Additional context

I'm not proposing that Docus needs to add first-class configuration for every AI SDK provider.

An explicit way to enable the assistant without Gateway authentication would be enough to support custom provider implementations while keeping the current Gateway experience as the default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions