Getting Started

Install Nuxt AI Kit

Last updated by Harlan Wilton in feat: migrate to nuxt-ai-kit.
Early Access: Known bugs and breaking changes expected. APIs may change between releases.

Setup Module

Not sure what Nuxt AI Kit is? Check out the introduction.

bash
npx nuxt module add ai-kit

License

Nuxt AI Kit requires a Nuxt SEO Pro license.

NUXT_SEO_PRO_KEY=your-license-key-here

Sign in to see your license key.

Embedding Providers

Local (Default)

Uses transformers.js with @huggingface/transformers. No setup required—model downloads automatically on first build.

pnpm add @built-in-ai/transformers-js

OpenAI

pnpm add openai
nuxt.config.ts
export default defineNuxtConfig({
  aiKit: {
    embeddings: {
      model: 'text-embedding-3-small',
      buildProvider: {
        preset: 'openai',
        apiKey: process.env.OPENAI_API_KEY
      }
    }
  }
})

Ollama

No package needed. Uses HTTP API to your local Ollama server.

nuxt.config.ts
export default defineNuxtConfig({
  aiKit: {
    embeddings: {
      model: 'nomic-embed-text',
      buildProvider: {
        preset: 'ollama'
      }
    }
  }
})

Testing

Build your site:

pnpm generate

Check the vector database was created:

ls -la .data/ai-kit/
# embeddings.db should exist

Start the preview server and test the API:

pnpm preview
curl -X POST http://localhost:3000/api/search \
  -H "Content-Type: application/json" \
  -d '{"query": "getting started", "limit": 5}'

You should get a JSON response with search results.

Next Steps

Did this page help you?