How to define configurations?
- Python
- TypeScript
The
config is defined as a Python dictionary with two main keys:llm: Specifies the llm provider and its configurationprovider: The name of the llm (e.g., “openai”, “groq”)config: A nested dictionary containing provider-specific settings
Config Values Precedence
Config values are applied in the following order of precedence (from highest to lowest):- Values explicitly set in the
configobject/dictionary - Environment variables (e.g.,
OPENAI_API_KEY,OPENAI_BASE_URL) - Default values defined in the LLM implementation
config will override corresponding environment variables, which in turn override default values.
How to Use Config
Here’s a general example of how to use the config with Mem0:Why is Config Needed?
Config is essential for:- Specifying which LLM to use.
- Providing necessary connection details (e.g., model, api_key, temperature).
- Ensuring proper initialization and connection to your chosen LLM.
Master List of All Params in Config
Here’s a comprehensive list of all parameters that can be used across different LLMs:- Python
- TypeScript