Skip to main content

How to define configurations?

The config is defined as a Python dictionary with two main keys:
  • llm: Specifies the llm provider and its configuration
    • provider: 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):
  1. Values explicitly set in the config object/dictionary
  2. Environment variables (e.g., OPENAI_API_KEY, OPENAI_BASE_URL)
  3. Default values defined in the LLM implementation
This means that values specified in the 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:
  1. Specifying which LLM to use.
  2. Providing necessary connection details (e.g., model, api_key, temperature).
  3. 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:

Supported LLMs

For detailed information on configuring specific LLMs, please visit the LLMs section. There you’ll find information for each supported LLM with provider-specific usage examples and configuration details.