Configure

Fastagent is currently built to be used as a CLI tool and specifically with a configuration file called fastagent.toml.

Why should I use a configuration file ?

Using a configuration file has a big advantage over just a flag, it allows you to add it to your vcs and share it with other people. Since the goal of this project is to be accessible and easy to get started with, we decided to focus on this aspect.

This is the most complete configuration that is currently supported:

[project]
name = "my-first-application"
framework = "langchain"
app = "myapplication.app:chain"

[security]
authentication="stateful-postgresql" # Only supported value
# Be careful not to add this file to your vcs.
ssl_cert = ".ssl/server.crt"
sll_key = ".ssl/server.key"

[storage]
database="postgresql" # Only supported value
host="ep-frosty-mouse-a2xeqwr.eu-central-1.aws.neon.tech"
port="5432"

[server]
port = 8000
host = "127.0.0.1"
workers = 1
logging = true
log_level = "info"

Project Configuration

The project section defines your application's core settings. The name field identifies your application. The framework specifies which AI framework you're using (currently only "langchain" is supported). The app field points to your application's entry point using the format "module:variable" (e.g., "myapplication.app:chain").

Security Configuration

Security settings handle authentication and SSL configuration. The authentication field is set to "stateful-postgresql", which implements token-based authentication with PostgreSQL storage. Tokens expire after a set time period. The ssl_cert and ssl_key fields specify the paths to your SSL certificate and private key files for secure communications.

Storage Configuration

The storage section configures your database connection. Currently, FastAgent only supports PostgreSQL as the database backend. You'll need to specify your database host URL and port number. This database stores authentication tokens and user information required for the authentication system.

Server Configuration

Server settings control how your FastAgent application runs. The port and host fields determine where your server listens for connections. workers sets the number of Granian server workers to handle requests. logging enables or disables logging, while log_level sets the detail level of logs ("info", "debug", "warning", or "error").

Last updated