Getting Started With Flock
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.
Install DuckDB
To install Duckdb, it's an easy process you need just to visit DuckDB Installation Page and choose the installation options that represent your environment, by specifying:
- Version: Stable or Preview.
- Environment: CLI, Python, R, etc.
- Platform: Linux, MacOS or Windows.
- Download Method: Direct or Package Manager.
After installing DuckDB, you can verify the installation and get started by following the DuckDB CLI Overview.
Install Flock Extension
At this stage you should have a running DuckDB instance. Flock can be installed in two ways:
Option 1: Install from Community Extension (Recommended)
To install Flock from DuckDB's community catalog, run the following SQL commands in your DuckDB instance:
INSTALL
flock FROM community;
LOAD
flock;
This will install the Flock extension and load it into your DuckDB environment.
Option 2: Build from Source
If you want to build Flock from source or contribute to the project, you can use our automated build script:
-
Clone the repository with submodules:
git clone --recursive https://github.com/dais-polymtl/flock.git
cd flockOr if you've already cloned without submodules:
git submodule update --init --recursive -
Run the build and run script:
./scripts/build_and_run.shThis 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).
-
The script will launch DuckDB with the Flock extension ready to use. Make sure to check the documentation 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, and Ollama.
Refer to the following sections for detailed instructions on setting up API keys for each provider.