Integrations

Integrations

Vercel AI SDK

Use MaxModel verified output as a Vercel AI SDK middleware. Wrap any model; when a call passes sources, you get a grounded answer with verbatim citations — otherwise it passes through unchanged. The middleware never calls an LLM itself, so determinism is preserved.

npm i @maxmodel/vercel-provider ai
import { generateText, wrapLanguageModel } from 'ai'
import { openai } from '@ai-sdk/openai'
import { verifiedMiddleware } from '@maxmodel/vercel-provider'
 
const model = wrapLanguageModel({
  model: openai('gpt-5'),
  middleware: verifiedMiddleware({ apiKey: process.env.MAXMODEL_KEY! }),
})
 
const { text, providerMetadata } = await generateText({
  model,
  prompt: 'What is our refund policy?',
  providerOptions: {
    maxmodel: { sources: [{ id: 'refunds.md', text: 'Full refunds within 30 days.' }] },
  },
})
 
providerMetadata.maxmodel.citations   // verbatim quotes + char ranges
providerMetadata.maxmodel.coverage    // deterministic grounded share

Drop-in: change the base URL

MaxModel is OpenAI-compatible. For plain (non-verified) gateway calls, point the OpenAI SDK at https://api.maxmodel.com — one line, no new dependency:

import OpenAI from 'openai'
const client = new OpenAI({ apiKey: process.env.MAXMODEL_KEY, baseURL: 'https://api.maxmodel.com/v1' })

Then upgrade the calls you want grounded to mx.verified.create({ ..., sources }) via the maxmodel SDK.

CI quality gate (GitHub Action)

Gate pull requests on deterministic groundedness with the published action maxmodel-docs/groundedness-gate. It runs verified.eval over a dataset and fails the PR when coverage_mean drops below your threshold — same score every run, so it’s a gate you can trust.

# .github/workflows/groundedness.yml
name: Groundedness
on: [pull_request]
jobs:
  gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: maxmodel-docs/groundedness-gate@v1
        with:
          api-key: ${{ secrets.MAXMODEL_KEY }}
          dataset: eval/dataset.json   # { "cases": [ { "messages": [...], "sources": [...] }, ... ] }
          model: gpt-5
          min-coverage: '0.8'

Dataset format and inputs: see the action README and the Eval page.