genkitx-ollama
v1.44.0
Published
Genkit AI framework plugin for Ollama APIs.
Readme
Ollama plugin for Genkit
See official documentation for more.
Building with a coding agent? Install the Genkit JS skill first.
npx skills add genkit-ai/skills --skill developing-genkit-jsIt teaches your agent the current Genkit JS APIs and common gotchas. Source, manual install and skills for other languages: genkit-ai/skills.
Installing the plugin
npm i --save genkitx-ollamaUsing the plugin
import { genkit } from 'genkit';
import { ollama } from 'genkitx-ollama';
const ai = genkit({
plugins: [
ollama({
models: [{ name: 'gemma' }],
serverAddress: 'http://127.0.0.1:11434', // default local address
}),
],
});
async function main() {
const { text } = await ai.generate({
prompt: 'hi Gemini!',
model: 'ollama/gemma',
});
console.log(text);
}
main();The sources for this package are in the main Genkit repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Genkit documentation.
License: Apache 2.0
