Flock brings LLM and RAG capabilities directly into DuckDB SQL queries. If you have a question that isn’t answered here, open an issue on GitHub or email the team at amine.mhedhbi@polymtl.ca.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.
What versions of DuckDB does Flock support?
What versions of DuckDB does Flock support?
INSTALL flock FROM community is compiled for that version. If you are running an older DuckDB installation, upgrade it before loading Flock.Which LLM providers are supported?
Which LLM providers are supported?
| Provider | Models | Supports embeddings | Supports audio |
|---|---|---|---|
| OpenAI | GPT-4o, GPT-4, GPT-3.5, text-embedding-* | Yes | Yes |
| Azure OpenAI | Same model family via Azure endpoints | Yes | Yes |
| Ollama | Any model served locally (LLaMA, Mistral, etc.) | Yes | No |
| Anthropic | Claude 3 family (Haiku, Sonnet, Opus) | No | No |
CREATE MODEL declares its own provider.How do I install Flock without internet access?
How do I install Flock without internet access?
INSTALL flock FROM community) requires network access. To install without internet access, build Flock from source on a machine that has the necessary dependencies, then copy the resulting binary to your air-gapped environment.build/release/duckdb. Copy that binary to your air-gapped environment and run it directly — no extension loading step is required.See the developer guide for full build instructions.Can I use Flock in Jupyter notebooks?
Can I use Flock in Jupyter notebooks?
duckdb package). Install Flock once inside a notebook cell and it persists for the session:llm_complete, llm_filter, llm_embedding, llm_reduce, llm_rerank — are accessible through the Python client just like any other SQL expression.Does Flock work in the browser?
Does Flock work in the browser?
libcurl dependency (which is unavailable in the browser sandbox) and uses the browser’s native fetch API instead.This makes it possible to build client-side demos, interactive notebooks, or data apps powered by Flock with zero backend setup. See the repository for details on the WASM build configuration (-DEMSCRIPTEN=1).How do I handle rate limits from my LLM provider?
How do I handle rate limits from my LLM provider?
- Lower
batch_sizeon the model: smaller batches mean fewer concurrent requests per query. - Use a model with a higher rate limit tier — for example, an Azure deployment often has higher per-minute token quotas than the shared OpenAI API.
- Use Ollama for development — local inference has no rate limits.
LIMIT/OFFSET or by filtering with a WHERE clause.What is batch_size and how does it affect performance?
What is batch_size and how does it affect performance?
batch_size controls how many rows Flock sends to the LLM provider in a single API call. Flock formats multiple rows into a single prompt (or parallel requests, depending on the function), and batch_size caps how many rows are included at once.- Higher
batch_size→ fewer API calls, lower latency for large tables, but higher per-request token usage and greater risk of exceeding the model’s context window. - Lower
batch_size→ more API calls, more predictable token usage per call, reduced risk of context overflow.
batch_size for system models is 10. You can override it when creating a custom model:batch_size. If queries are slow on large tables and you have a high token quota, increase it.Can I use multiple providers in the same query?
Can I use multiple providers in the same query?
What is the difference between llm_rerank and llm_reduce?
What is the difference between llm_rerank and llm_reduce?
llm_rerankreorders the rows in a group by semantic relevance to a query or criterion. It returns the same rows in a new order, scored by the LLM. Use it when you want the most relevant documents surfaced to the top of a result set.llm_reducecollapses multiple rows into a single output by applying an LLM prompt across the group. Use it for tasks like summarization, consensus extraction, or aggregating multiple text snippets into one answer.
How does structured output work with Anthropic/Claude?
How does structured output work with Anthropic/Claude?
- Claude 4.x models (e.g.,
claude-sonnet-4-5) use the nativeoutput_formatAPI, which enforces schema compliance. - Claude 3.x models (e.g.,
claude-3-5-sonnet-20241022) fall back totool_useto produce structured JSON.
model_parameters:llm_embedding). Use OpenAI, Azure, or Ollama for embedding tasks.Can I run Flock on Windows?
Can I run Flock on Windows?
INSTALL flock FROM community) provides pre-built binaries for all three platforms.To build from source on Windows, you need:- CMake 3.5+
- MSVC (Visual Studio 2019 or later) or a MinGW-based GCC toolchain
- Ninja or MSBuild
- Git with submodule support
build_and_run.sh script is Bash-based and requires Git Bash or WSL on Windows. Alternatively, you can run the CMake commands manually from a Developer Command Prompt.What tuple_format options are available, and when should I use each?
What tuple_format options are available, and when should I use each?
tuple_format controls how Flock serializes multiple rows into a single prompt when batch_size > 1. It is a model-level setting you can configure via CREATE MODEL or UPDATE MODEL.| Format | Description | Best for |
|---|---|---|
JSON | Rows serialized as a JSON array of objects | Structured data, models that handle JSON well |
XML | Rows wrapped in XML tags (default) | General-purpose; clear row boundaries |
Markdown | Rows rendered as a Markdown table | Readable prompts, tabular data |
XML. For most use cases the default works well; switch to JSON or Markdown if the model handles those formats better for your task.How are API keys stored and secured?
How are API keys stored and secured?
~/.duckdb/stored_secrets/) with restricted file permissions. Use DROP SECRET to remove a key, and FROM duckdb_secrets() to list what is currently configured.What is the difference between local and global models?
What is the difference between local and global models?
- Local (default) — the model is stored in the current database only. It is not visible when connecting to a different database.
- Global — the model is available across all databases in the session. Use
CREATE GLOBAL MODELto create one, or promote an existing model withUPDATE MODEL 'name' TO GLOBAL.