LLM Configuration for Rasa Pro 3.10 and belowFor Rasa Pro versions
3.10 and below, refer to the LLM Configuration for <=3.10 page.Overview
This page applies to the following components which use LLMs:- SearchReadyLLMCommandGenerator
- CompactLLMCommandGenerator
- EnterpriseSearchPolicy
- ContextualResponseRephraser
- LLMBasedRouter
- SingleStepLLMCommandGenerator (deprecated)
- MultiStepLLMCommandGenerator (deprecated)
- IntentlessPolicy (deprecated)
- the LLM provider
- the model(s) to be used
3.10, CALM uses LiteLLM under the hood to integrate
with different LLM providers. Hence, all LiteLLM’s integrated providers
are supported with CALM as well. We explicitly mention the settings required for the most frequently used ones in the
sections below.
Declaring LLM deployments
LLM deployments are always declared in groups comprising of 1 or more deployments. The below sections explain how to declare these groups.Model Groups
Model groups allow you to define multiple models under a single ID which can be accessed by any component. Model groups are defined in theendpoints.yml file under the model_groups key, separating model definitions from individual component configurations. For example:
endpoints.yml
- The
idkey uniquely identifies the model group. - The
modelskey lists all model deployments in that group. - Each model in the list includes a configuration, explained in the following sections.
Defining a single model group
endpoints.yml
Required Parameters
There are certain required parameters for each model group:provider- Unique identifier of the LLM provider to be used.model- Specifies the name of the model identifier available from the LLM provider’s documentation, for e.g.gpt-5.1-2025-11-13.
Optional Parameters
Each model group also accepts inference time parameters liketemperature, etc which are optional but can be useful
in extracting the best performance out of the model being used.
Please refer to the
official LiteLLM documentation for a list of such parameters supported.
When configuring a particular provider, there are a few provider specific settings which are explained under
each provider’s individual sub-section below.
If you switch to a different LLM provider, all default parameters for the old provider
will be overriden with the default parameters of the new provider.E.g. If a provider sets
temperature=0.7 as the default value and you switch to a different LLM
provider, this default will be ignored and it is up to you to set the
temperature for the new provider.Reasoning models and reasoning_effort
For models that support it, reasoning_effort is an optional inference-time parameter that controls how much internal
reasoning the model applies before returning an answer. Higher values typically increase latency and cost; lower values
favor faster responses. Allowed values depend on the provider and model (for example none, minimal, low, and high
for many OpenAI reasoning-capable models). See provider documentation for more details, e.g. OpenAI Developers: Reasoning models or
Claude API Docs: Effort.
You can set reasoning_effort alongside other model settings in each entry under models in endpoints.yml, for example:
endpoints.yml
reasoning_effort for the resolved model name (using provider
metadata where available). To override this behavior, set reasoning_effort explicitly in your model configuration.
Models that do not support this parameter do not receive a default.
Referencing environment variables in the model configuration
To reference environment variables in the model configuration, you can use the${} syntax. For example:
endpoints.yml
api_key parameter references the environment variable MY_OPENAI_API_KEY.
endpoints.yml
deployment, api_base, api_version, and api_key parameters reference the environment variables AZURE_DEPLOYMENT_NAME, AZURE_API_BASE, AZURE_API_VERSION, and MY_AZURE_API_KEY respectively.
The variables are set in the environment using the export command in Unix-based systems and the setx command in Windows systems.
Not setting these variables will result in an error when the assistant is started.
LLM API health checkThe model config and the connection to the LLM provider can be validated by setting the
By default, the variable is set to
LLM_API_HEALTH_CHECK environment variable to true.False. When set to True, all LLM deployments defined will be checked for availability by making a test API request.For Azure OpenAI configurations that specify a deployment but no model, a probe request is made during
inference-time initialization to resolve the underlying model name so defaults such as reasoning_effort can be
applied correctly. This probe is made even when LLM_API_HEALTH_CHECK is set to False.Using a model group in a component
Components using an LLM can be configured to use any of the declared model groups in the component’s configuration. To use a model group, you can specify themodel_group key under the llm key. For example:
config.yml
Defining multiple model groups
endpoints.yml
models list as explained in the Multi-LLM routing
page.
Using different model groups in different components
config.yml
Chat completion models
Default ProviderCALM is LLM agnostic and can be configured with different LLMs, but OpenAI is the default model provider. Majority of
our experiments have been with models available on OpenAI or OpenAI Azure service. The performance of your
assistant may vary when using other LLMs, but improvements can be made by tuning flow and collect step descriptions.
OpenAI
API Token
The API token authenticates your requests to the OpenAI API. To configure the API token, follow these steps:- If you haven’t already, sign up for an account on the OpenAI platform.
- Navigate to the OpenAI Key Management page,
and click on the “Create New Secret Key” button to initiate the process of
obtaining
<your-api-key>. - The API key can be set in the model configuration or through an environment variable.
api_key parameter in the model configuration:
The
api_key parameter can be set in the model configuration for each model in the model_groups section of the endpoints.yml file.
For security reasons, the value of the api_key must reference an environment variable, as demonstrated above.
This approach ensures sensitive information is securely stored.
Directly assigning the API key in the configuration file is not allowed, as it could potentially expose the key to unauthorized access.- Linux/MacOS
- Windows
<your-api-key> with the actual API key you obtained from the OpenAI platform.
Configuration
There are no additional OpenAI specific parameters to be configured. However, there could be model specific parameters liketemperature that you might want to modify. Names for such parameters can found in
OpenAI’s API documentation and defined under llm key of the
component’s configuration.
Please refer to
LiteLLM’s documentation to know the
list of models supported from the OpenAI platform.
Model deprecations
OpenAI regularly publishes a deprecation schedule for its models. This schedule can be accessed in the documentation published by OpenAI.Azure OpenAI Service
API Token
The API token authenticates your requests to the Azure OpenAI Service. Set the API token as an environment variable. You can use the following command in a terminal or command prompt:- Linux/MacOS
- Windows
<your-api-key> with the actual API key you obtained from the Azure OpenAI Service platform.
Configuration
To access models provided by Azure OpenAI Service, there are a few additional parameters that need to be configured:provider- Set toazure.api_base- The URL for your Azure OpenAI instance. An example might look like this:https://my-azure.openai.azure.com/.api_version- The API version to use for this operation. This follows the YYYY-MM-DD format and the value should be enclosed in single or double quotes.deployment- Name of the deployment on Azure.
temperature can be defined as well. Refer to
OpenAI Azure service’s API documentation
for information on available parameter names.
A complete example configuration of the CompactLLMCommandGenerator using Azure OpenAI Service would look like this:
config.yml
endpoints.yml
- Linux/MacOS
- Windows
Model deprecations
Azure regularly publishes a deprecation schedule for its models that come under the OpenAI Azure Service. This schedule can be accessed in the documentation published by Azure.Debugging
If you encounter timeout errors, configuretimeout parameter to a larger value. The exact value depends on
how your azure instance is configured.
Amazon Bedrock
Requirements:
-
Make sure you have
rasa-pro>=3.11.xinstalled. -
Install
boto3>=1.28.57. -
Make sure your AWS credentials are accessible via credentials, IAM role, or environment variables.
- If you are using AWS credentials, ensure that the
~/.aws/credentialsfile is set up with the correct access key and secret key. - If you are using an IAM role, ensure that the role has the necessary permissions to access Amazon Bedrock models and to have requested model access to the model of choice in AWS Bedrock. For example, you can use the following policy to allow access to all Bedrock models and to grant access to model invocation logging configuration, which is required during LLM client validation:
- If you are using AWS credentials, ensure that the
bedrock:InvokeModelWithResponseStream is required for any streaming feature, including the ContextualResponseRephraser (nlg.type: rephrase). Without it, streaming calls will fail even if bedrock:InvokeModel is granted.- If you are using environment variables, ensure that the following variables are set:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_REGION
AWS_SESSION_TOKEN if your organisation mandates the usage of temporary credentials
for security in your preferred authentication method.
Configuration
Editconfig.yaml to use an appropriate model_group from the endpoints.yaml
file:
- Secrets set in environment
- Secrets set in configuration
- IAM role configuration
config.yml
endpoints.yml
provider to bedrock and model to the model name you want to use.
Model specific parameters like temperature can be defined as well. Refer to
LiteLLM’s documentation
for information on available parameter names
and supported models.
Mistral
Requirements
- Set the API key for Mistral platform to an environment variable
MISTRAL_API_KEY.
Configuration
Define a deployment inendpoints.yaml and use the deployment in config.yaml
endpoints.yml
config.yml
Gemini - Google AI Studio
Requirements:
- Make sure you have
rasa-pro>=3.11.xinstalled. - Install python package
google-generativeai. - Get API Key at https://aistudio.google.com/ .
- Set the API key to an environment variable
GEMINI_API_KEYor set it in the model configuration.
config.yaml to use an appropriate model_group from the endpoints.yaml and set provider to gemini:
config.yml
endpoints.yml
HuggingFace Inference Endpoints
Requirements:
- Make sure you have
rasa-pro>=3.11.xinstalled. - Set an API Key to the environment variable
HUGGINGFACE_API_KEYor set it in the model configuration. - Edit
config.yamlto use an appropriatemodel_groupfrom theendpoints.yaml, setprovidertohuggingfaceandapi_baseto the base URL of the deployed endpoint:
config.yml
endpoints.yml
Self Hosted Model Server
CALM’s components can also be configured to work with an open source LLM that is hosted on an open source model server like vLLM(recommended), Ollama or Llama.cpp web server. The only requirement is that the model server should adhere to the OpenAI API format. Once you have your model server running, configure the CALM assistant’sconfig.yaml file to use a model_group from the endpoints.yaml file:
vLLM
config.yml
endpoints.yml
- Recommended version of
vllmto use is0.6.0. - CALM exclusively utilizes the chat completions endpoint of the model server, so it’s essential that the model’s tokenizer includes a chat template.
Models lacking a chat template will have to set the
use_chat_completions_endpointparameter tofalsein themodel_groupsconfiguration.
config.yml
endpoints.yml
modelshould contain the name of the model supplied to the vllm startup command, for example if your model server is started with:
model should be set to meta-llama/CodeLlama-7b-Instruct-hf.
4. api_base should contain the full exposed URL of the model server with v1 attached as suffix to the URL.
5. If required, Set an API Key to the environment variable HOSTED_VLLM_API_KEY or set it in the model configuration.
Ollama
Once the ollama model server is running, edit the config.yaml file to use a model_group from the endpoints.yaml file:
config.yml
endpoints.yml
Other Providers
If you want to try one of these providers, it is recommended to install Rasa Pro versions
>= 3.11.
For each of the above ones, ensure you have set an environment variable named by the value in
API-KEY variable column
to the API key of that platform or set it in the model configuration, and set the provider parameter under llm key
of the component’s config to the value in provider column.
Embedding models
To configure components that use an embedding model, reference themodel_group from endpoints.yaml under the embeddings key
config.yml
endpoints.yml
embeddings property needs the model_group key to be configured in the config.yml file and the corresponding model group should be
defined in the endpoints.yml file.
The models key under model_groups in endpoints.yaml should contain the following parameters:
model- Specifies the name of the model identifier available from the LLM provider’s documentation, for e.g.text-embedding-3-large.provider- Unique identifier of the provider to be used for invoking the specified model, for e.g.openai
OpenAI
OpenAI is used as the default embedding model provider. To start using, ensure you have configured an API token as you would do for a chat completion model from OpenAI platformConfiguration
config.yml
endpoints.yml
Azure OpenAI Service
Ensure you have configured an API token as you would do for a chat completion model for Azure OpenAI ServiceConfiguration
Configuring an embedding model from Azure OpenAI Service needs values for the same set of parameters that are required for configuring a chat completion model from Azure OpenAI Serviceconfig.yml
endpoints.yml
From rasa pro
3.11, deployments from multiple azure subscriptions can be used in the model configurations.config.yml
endpoints.yml
Amazon Bedrock
Configuring an embedding model from amazon bedrock needs the same pre-requisites as a chat completion model. Please ensure you have addressed these before proceeding further.Configuration
config.yml
endpoints.yml
Mistral
Configuring an embedding model from mistral needs the same pre-requisites as a chat completion model. Please ensure you have addressed these before proceeding further. Define a deployment inendpoints.yaml and use the deployment in config.yaml
endpoints.yml
config.yml
In-Memory
CALM also provides an option to load lightweight embedding models in-memory without needing them to be exposed over an API. It uses the sentence transformers library under the hood to load and run inference on them.Configuration
config.yml
endpoints.yml
modelparameter can take as value either any embedding model repository available on the HuggingFace hub or a path to a local model.model_kwargsparameter is used to provide load time arguments to the sentence transformer library.encode_kwargsparameter is used to provide inference time arguments to the sentence transformer library.
Other Providers
Other than the above mentioned providers, we have also tested support for the following providers -
For each of the above ones, ensure you have set an environment variable named by the value in
API-KEY variable column
to the API key of that platform or set it in the model configuration, and set the provider parameter under llm key
of the component’s config to the value in provider column.
Configuring self-signed SSL certificates
In environments where a proxy performs TLS interception, Rasa may need to be configured to trust the certificates used by your proxy. By default, certificates are loaded from the OS certificate store. However, if your setup involves custom self-signed certificates, you can specify these by setting theRASA_CA_BUNDLE environment variable.
This variable points to the path of the certificate file that Rasa should use to validate SSL connections:
The
REQUESTS_CA_BUNDLE environment variable is deprecated and will no longer be supported in future versions. Please
use RASA_CA_BUNDLE instead to ensure compatibility.Configuring Proxy URLs
In environments where LLM requests need to be routed through a proxy, Rasa relies on LiteLLM to handle proxy configurations. LiteLLM supports configuring proxy URLs through theHTTP_PROXY and HTTPS_PROXY environment
variables.
To ensure that all LLM requests are routed through the proxy, you can set the environment variables as follows:
api_base parameter in the model configuration to the proxy URL:
endpoints.yml
Recommended Models
The table below documents the versions of each model we recommend for use with various Rasa components. As new models are published, Rasa will test these and where appropriate add them as a recommended model.OAuth Authentication for Azure OpenAI
New in Rasa 3.12Rasa supports OAuth authentication for instances deployed on Azure OpenAI.
This feature includes built-in implementation for OAuth over Entra ID and allows
customers to provide their own custom OAuth integration for Azure OpenAI instances as a custom component.
oauth field in the model group.
The api_key and oauth fields are mutually exclusive; an error will be thrown if neither or both are specified.
Setup
Prerequisites you will need:- Azure Entra ID app which provides the access token (JWT).
- An API gateway (Azure API Management service) between the user and Azure OpenAI instance. API gateway is setup to validate the JWT access token and forward the request to the Azure OpenAI instance.
Authentication Flow
- Configure Rasa with OAuth method and required parameters.
- Rasa contacts Entra ID to obtain an access token using the
azure-identitylibrary. - The access token is injected into the completion request sent to the API gateway (Azure API Management service).
- If access token is valid, the API gateway forwards the request to the Azure OpenAI instance.
Authentication Options
Rasa supports several OAuth methods for Azure OpenAI instances:- Client Secret Authentication: Use
azure_entra_id_client_secretfor client secret authentication. - Client Certificate Authentication: Use
azure_entra_id_client_certificatefor client certificate authentication. - Default Azure Credentials: Use
azure_entra_id_defaultfor Azure SDK default credentials resolution. - Custom OAuth Component: Implement a custom OAuth component by inheriting from the
OAuthinterface.
Client Secret Authentication
Example:
Client Certificate Authentication
Example:
Default Azure Credentials Resolver
This approach uses the Default Azure Credentials resolver. This method sequentially resolves between several authentication methods, built-in in Azure SDK, and uses the first successful one. You can read more about the DefaultAzureCredentials class in the Azure Identity Library documentation.- Use builtin Azure SDK env vars for authentication
- Authenticate using the Azure CLI
OAuth with LiteLLM Router Configuration
When using the LiteLLM router, you can configure OAuth authentication for multiple models. Here’s an example configuration:- The first model uses client secret authentication.
- The second model uses the Default Azure Credentials resolver.
Custom OAuth Component
Customers can implement a custom OAuth component by inheriting from theOAuth
interface and implementing the from_config and get_bearer_token methods.
This allows for tailored OAuth implementations when needed.
Example:
We have a custom OAuth component AzureEntraIDClientCreds which implements the OAuth interface and is located at:
addons/oauth/azure_entra_id_client_creds.py. This path is relative to the working directory of the Rasa instance.
azure_entra_id_client_creds.py
endpoints.yml
FAQ
Does OpenAI use my data to train their models?
No. OpenAI does not use your data to train their models. From their website:We do not train our models on your business data by default.
Example Configurations
Azure
A comprehensive example which includes:llmandembeddingsconfiguration for components inconfig.yml:EnterpriseSearchPolicySearchReadyLLMCommandGeneratorflow_retrievalin 3.8.x
llmconfiguration for rephrase inendpoints.yml(ContextualResponseRephraser)
endpoints.yml
config.yml