repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: Configurations |
| #3 | --- |
| #4 | |
| #5 | ## How to define configurations? |
| #6 | |
| #7 | <Tabs> |
| #8 | <Tab title="Python"> |
| #9 | The `config` is defined as a Python dictionary with two main keys: |
| #10 | - `llm`: Specifies the llm provider and its configuration |
| #11 | - `provider`: The name of the llm (e.g., "openai", "groq") |
| #12 | - `config`: A nested dictionary containing provider-specific settings |
| #13 | </Tab> |
| #14 | <Tab title="TypeScript"> |
| #15 | The `config` is defined as a TypeScript object with these keys: |
| #16 | - `llm`: Specifies the LLM provider and its configuration (required) |
| #17 | - `provider`: The name of the LLM (e.g., "openai", "groq") |
| #18 | - `config`: A nested object containing provider-specific settings |
| #19 | - `embedder`: Specifies the embedder provider and its configuration (optional) |
| #20 | - `vectorStore`: Specifies the vector store provider and its configuration (optional) |
| #21 | - `historyDbPath`: Path to the history database file (optional) |
| #22 | </Tab> |
| #23 | </Tabs> |
| #24 | |
| #25 | ### Config Values Precedence |
| #26 | |
| #27 | Config values are applied in the following order of precedence (from highest to lowest): |
| #28 | |
| #29 | 1. Values explicitly set in the `config` object/dictionary |
| #30 | 2. Environment variables (e.g., `OPENAI_API_KEY`, `OPENAI_BASE_URL`) |
| #31 | 3. Default values defined in the LLM implementation |
| #32 | |
| #33 | This means that values specified in the `config` will override corresponding environment variables, which in turn override default values. |
| #34 | |
| #35 | ## How to Use Config |
| #36 | |
| #37 | Here's a general example of how to use the config with Mem0: |
| #38 | |
| #39 | <CodeGroup> |
| #40 | ```python Python |
| #41 | import os |
| #42 | from mem0 import Memory |
| #43 | |
| #44 | os.environ["OPENAI_API_KEY"] = "sk-xx" # for embedder |
| #45 | |
| #46 | config = { |
| #47 | "llm": { |
| #48 | "provider": "your_chosen_provider", |
| #49 | "config": { |
| #50 | # Provider-specific settings go here |
| #51 | } |
| #52 | } |
| #53 | } |
| #54 | |
| #55 | m = Memory.from_config(config) |
| #56 | m.add("Your text here", user_id="user", metadata={"category": "example"}) |
| #57 | |
| #58 | ``` |
| #59 | |
| #60 | ```typescript TypeScript |
| #61 | import { Memory } from 'mem0ai/oss'; |
| #62 | |
| #63 | // Minimal configuration with just the LLM settings |
| #64 | const config = { |
| #65 | llm: { |
| #66 | provider: 'your_chosen_provider', |
| #67 | config: { |
| #68 | // Provider-specific settings go here |
| #69 | } |
| #70 | } |
| #71 | }; |
| #72 | |
| #73 | const memory = new Memory(config); |
| #74 | await memory.add("Your text here", { userId: "user123", metadata: { category: "example" } }); |
| #75 | ``` |
| #76 | |
| #77 | </CodeGroup> |
| #78 | |
| #79 | ## Why is Config Needed? |
| #80 | |
| #81 | Config is essential for: |
| #82 | 1. Specifying which LLM to use. |
| #83 | 2. Providing necessary connection details (e.g., model, api_key, temperature). |
| #84 | 3. Ensuring proper initialization and connection to your chosen LLM. |
| #85 | |
| #86 | ## Master List of All Params in Config |
| #87 | |
| #88 | Here's a comprehensive list of all parameters that can be used across different LLMs: |
| #89 | |
| #90 | <Tabs> |
| #91 | <Tab title="Python"> |
| #92 | | Parameter | Description | Provider | |
| #93 | |----------------------|-----------------------------------------------|-------------------| |
| #94 | | `model` | Embedding model to use | All | |
| #95 | | `temperature` | Temperature of the model | All | |
| #96 | | `api_key` | API key to use | All | |
| #97 | | `max_tokens` | Tokens to generate | All | |
| #98 | | `top_p` | Probability threshold for nucleus sampling | All | |
| #99 | | `top_k` | Number of highest probability tokens to keep | All | |
| #100 | | `http_client_proxies`| Allow proxy server settings | AzureOpenAI | |
| #101 | | `models` | List of models | Openrouter | |
| #102 | | `route` | Routing strategy | Openrouter | |
| #103 | | `openrouter_base_url`| Base URL for Openrouter API | Openrouter | |
| #104 | | `site_url` | Site URL | Openrouter | |
| #105 | | `app_name` | Application name | Openrouter | |
| #106 | | `ollama_base_url` | Base URL for Ollama API | Ollama | |
| #107 | | `openai_base_url` | Base URL for OpenAI API | OpenAI | |
| #108 | | `azure_kwargs` | Azure LLM args for initialization | AzureOpenAI | |
| #109 | | `deepseek_base_url` | Base URL for DeepSeek API | DeepSeek | |
| #110 | | `xai_base_url` | Base URL for XAI API | XAI | |
| #111 | | `sarvam_base_url` | Base URL for Sarvam API | Sarvam | |
| #112 | | `reasoning_effort` | Reasoning level (low, medium, high) | Sarvam | |
| #113 | | `frequency_penalty` | Penalize frequent tokens (-2.0 to 2.0) | Sarvam | |
| #114 | | `presence_penalty` | Penalize existing tokens (-2.0 to 2.0) | Sarvam | |
| #115 | | `seed` | Seed for deterministic sampling | Sarvam | |
| #116 | | `stop` | Stop sequences (max 4) | Sarvam | |
| #117 | | `lmstudio_base_url` | Base URL for LM Studio API | LM Studio | |
| #118 | | `response_callback` | LLM response callback function | OpenAI | |
| #119 | </Tab> |
| #120 | <Tab title="TypeScript"> |
| #121 | | Parameter | Description | Provider | |
| #122 | |----------------------|-----------------------------------------------|-------------------| |
| #123 | | `model` | Embedding model to use | All | |
| #124 | | `temperature` | Temperature of the model | All | |
| #125 | | `apiKey` | API key to use | All | |
| #126 | | `maxTokens` | Tokens to generate | All | |
| #127 | | `topP` | Probability threshold for nucleus sampling | All | |
| #128 | | `topK` | Number of highest probability tokens to keep | All | |
| #129 | | `openaiBaseUrl` | Base URL for OpenAI API | OpenAI | |
| #130 | </Tab> |
| #131 | </Tabs> |
| #132 | |
| #133 | ## Supported LLMs |
| #134 | |
| #135 | For detailed information on configuring specific LLMs, please visit the [LLMs](./models) section. There you'll find information for each supported LLM with provider-specific usage examples and configuration details. |
| #136 |