Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dais-polymtl/flock/llms.txt

Use this file to discover all available pages before exploring further.

Ollama lets you run open-weight models locally without any external API calls or API keys. Flock connects to your local Ollama instance over HTTP, so queries stay entirely on your machine. This makes Ollama a good choice for development, offline use, or privacy-sensitive workloads. Both text completion and vision models are supported.

Prerequisites

Before configuring Flock, you need Ollama installed and running with at least one model downloaded:
  1. Install Ollama — download from ollama.com/download
  2. Pull a model — for example: ollama pull llama3.2
  3. Confirm Ollama is running — the default address is 127.0.0.1:11434
Make sure Flock is installed and loaded before continuing — see the Quickstart if you haven’t done that yet.

Configure your secret

Ollama does not require an API key. You only need to tell Flock where Ollama is listening:
CREATE SECRET (
    TYPE ollama,
    API_URL '127.0.0.1:11434'
);
The API_URL field is required and must point to your running Ollama instance. If you’re running Ollama on a different host or port, update the URL accordingly.
If you change the Ollama port with the OLLAMA_HOST environment variable, update API_URL here to match.

Create a model

Register a named model in Flock using the exact model name you pulled with Ollama:
CREATE MODEL(
    'QuackingModel',
    'llama3.2',
    'ollama',
    {"tuple_format": "json", "batch_size": 32, "model_parameters": {"temperature": 0.7}}
);
The four arguments are:
ArgumentDescription
'QuackingModel'Unique name you reference in queries
'llama3.2'Ollama model name (must be already pulled)
'ollama'Provider name
{...}Config: batch size, tuple format, and model parameters
The model name must exactly match what you pulled with ollama pull. Run ollama list to see all downloaded models on your system.

Run a query

With your secret and model in place, call llm_complete:
SELECT llm_complete(
    {'model_name': 'QuackingModel'},
    {'prompt': 'Write a short poem about a database.'}
);
To use column data as context:
SELECT llm_complete(
    {'model_name': 'QuackingModel'},
    {
        'prompt': 'Classify the topic of this article: {article}',
        'context_columns': [{'data': article_text, 'name': 'article'}]
    }
) AS topic
FROM articles;

Supported model types

Any Ollama text/chat model works with llm_complete, llm_filter, and aggregate functions. Popular choices include:
ModelPull command
Llama 3.2 (3B)ollama pull llama3.2
Llama 3.1 (8B)ollama pull llama3.1
Mistral 7Bollama pull mistral
Gemma 2 (9B)ollama pull gemma2
Phi-3 Miniollama pull phi3
See the full catalog at ollama.com/library.

Next steps

Image support

Analyze images with vision models in SQL queries

Scalar functions

Full reference for llm_complete, llm_filter, llm_embedding, and more

Build docs developers (and LLMs) love