[READ-ONLY] Mirror of https://github.com/thoda-dev/nuxt-ollama. Simple integration of the official Ollama JavaScript Library for your Nuxt application.
0

Configure Feed

Select the types of activity you want to include in your feed.

TypeScript 66.8%
Vue 27.7%
JavaScript 5.5%
134 9 46

Clone this repository

https://tangled.org/thoda.dev/nuxt-ollama https://tangled.org/did:plc:tj525jtqpgzobdggjgt3bcwr
git@tangled.org:thoda.dev/nuxt-ollama git@tangled.org:did:plc:tj525jtqpgzobdggjgt3bcwr

For self-hosted knots, clone URLs may differ based on your setup.



README.md

Nuxt Ollama#

npm version npm downloads License Nuxt

Simple integration of the official Ollama JavaScript Library for your Nuxt application.

You have to install Ollama to use this module. See Official Website to download it for your system.

Quick Setup#

Install the module to your Nuxt application with one command:

  • using npm
npx nuxi module add nuxt-ollama

  • using pnpm
pnpx nuxi module add nuxt-ollama

That's it! You can now use Nuxt Ollama in your Nuxt app ✨

Features#

  • Vue 3 composable
  • Server utils

Usage#

Usage on pages or server side:

const ollama = useOllama()

const response = await ollama.chat({
  model: 'gpt-oss:120b',
  messages: [{ role: 'user', content: 'Why is the sky blue?' }],
})
console.log(response.message.content)

See documentation for more information or examples.

Settings#

Local models#

// nuxt.config.ts
export default defineNuxtConfig({
  //...
  ollama: {
    protocol: 'http', // or 'https'
    host: 'localhost', //domain or ip address
    port: 11434, // port
    proxy: false, // use proxy
  }
})

- Cloud models with API key on https://ollama.com#

// nuxt.config.ts
export default defineNuxtConfig({
  //...
  ollama: {
    protocol: 'https', // or 'https'
    host: 'ollama.com', //domain or ip address
    api_key: 'your_api_key_here' // your Ollama API key
  }
})

Contribution#

Contributions are welcome, feel free to open an issue or submit a pull request!

Please see the contributing guide for details.

Local development
# Install dependencies
pnpm install

# Generate type stubs
pnpm run dev:prepare

# Develop with the playground
pnpm run dev