genai.ini#
As genai is a containerized service, the configuration does not rely on providing a genai.ini file. Instead, the configuration is provided through environment variables that are made available to the container.
Notes for administrators
A
/etc/squirro/genai.inifile exists in most Squirro deployments, but it should not be used to configure the service.Version 3.13.0 includes breaking changes that may require adjustments if you are upgrading from an earlier version. Learn more
Environment variables allow you to customize how the GenAI Docker image behaves and connects to external services. Some of these variables are mandatory. If they are not set or are misconfigured, the service may fail to start or function correctly. For the variables that limit the resources of Squirro Neo, see the Resource Limits for Squirro Neo section.
Variable Name |
Type |
Required |
Description |
Example Value |
|---|---|---|---|---|
SQ_DATABASE_URL |
string |
Yes |
Database URL for the GenAI service (supports pymysql, psycopg2 and sqlite connectors). |
|
SQ_TOPIC_API_ENDPOINT |
string |
Yes |
Endpoint for the Squirro topic API. |
|
SQ_USER_API_ENDPOINT |
string |
Yes |
Endpoint for the Squirro user API. |
|
SQ_USER_SERVICE_CLIENT_ID |
string |
Yes |
Value of the genai.client_id configuration in the [clients] section of the Squirro platform user.ini. Required to run query processing. |
|
SQ_USER_SERVICE_CLIENT_SECRET |
string |
Yes |
Value of the genai.client_secret configuration in the [clients] section of the Squirro platform user.ini. Required to run query processing. |
|
SQ_CLUSTER |
string |
Yes (for remote clusters) |
Fallback Squirro cluster URL, used if it is not specified in the request. Default value is http://localhost. |
|
SQ_SECURITY_WORKSPACES |
boolean |
No |
Value of the |
|
SQ_DECRYPT_COMMAND |
string |
No |
Path to the command that resolves the |
|
SQ_LOG_LEVEL |
string |
No |
Log level for the |
|
SQ_CA_FILE |
string |
No |
Path to file containing certificates that should be added to the container. |
|
SQ_DATABASE_SSL_CA |
string |
No |
Path to file containing certificates that should be added to the database connection (alternative to setting the file in |
|
SQ_REDIS_CACHE_HOST |
string |
No |
Redis server host used for caching (if not specified, some caching may not be performed). |
|
SQ_REDIS_CACHE_PORT |
int |
No |
(see above) |
|
SQ_REDIS_CACHE_PASSWORD |
string |
No |
(see above) |
|
SQ_REDIS_CACHE_DB |
int |
No |
(see above) |
|
SQ_INDEX_SEARCH_INDEX_SERVERS |
string |
No |
Comma-separated URLs of the Squirro search engine. Conversation search is on when this is set and GenAI’s search credential is usable. See Conversation Search Operations. |
|
SQ_INDEX_SEARCH_ENGINE |
string |
No |
The search engine type, |
|
SQ_INDEX_SEARCH_PEM_PATH |
string |
No |
Path of the CA certificate file that GenAI uses to verify the search engine. |
|
SQ_INDEX_SEARCH_VERIFY_CERTS |
bool |
No |
Whether GenAI verifies the certificate of the search engine. Defaults to |
|
SQ_INDEX_SEARCH_AUTH_USER, SQ_INDEX_SEARCH_AUTH_PASSWORD |
string |
No |
GenAI’s own search engine user, the |
|
SQ_INDEX_SEARCH_INDEX_NAME_PREFIX |
string |
No |
The |
|
SQ_NEO_CONVERSATION_SEARCH_BACKEND |
string |
No |
|
|
SQ_NEO_CONVERSATION_SEARCH_THREADS |
int |
No |
How many conversation searches one GenAI pod runs at once. One more search answers 503 |
|
SQ_NEO_CROSS_POD_ENABLED |
boolean |
No |
Lets the GenAI service instances of a deployment coordinate Squirro Neo work through Redis, for example to stop a running turn from another instance. Available in Squirro 3.17.4 and later, and turned on by default. With it turned off, new conversations use the |
|
SQ_NEO_CROSS_POD_STREAMS_ENABLED |
boolean |
No |
Keeps the live event stream of each Squirro Neo turn in Redis, so that any GenAI service instance can stream it to the browser. Available in Squirro 3.17.4 and later, and turned on by default. With it turned off, new conversations use the |
|
SQUIRRO_REFRESH_TOKEN |
string |
No |
Fallback refresh token, used if it is not specified in the request. |
|
SQUIRRO_PROJECT_ID |
string |
No |
Fallback project ID, used if it is not specified in the request. |
|
SQUIRRO_SEARCH_MODE |
string |
No |
Fallback search mode, used if it is not specified in the request. |
|
SQ_OPENAI_API_KEY, OPENAI_API_KEY |
string |
No |
Fallback API key for OpenAI LLM API, used if it is not specified in the request. |
|
SQ_AZURE_API_KEY, AZURE_API_KEY |
string |
No |
Fallback API key for Azure LLM API, used if it is not specified in the request. |
|
SQ_AZURE_AUTH |
string |
No |
How the Azure provider authenticates: |
|
SQ_AZURE_ENTRA_TOKEN_SCOPE |
string |
No |
OAuth scope requested when |
|
SQ_ANYSCALE_API_KEY |
string |
No |
Fallback API key for Anyscale LLM API, used if it is not specified in the request. |
|
SQ_LLAMA_API_KEY |
string |
No |
Fallback API key for LLAMA LLM API, used if it is not specified in the request. |
|
SQ_GOOGLE_API_KEY, GOOGLE_API_KEY |
string |
No |
Fallback API key for Google LLM (Gemini) API, used if it is not specified in the request. |
|
SQ_CEREBRAS_API_KEY |
string |
No |
Fallback API key for Cerebras LLM API, used if it is not specified in the request. |
|
SQ_BRAVE_API_KEY |
string |
No |
Fallback API key for Brave-related tools, used if it is not specified in the request. |
|
OPENAI_MODEL |
string |
No |
Fallback OpenAI model, used if it is not specified in the request. |
|
SQ_DISABLE_AUTHENTICATION |
string |
No |
For testing pruposes only - If set to |
|
SQ_ROOT_PATH |
string |
No |
|
|
SQ_GENAI_AUTO_POPULATE_DEFAULT_AGENTS |
string |
No |
If set to |
|
SQ_GENAI_TELEMETRY_ENABLED |
string |
No |
Global switch for the telemetry system, used for debugging and monitoring query execution patterns. Set to |
|
SQ_LLM_RATE_LIMIT_ERROR_MESSAGE |
string |
No |
Error message to return when the rate limit is exceeded. |
|
SQ_GENERIC_ERROR_MESSAGE |
string |
No |
Error message to return when an error occurs. |
|
DEFAULT_PERSONA |
string |
No |
Overrides the default persona. |
|
DEFAULT_USER_PROMPT_EXTRA |
string |
No |
Overrides the default user prompt instructions that define behavioral rules and constraints for agents. |
|
DEFAULT_ASSISTANT_LANG_INSTRUCTION |
string |
No |
Overrides the default language instructions for agent responses. |
|
DEFAULT_RETRIEVAL_LANG_INSTRUCTION |
string |
No |
Overrides the default language instructions for retrieval queries. |
|
Setting Environment Variables#
Set environment variables for the GenAI service by creating a docker-override.env file in the /etc/squirro/genai.d/ directory. That approach ensures that environment variables are preserved and continue to work as expected after updates or upgrades of Squirro components. On a Squirro cluster, follow the steps on every server that runs the sqgenaid service, with the same values.
Steps:
Create the
docker-override.envfile if it does not already exist.sudo touch /etc/squirro/genai.d/docker-override.env
Add each environment variable on its own line, in the format
VARIABLE_NAME=VALUE, without spaces around the equal sign and without quotes. The service reads each value exactly as written, so quotes become part of the value.SQ_NEO_WORKER_CONCURRENT_TURNS=20 DEFAULT_PERSONA=You are a specialized financial AI assistant with expertise in market analysis.
Warning
A number or a
trueorfalsevalue in quotes, or left empty, can stop the GenAI service at startup, and with it the AI features of Squirro and Squirro Neo. To return a variable to its default, remove its line instead of leaving the value empty.Ensure the file is owned by the
sqgenaiuser.sudo chown sqgenai:squirro /etc/squirro/genai.d/docker-override.env
Restart the GenAI service.
sudo systemctl restart sqgenaid
Check that the container received each new value, for example:
sudo docker exec squirro-service-genai printenv SQ_NEO_WORKER_CONCURRENT_TURNS
The service checks the variables in the Resource Limits for Squirro Neo section when it first uses them. To find out whether it refused a value, send a message in Squirro Neo, then search the service log for the name of the variable:
sudo docker logs squirro-service-genai 2>&1 | grep SQ_NEO_WORKER_CONCURRENT_TURNS
A warning that contains
which it cannot meanoris not ameans that the service uses the default instead of your value. Such a warning names the newSQ_NEO_*variable, so search for the new name even if you set the old one. The warning at startup that calls an old name superseded does not mean that its value is refused.
Resource Limits for Squirro Neo#
The variables in this section limit the resources that the GenAI service uses for Squirro Neo: concurrent turns, database connections, threads, time limits on calls to language models, storage, and Redis. Review them when you size a deployment, or when the service rejects requests or slows down under load. Squirro 3.17.4 and 3.17.5 name most of these variables SQ_GENAI_V1_*, for example SQ_GENAI_V1_WORKER_MAX_CONCURRENT for SQ_NEO_WORKER_CONCURRENT_TURNS. The service still reads an old name while the new name is unset, and at every start, it logs a warning for each old name that is set. Releases before 3.17.4 do not support all of these variables.
The tables in this section use the following terms:
Turn
One run of an agent: the answer to one message in a conversation, or one run of a scheduled task.
GenAI service instance
One running container of the GenAI service, called an instance in the tables. On a Squirro server, each server that runs the
sqgenaidservice runs one instance. Each limit applies to one instance unless its description says otherwise, so in a deployment with several instances, most totals are the value of the variable multiplied by the number of instances.Slot
A place for one running turn.
SQ_NEO_WORKER_CONCURRENT_TURNSsets the number of slots of an instance.Delegation model
How Squirro Neo hands work to other agents. New conversations use the
correspondencedelegation model, in which Squirro Neo can hand work to agents that run in parallel, unless the deployment, the tenant, or the project choosesnested. A conversation keeps the model it was created with. Some limits apply only to conversations that usecorrespondence.
Every limit has a default, listed in the tables below, so a deployment that sets none of these variables keeps the default behavior. To change a limit, set its variable as described in the Setting Environment Variables section.
A value outside the valid range of its variable, such as a negative number or a duration of 0 seconds or less, is not used. The service logs a warning that names the variable and uses the default instead. SQ_NEO_MAX_TASKS_PER_USER is the exception, and uses its value as set. A value that is not a number, including a number in quotes, stops the service at startup.
Turns and Scheduled Tasks#
Variable Name |
Type |
Default |
Description |
When the Limit Is Reached |
|---|---|---|---|---|
SQ_NEO_ADMISSION_MAX_TURNS |
int |
|
New messages, resumed turns, and regenerated answers that the instance has accepted and not yet finished, whether queued or running. Scheduled task runs do not count. The variable limits what the instance accepts, not what it runs. Keep it well above |
The service rejects new messages, resumed turns, and regenerated answers with |
SQ_NEO_WORKER_CONCURRENT_TURNS |
int |
|
Turns the instance runs at once, one in each slot. Running turns use database connections, threads, and network connections, so the demand on the other limits grows with this value. Conversations that use the |
Further turns wait in the queue until a slot is free. |
SQ_NEO_WORKER_CONCURRENT_TASK_TURNS |
int |
|
Running turns that may be scheduled task runs, so that a burst of tasks cannot delay conversations. The default |
Further scheduled task runs wait in the queue. Conversations are not affected. |
SQ_NEO_RUNTIME_MODEL_CALL_REQUESTS_PER_CREDENTIAL |
int |
|
Language model calls that background work, such as scheduled task runs, may have in progress at once, per provider credential. Calls made for a person in a conversation never wait for this limit. Applies only to conversations that use the |
Background work waits for a call to end. |
SQ_NEO_RUNTIME_RUN_DEADLINE_SECONDS |
float |
|
Seconds a run delegated to another agent may take, counted from when it is handed over. Time spent waiting in the queue counts, and time spent waiting for an approval does not. Applies only to conversations that use the |
The run stops, and the result produced so far is delivered. |
SQ_NEO_RUNTIME_TASK_FIRE_BOUND_SECONDS |
float |
|
Seconds a scheduled task run may wait to start. Applies only to conversations that use the |
The run expires and never starts. |
SQ_NEO_MAX_TASKS_PER_USER |
int |
|
Scheduled tasks that one person may hold in one project, counted across all instances. A value of |
Creating another task fails with |
Database Connections#
The GenAI service shares its database with the rest of the Squirro platform. At the defaults, one instance can hold up to 85 database connections: 40 in the two Squirro Neo pools and 15 for the scheduler, all set by the following variables, and 30 for the V0 runtime, which powers the AI features in Squirro. The connection limit of the database must cover every instance as well as the other Squirro services. By default, MariaDB and MySQL allow 151 connections, and PostgreSQL allows 100. For how to check and raise the limit in MariaDB and MySQL, see the MySQL Big Data Management page.
Variable Name |
Type |
Default |
Description |
When the Limit Is Reached |
|---|---|---|---|---|
SQ_NEO_DB_POOL_CONNECTIONS |
int |
|
Database connections the instance keeps open for Squirro Neo. The instance runs two pools, each sized by this variable and |
A request waits up to |
SQ_NEO_DB_POOL_OVERFLOW_CONNECTIONS |
int |
|
Connections the instance may open above |
Same as |
SQ_NEO_DB_POOL_WAIT_SECONDS |
float |
|
Seconds a request waits for a database connection. A long value slows down other requests while every connection is in use, so keep it short. |
Same as |
SQ_NEO_SCHEDULER_DB_POOL_CONNECTIONS |
int |
|
Database connections the scheduler of the instance keeps open for scheduled tasks and other background jobs. |
The job fails and is retried at its next run. |
SQ_NEO_SCHEDULER_DB_POOL_OVERFLOW_CONNECTIONS |
int |
|
Connections the scheduler may open above |
Same as |
Threads#
Variable Name |
Type |
Default |
Description |
When the Limit Is Reached |
|---|---|---|---|---|
SQ_NEO_SYNC_HANDLER_THREADS |
int |
|
Threads for handling API requests. |
Requests wait for a free thread, so responses slow down. |
SQ_NEO_EXECUTOR_THREADS_PER_LOOP |
int |
unset |
General-purpose threads for blocking work, in requests and in running turns alike. The instance runs two of these pools, so it can hold twice this number of threads. If unset, each pool has four more threads than the host has CPUs, up to 32. |
Work waits for a thread. There is no error, only added latency. |
SQ_NEO_OUTBOUND_CLIENT_THREADS |
int |
|
Threads for calls from the GenAI service to the Squirro API, such as searches and document fetches. One pool serves the whole instance. |
Searches and document fetches slow down, and can fail with a timeout. |
SQ_NEO_DOCUMENT_FETCH_CONCURRENT_REQUESTS |
int |
|
Documents read at once within one document fetch. If you raise it, raise |
The remaining documents of that fetch wait until a read ends. |
SQ_NEO_MARKDOWN_CONVERSION_THREADS, SQ_NEO_PDF_RENDER_THREADS, SQ_NEO_THUMBNAIL_THREADS |
int |
|
Three separate pools, for converting documents to Markdown, rendering PDF pages, and generating thumbnails. |
Work waits for a thread. There is no error, only added latency. |
Time Limits on Language Model Calls#
Variable Name |
Type |
Default |
Description |
When the Limit Is Reached |
|---|---|---|---|---|
SQ_NEO_MODEL_CALL_TIMEOUT_SECONDS |
float |
|
Seconds a single call to a language model provider may take, including the time spent streaming the answer. A timeout set on an individual model cannot extend this limit. |
The turn fails, and its slot is freed for the next turn. |
SQ_NEO_TITLE_CALL_TIMEOUT_SECONDS |
float |
|
Seconds the call that names a conversation may take. That call runs in the background, alongside the first answer. |
The conversation keeps its provisional title. |
SQ_NEO_RUN_FINALISE_TIMEOUT_SECONDS |
float |
|
Seconds allowed for the call that writes the title and summary of a scheduled task result. That call runs after the run ends. A value above |
The attempt fails and is retried later. After repeated failures, the result has no title and no summary. |
Other time limits, such as the limit on a search, are fixed. The time limit on fetching a document is documents_fetch_timeout_seconds, 120 seconds by default. It can be set per project or per tenant, or for the whole deployment with SQ_NEO_CONFIGURATION_DOCUMENTS_FETCH_TIMEOUT_SECONDS.
Storage and Uploads#
Variable Name |
Type |
Default |
Description |
When the Limit Is Reached |
|---|---|---|---|---|
SQ_NEO_MEMORY_STORAGE_BYTES_LIMIT |
int |
|
Space that the agent memories of one person may use, per project. A value of |
The service refuses the write, and the agent reports that the limit is reached. |
SQ_NEO_UPLOADS_STORAGE_BYTES_LIMIT |
int |
unset |
Upper limit on the space that the uploaded files of one person may use in one project, for the whole deployment. Where a project sets its own limit, the lower of the two applies. If unset or |
The service rejects the upload with |
SQ_NEO_UPLOADS_FILE_BYTES_LIMIT |
int |
unset |
Upper limit on the size of a single uploaded file, for the whole deployment. Where a project sets its own limit, the lower of the two applies. If unset or |
The service rejects the upload with |
SQ_NEO_UPLOADS_ATTACHMENTS_PER_TURN_LIMIT |
int |
unset |
Upper limit on the number of files attached to one message, for the whole deployment. Where a project sets its own limit, the lower of the two applies. If unset or |
The service rejects the message with |
Redis Connections and Event Streams#
When SQ_NEO_CROSS_POD_ENABLED is turned on, which is the default, Squirro Neo uses Redis to coordinate GenAI service instances. It also keeps the live event stream of each running turn in Redis, so that any instance can stream a turn to the browser. An event stream holds the content of the answer as the browser receives it, and stays readable for SQ_NEO_EVENT_LOG_RETENTION_SECONDS after the turn ends. On a Squirro server, the service uses the Redis storage instance of the platform, so the stored event streams count against its memory. The following variables limit the Redis connections and storage that Squirro Neo uses.
Variable Name |
Type |
Default |
Description |
When the Limit Is Reached |
|---|---|---|---|---|
SQ_NEO_CROSS_POD_POOL_CONNECTIONS_PER_LOOP |
int |
|
Redis connections per pool. The instance runs two pools, so it can hold twice this number. Keep it well above the number of turns that the instance runs at once. |
A call waits up to |
SQ_NEO_CROSS_POD_POOL_WAIT_SECONDS |
float |
|
Seconds a call waits for a Redis connection. |
Same as |
SQ_NEO_CROSS_POD_CALL_TIMEOUT_SECONDS |
float |
|
Seconds a single Redis call may take, connecting included. |
The call fails, as if Redis were unreachable for that call. |
SQ_NEO_CROSS_POD_PUBLISH_TIMEOUT_SECONDS |
float |
|
Seconds the instance may take to send a signal to the other instances. |
The signal is dropped. The other instances still act on the change, after a short delay. |
SQ_NEO_EVENT_LOG_BUDGET_BYTES_FLEETWIDE |
int |
|
Space that all stored event streams may use together in Redis, across all instances. Every instance enforces this limit against the shared total, so set the same value on every instance. Otherwise, the lowest value applies. |
The streams of finished turns are deleted, oldest first. Leave Redis memory headroom above this value. |
SQ_NEO_EVENT_LOG_RETENTION_SECONDS |
int |
|
Seconds the event stream of a finished turn stays readable. A longer time means more streams stored at once. |
The stream is deleted. Nothing fails. |
SQ_NEO_EVENT_LOG_MAX_FRAMES |
int |
|
Events that the stream of one turn may hold, as a safety limit. Lowering it can make a browser that reconnects to a long turn resynchronize. |
The oldest events are dropped, and a browser that reconnects to that turn resynchronizes. |
SQ_NEO_EVENT_LOG_SUBSCRIBER_QUEUE_FRAMES |
int |
|
Events that one browser may fall behind a running turn. At the default, that is about 3 MiB of memory on the instance for each browser. |
That browser resynchronizes. The turn and other browsers are not affected. |