Tablepilot can use an optional TOML configuration file. You can specify a custom config file using the --config flag.
For experimental image generation and editing, see this example for details.
The configuration consists of following sections:
- source_data_dir: The root search dir for CSV source
pathsfield and List sourcefilefield. Default "./".
[common]
source_data_dir = "./data"- driver: Specifies the database driver (e.g.,
"sqlite3"). - dsn: The data source name (DSN) for the database connection.
[database]
driver = "sqlite3"
dsn = "data.db?_pragma=foreign_keys(1)"You can define multiple providers, and different models can use different providers.
- name: The name of the provider. This name is referenced in the
modelssection to select which provider the model uses. - type: The provider type. Currently supported values are OpenAI, Gemini, Anthropic, OpenRouter and OpenAI-Compatible.
- key: The API key used to authenticate requests.
- base_url: The base URL of the API. only required for OpenAI-Compatible type provider.
[[providers]]
name = "gemini"
type = "Gemini"
key = "your_api_key"
[[providers]]
name = "openai"
type = "Openai"
key = "your_api_key"
[[providers]]
name = "open-router"
type = "OpenAI-Compatible"
key = "your_api_key"
base_url = "https://openrouter.ai/api/v1"This section configures the API server when running tablepilot serve.
- address: TCP network address. Used in
http.ListenAndServe. Default:8083.
[server]
address = ":8088"You can define multiple models and assign them to different providers or different generations.
- model: The name of the model as used in the LLM API (e.g.,
"gemini-2.0-flash-001"). - alias: An alias for the model (e.g.,
"gemini-pro"). This allows you to upgrade the model without changing the alias in the table JSON schema, making it easier to manage. Optional. - provider: The name of the provider to be used for this model (must match a name from the
providerssection). - default: Set to
trueif this is the default model. Only one model can be set asdefault. If no model is marked asdefault, the first model in the list will be used. The default model is used when no specific model is provided in the table JSON schema or the--modelflag. Optional. - max_tokens: The maximum number of tokens that can be generated in the chat completion (default 6000). Optional.
- rpm: The rate limit for this model, specified in requests per minute. This is used to control the rate of API calls and enforce a model-specific rate limiter (default no limit). Optional.
- image: Indicates whether the model supports native image generation (e.g., GPT-4o or Gemini 2.0 Flash Exp). Tablepilot's image generation feature requires this native capability. If set to
true, the model will be selectable for image generation in the WebUI and desktop app. Defaults tofalse.
Important: All models must support Structured Outputs.
[[models]]
model = "gemini-2.0-flash-001"
provider = "gemini"
rpm = 20
[[models]]
model = "gpt-4o"
provider = "openai"
rpm = 5