Split your configuration into multiple files
As your project grows in complexity, it might be a good idea to split your configuration into multiple files. This makes it easier to manage and maintain your configuration. For example, you can create separate TOML files for different projects, environments, and so on. You can also move deprecated entries like functions to a separate file. You can instruct TensorZero Gateway to load multiple configuration files by specifying a glob pattern that matches all the relevant TOML files by setting the CLI flag--config-path path/to/**/*.toml.
Under the hood, TensorZero will concatenate the configuration files, with special handling for paths.
For example, you can declare a model in one file and use it in a variant declared in another file.
If the configuration includes a path (e.g. template, schema), the path will be resolved relative to that configuration file’s directory.
For example:
Enable template file system access to reuse shared snippets
You can decompose your templates into smaller, reusable snippets. This makes it easier to maintain and reuse code across multiple templates. Templates can reference other templates using the MiniJinja directives{% include %} and {% import %}.
To use these directives, set gateway.template_filesystem_access.base_path in your configuration file.
By default, file system access is disabled for security reasons, since template imports are evaluated dynamically and could potentially access sensitive files.
You should ensure that only trusted templates are allowed access to the file system.
base_path.
If base_path itself is relative, it’s relative to the configuration file in which it’s defined.