Parameters for the Ollama plugin configuration.

interface OllamaPluginParams {
    embedders?: EmbeddingModelDefinition[];
    models?: ModelDefinition[];
    requestHeaders?: RequestHeaders;
    serverAddress: string;
}

Properties

embedders?: EmbeddingModelDefinition[]

Array of embedding models to be defined.

const ai = genkit({
plugins: [
ollama({
serverAddress: 'http://localhost:11434',
embedders: [{ name: 'nomic-embed-text', dimensions: 768 }],
}),
],
});
models?: ModelDefinition[]

Array of models to be defined.

const ai = genkit({
plugins: [
ollama({
models: [{ name: 'gemma' }],
serverAddress: 'http://127.0.0.1:11434', // default local address
}),
],
});
requestHeaders?: RequestHeaders

Optional request headers, which can be either static or dynamically generated.

const ai = genkit({
plugins: [
ollama({
models: [...],
serverAddress: 'https://my-deployment.server.address',
requestHeaders: async (params) => {
const headers = await fetchAuthHeaders(params.serverAddress);
return { Authorization: headers['Authorization'] };
},
}),
],
});
serverAddress: string

The address of the Ollama server.