Skip to main content
Mem0 includes built-in support for various popular large language models. Memory can utilize the LLM provided by the user, ensuring efficient use for specific needs.

Usage

To use an LLM, you must provide a configuration to customize its usage. If no configuration is supplied, a default configuration will be applied, and OpenAI will be used as the LLM. For a comprehensive list of available parameters for llm configuration, please refer to Config.

Supported LLMs

See the list of supported LLMs below.
All LLMs are supported in Python. The following LLMs are also supported in TypeScript: OpenAI, Anthropic, Groq, Azure OpenAI, DeepSeek, Google AI, Langchain, LM Studio, Mistral AI, and Ollama.
https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/openai.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=c053d899474ab098eb247707fcbabb56

OpenAI

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/ollama.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=31cf7c44b941b38e311372f091871b7f

Ollama

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/azure-color.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=15f73415f4af02e4442294a9d8490bfd

Azure OpenAI

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/anthropic.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=d2a2af9f60f53e9f21d741fe237af0f5

Anthropic

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/together-color.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=0d4f68126478c43579faca2b2857eef1

Together

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/groq.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=5c71a46e2839d109c5e1fa4557f32570

Groq

Litellm

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/mistral-color.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=626a94c5092e832239b4513f3ac4d66a

Mistral AI

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/google-color.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=69e80423de8cfcfc8ab5f0e9d7acffa2

Google AI

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/bedrock-color.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=bb708e7d266b2fb81459fe967a8ac581

AWS bedrock

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/deepseek-color.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=04fba6ade03660ce0beee783d2cf07b1

DeepSeek

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/minimax-color.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=45d6e3ff9286fa5507dfc6d2a0e77360

MiniMax

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/xai.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=9840226f7f31ffd8505d61633d248183

xAI

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/sarvam.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=8089b9e024472b4919767d269ad89596

Sarvam AI

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/lmstudio.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=f5991eea5ee6a166f4c996296479c39e

LM Studio

https://mintcdn.com/mem0/QK-8_hblyHgAr7vt/images/provider-icons/langchain-color.svg?fit=max&auto=format&n=QK-8_hblyHgAr7vt&q=85&s=85a28798b84159e82fb56724fa0dc720

Langchain

Structured vs Unstructured Outputs

Mem0 supports two types of OpenAI LLM formats, each with its own strengths and use cases:

Structured Outputs

Structured outputs are LLMs that align with OpenAI’s structured outputs model:
  • Optimized for: Returning structured responses (e.g., JSON objects)
  • Benefits: Precise, easily parseable data
  • Ideal for: Data extraction, form filling, API responses
  • Learn more: OpenAI Structured Outputs Guide

Unstructured Outputs

Unstructured outputs correspond to OpenAI’s standard, free-form text model:
  • Flexibility: Returns open-ended, natural language responses
  • Customization: Use the response_format parameter to guide output
  • Trade-off: Less efficient than structured outputs for specific data needs
  • Best for: Creative writing, explanations, general conversation
Choose the format that best suits your application’s requirements for optimal performance and usability.