GitHub - ollama/ollama-js: Ollama JavaScript library
Ollama JavaScript Library
The Ollama JavaScript library provides the easiest way to integrate your JavaScript project with Ollama.
Getting Started
Usage
import ollama from 'ollama'
const response = await ollama.chat({
model: 'llama2',
messages: [{ role: 'user', content: 'Why is the sky blue?' }],
})
console.log(response.message.content)
Browser Usage
To use the library without node, import the browser module.
import ollama from 'ollama/browser'
Streaming responses
Response streaming can be enabl...
Read more at github.com