Skip to main content

Connect to an External ClickHouse Database

LangSmith uses ClickHouse as the primary data store for traces and feedback. By default, LangSmith Self-Hosted will use an internal ClickHouse database that is bundled with the LangSmith instance.

However, you can configure LangSmith to use an external ClickHouse database. By configuring an external ClickHouse database, you can manage backups, scaling, and other operational tasks for your database. Unfortunately, many cloud providers do not offer managed ClickHouse services at this time. Instead, you can run ClickHouse in a few ways:

Requirements

  • A provisioned ClickHouse Instance that your LangSmith instance will have network access to.
  • A user with admin access to the ClickHouse database. This user will be used to create the necessary tables, indexes, and views
  • Note: We only officially support ClickHouse versions >= 23. We also only support standalone ClickHouse (not clustered or replicated) or ClickHouse Cloud.

Parameters

You will need to provide several parameters to your LangSmith installation to configure an external ClickHouse database. These parameters include:

  • Host
  • HTTP Port
  • Native Port
  • Database
  • Username
  • Password

Configuration

With these parameters in hand, you can configure your LangSmith instance to use the provisioned ClickHouse database. You can do this by modifying the config.yaml file for your LangSmith Helm Chart installation or the .env file for your Docker installation.


clickhouse:
external:
enabled: true
host: "host"
port: "http port"
nativePort: "native port"
user: "default"
password: "password"
database: "default"
tls: false

Once configured, you should be able to reinstall your LangSmith instance. If everything is configured correctly, your LangSmith instance should now be using your external ClickHouse database.


Was this page helpful?


You can leave detailed feedback on GitHub.