Flock as a DuckDB extension is designed to simplify the integration of Large Language Models (LLMs) into your data workflows. This guide will help you get started with Flock, covering installation, setup, and basic usage.

Installation

Install DuckDB and load Flock from the community catalog — see Installation. For tuning batch size, concurrency, and cost on LLM queries, see Performance and cost.

Build from Source

If you want to build Flock from source or contribute to the project, you can use our automated build script:
  1. Clone the repository with submodules:
    Or if you’ve already cloned without submodules:
  2. Run the build and run script:
    This interactive script will guide you through:
    • Checking prerequisites (CMake, build tools, compilers)
    • Setting up vcpkg (dependency manager)
    • Building the project (Debug or Release mode)
    • Running DuckDB with the Flock extension
    The script automatically detects your system configuration and uses the appropriate build tools (Ninja or Make).
  3. The script will launch DuckDB with the Flock extension ready to use. See the home page for an overview and the function docs for usage examples.
Requirements for building from source:
  • CMake (3.5 or later)
  • C++ compiler (GCC, Clang, or MSVC)
  • Build system (Ninja or Make)
  • Git
  • Python 3 (optional, for integration tests)
Note: The build script will handle most of the setup automatically, including vcpkg configuration and dependency management.

Set Up API Keys for Providers

To use Flock functions, you need to set up API keys for the providers you plan to use. Flock supports multiple providers such as OpenAI, Azure, Ollama, and Anthropic/Claude. Refer to the following sections for detailed instructions on setting up API keys for each provider.

Azure

Set up Flock with Azure.

Ollama

Set up Flock with Ollama.

OpenAI

Set up Flock with OpenAI.

Anthropic / Claude

Set up Flock with Anthropic / Claude.