In this deep-dive we run through the LLM configuration in depth, including the useful OAI_CONFIG_LIST file.
LLM Configuration
In AG2, agents use LLMs as key components to understand and react. To configure an agent’s access to LLMs, you can specify an llm_config argument in its constructor. For example, the following snippet shows a configuration that uses gpt-4o:
Different tasks may require different models, and the config_list allows specifying the different endpoints and configurations that are to be used. It is a list of dictionaries, each of which contains the following keys depending on the kind of endpoint being used:
OpenAI
Azure OpenAI
Other OpenAI compatible
api_type (str, required): The model provider
model (str, required): The identifier of the model to be used, such as ‘gpt-4o’, ‘gpt-4o-mini’.
api_key (str, optional): The API key required for authenticating requests to the model’s API endpoint.
base_url (str, optional): The base URL of the API endpoint. This is the root address where API calls are directed.
tags (List[str], optional): Tags which can be used for filtering.
These will create a model client which assumes an OpenAI API (or compatible) endpoint. To use custom model clients, see here.
OAI_CONFIG_LIST pattern
A common, useful pattern used is to define this config_list via JSON (specified as a file or an environment variable set to a JSON-formatted string) and then use the from_json method to load it:
llm_config = autogen.LLMConfig.from_json( env="OAI_CONFIG_LIST", # Or path="path/to/config.json")# Then, create the assistant agent with the configwith llm_config: assistant = autogen.AssistantAgent(name="assistant")
This can be helpful as it keeps all the configuration in one place across different projects or notebooks.This function interprets the env_or_file argument as follows:
If env_or_file is an environment variable then:
It will first try to load the file from the path specified in the environment variable.
If there is no file, it will try to interpret the environment variable as a JSON string.
Otherwise, it will try to open the file at the path specified by env_or_file.
Why is it a list?
Being a list allows you to define multiple models that can be used by the agent. This is useful for a few reasons:
If one model times out or fails, the agent can try another model.
Having a single global list of models and filtering it based on certain keys (e.g. name, tag) in order to pass select models into a certain agent (e.g. use cheaper GPT 4o-mini for agents solving easier tasks)
While the core agents, (e.g. conversable or assistant) do not have special logic around selecting configs, some of the specialized agents may have logic to select the best model based on the task at hand.
How does an agent decide which model to pick out of the list?
An agent uses the very first model available in the “config_list” and makes LLM calls against this model. If the model fails (e.g. API throttling) the agent will retry the request against the 2nd model and so on until prompt completion is received (or throws an error if none of the models successfully completes the request). In general there’s no implicit/hidden logic inside agents that is used to pick “the best model for the task”. However, some specialized agents may attempt to choose “the best model for the task”. It is developers responsibility to pick the right models and use them with agents.
Config list filtering
As described above the list can be filtered based on certain criteria. This is defined as a dictionary of key to filter on and values to filter by. For example, if you have a list of configs and you want to select the one with the model “gpt-4o-mini” you can use the following filter:
filter_dict = {"model": ["gpt-4o-mini"]}
This can then be applied to a config when constructing LLM_CONFIG with where method:
Model names can differ between OpenAI and Azure OpenAI, so tags offer an easy way to smooth over this inconsistency. Tags are a list of strings in the config_list, for example for the following config_list:
Then when filtering the config_list you can can specify the desired tags. A config is selected if it has at least one of the tags specified in the filter. For example, to just get the llama model, you can use the following filter:
In AG2, a deepcopy is used on llm_config to ensure that the llm_config passed by user is not modified internally. You may get an error if the llm_config contains objects of a class that do not support deepcopy. To fix this, you need to implement a __deepcopy__ method for the class.The below example shows how to implement a __deepcopy__ method for http client and add a proxy.
base_url: The base URL of the Azure OpenAI endpoint.
api_type: Should be set to “azure”.
api_version: The API version to use.
azure_ad_token_provider: Set to “DEFAULT” to use the default token provider.
Example of Initializing an Assistant Agent with AAD Auth
import autogen# Initialize the assistant agent with the AAD authenticated configwith llm_config: assistant = autogen.AssistantAgent(name="assistant")
Troubleshooting
If you encounter issues, check the following:
Ensure your Client ID and Tenant ID are correct.
Verify the permissions granted to your application.
Check network connectivity and Azure service status.
This documentation provides a complete guide to configure and use AAD authentication with Azure OpenAI in AG2.
Other configuration parameters
Besides the config_list, there are other parameters that can be used to configure the LLM. These are split between parameters specifically used by Autogen and those passed into the model client.
AG2 specific parameters
cache_seed - This is a legacy parameter and not recommended to be used unless the reason for using it is to disable the default caching behavior. To disable default caching, set this to None. Otherwise, by default or if an int is passed the DiskCache will be used. For the new way of using caching, pass a Cache object into initiate_chat.
Extra model client parameters
It is also possible to passthrough parameters through to the OpenAI client. Parameters that correspond to the OpenAI client or the OpenAI completions create API can be supplied.This is commonly used for things like temperature, or timeout.
get_config_list: Generates configurations for API calls, primarily from provided API keys.
config_list_openai_aoai: Constructs a list of configurations using both Azure OpenAI and OpenAI endpoints, sourcing API keys from environment variables or local files.
config_list_from_models: Creates configurations based on a provided list of models, useful when targeting specific models without manually specifying each configuration.
config_list_from_dotenv: Constructs a configuration list from a .env file, offering a consolidated way to manage multiple API configurations and keys from a single file.
See this notebook for examples of using the above functions.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"AG2","colors":{"primary":"#4b9cd6","light":"#63a9db","dark":"#338fd1"},"favicon":"/logo/favicon.svg","logo":{"light":"https://mintcdn.com/private-04b27de1/pvm3Z7mIWzwbwn7q/logo/ag2.svg?fit=max\u0026auto=format\u0026n=pvm3Z7mIWzwbwn7q\u0026q=85\u0026s=7e064e1c72768237baa4e260a7828dfe","dark":"https://mintcdn.com/private-04b27de1/pvm3Z7mIWzwbwn7q/logo/ag2-white.svg?fit=max\u0026auto=format\u0026n=pvm3Z7mIWzwbwn7q\u0026q=85\u0026s=5f3c0db50d8f566bd4448ae232799a59"},"navbar":{"primary":{"type":"github","href":"https://github.com/ag2ai/ag2"}},"search":{"prompt":"Search or ask..."},"seo":{"metatags":{"og:image":"https://media.githubusercontent.com/media/ag2ai/ag2/refs/heads/main/website/static/img/cover.png"},"indexing":"navigable"},"footer":{"socials":{"x":"https://x.com/ag2oss","github":"https://github.com/ag2ai/ag2","linkedin":"https://www.linkedin.com/company/ag2ai","discord":"https://discord.gg/pAbnFJrkgZ","youtube":"https://www.youtube.com/@ag2ai"}},"integrations":{"ga4":{"measurementId":"G-2GN2KN2CE4"}},"fonts":{"heading":{"family":"Jersey 10"},"body":{"family":"Inter"}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"private-04b27de1","hasAudioNarration":false,"actualSubdomain":"private-04b27de1","customDomains":[],"gitSource":{"type":"github","owner":"harishmohanraj","repo":"ag2","deployBranch":"mintlify-pages","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae9239d3e9b7a540d51da54:success","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"API References","count":879},{"language":"default","tag":"API Reference","count":879},{"language":"default","tag":"autogen","count":879},{"language":"default","tag":"agentchat","count":358},{"language":"default","tag":"Use Cases","count":264},{"language":"default","tag":"contrib","count":228},{"language":"default","tag":"User Guide","count":171},{"language":"default","tag":"tools","count":137},{"language":"default","tag":"Notebooks","count":128},{"language":"default","tag":"oai","count":125}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"mint-style.css","href":"/_mintlify/custom/private-04b27de1/8f3837c83da6c188/mint-style.css"}]}
{"page":{"pagePath":"docs/user-guide/advanced-concepts/llm-configuration-deep-dive","slug":"/docs/user-guide/advanced-concepts/llm-configuration-deep-dive","pageMetadata":{"title":"LLM Config Deep-dive","description":null,"href":"/docs/user-guide/advanced-concepts/llm-configuration-deep-dive"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Icon,Tab,Tabs,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Icon)_missingMdxReference(`Icon`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`In this deep-dive we run through the LLM configuration in depth, including the useful `,_jsx(_components.code,{children:`OAI_CONFIG_LIST`}),` file.`]}),`\n`,_jsx(Heading,{level:`1`,id:`llm-configuration`,children:`LLM Configuration`}),`\n`,_jsxs(_components.p,{children:[`In AG2, agents use LLMs as key components to understand and react. To configure an agent’s access to LLMs, you can specify an `,_jsx(_components.code,{children:`llm_config`}),` argument in its constructor. For example, the following snippet shows a configuration that uses `,_jsx(_components.code,{children:`gpt-4o`}),`:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` LLMConfig`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`llm_config `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` LLMConfig(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`api_type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"OPENAI_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`It is important to never commit secrets into your code, therefore we read the OpenAI API key from an environment variable.`})}),`\n`,_jsxs(_components.p,{children:[`This `,_jsx(_components.code,{children:`llm_config`}),` can then be passed to an agent’s constructor to enable it to use the LLM.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` llm_config:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` assistant `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen.AssistantAgent(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`2`,id:`introduction-to-config_list`,children:[`Introduction to `,_jsx(_components.code,{children:`config_list`})]}),`\n`,_jsxs(_components.p,{children:[`Different tasks may require different models, and the `,_jsx(_components.code,{children:`config_list`}),` allows specifying the different endpoints and configurations that are to be used. It is a list of dictionaries, each of which contains the following keys depending on the kind of endpoint being used:`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`OpenAI`,id:`openai`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`api_type`}),` (str, required): The model provider`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),` (str, required): The identifier of the model to be used, such as ‘gpt-4o’, ‘gpt-4o-mini’.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`api_key`}),` (str, optional): The API key required for authenticating requests to the model’s API endpoint.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`base_url`}),` (str, optional): The base URL of the API endpoint. This is the root address where API calls are directed.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`tags`}),` (List[str], optional): Tags which can be used for filtering.`]}),`\n`]}),_jsx(_components.p,{children:`Example:`}),_jsx(CodeBlock,{numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`os.environ`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`'OPENAI_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`]})})})]}),_jsxs(Tab,{title:`Azure OpenAI`,id:`azure-openai`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),` (str, required): The deployment to be used. The model corresponds to the deployment name on Azure OpenAI.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`api_key`}),` (str, optional): The API key required for authenticating requests to the model’s API endpoint.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`api_type`}),`: `,_jsx(_components.code,{children:`azure`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`base_url`}),` (str, optional): The base URL of the API endpoint. This is the root address where API calls are directed.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`api_version`}),` (str, optional): The version of the Azure API you wish to use.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`tags`}),` (List[str], optional): Tags which can be used for filtering.`]}),`\n`]}),_jsx(_components.p,{children:`Example:`}),_jsx(CodeBlock,{numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"my-gpt-4o-deployment\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"azure\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`os.environ`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`'AZURE_OPENAI_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://ENDPOINT.openai.azure.com/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"api_version\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2025-01-01\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`]})})})]}),_jsxs(Tab,{title:`Other OpenAI compatible`,id:`other-openai-compatible`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),` (str, required): The identifier of the model to be used, such as ‘llama-7B’.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`api_key`}),` (str, optional): The API key required for authenticating requests to the model’s API endpoint.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`base_url`}),` (str, optional): The base URL of the API endpoint. This is the root address where API calls are directed.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`tags`}),` (List[str], optional): Tags which can be used for filtering.`]}),`\n`]}),_jsx(_components.p,{children:`Example:`}),_jsx(CodeBlock,{numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"llama-7B\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"http://localhost:1234\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`]})})})]})]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`These will create a model client which assumes an OpenAI API (or compatible) endpoint. To use custom model clients, see `,_jsx(_components.a,{href:`https://github.com/ag2ai/ag2/blob/main/notebook/agentchat_custom_model.ipynb`,children:`here`}),`.`]})}),`\n`,_jsxs(Heading,{level:`3`,id:`oai_config_list-pattern`,children:[_jsx(_components.code,{children:`OAI_CONFIG_LIST`}),` pattern`]}),`\n`,_jsxs(_components.p,{children:[`A common, useful pattern used is to define this `,_jsx(_components.code,{children:`config_list`}),` via JSON (specified as a file or an environment variable set to a JSON-formatted string) and then use the `,_jsx(_components.code,{children:`from_json`}),` method to load it:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`llm_config `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen.LLMConfig.from_json(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` env`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"OAI_CONFIG_LIST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Or path=\"path/to/config.json\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Then, create the assistant agent with the config`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` llm_config:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` assistant `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen.AssistantAgent(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This can be helpful as it keeps all the configuration in one place across different projects or notebooks.`}),`\n`,_jsxs(_components.p,{children:[`This function interprets the `,_jsx(_components.code,{children:`env_or_file`}),` argument as follows:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`If `,_jsx(_components.code,{children:`env_or_file`}),` is an environment variable then:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`It will first try to load the file from the path specified in the environment variable.`}),`\n`,_jsx(_components.li,{children:`If there is no file, it will try to interpret the environment variable as a JSON string.`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`Otherwise, it will try to open the file at the path specified by `,_jsx(_components.code,{children:`env_or_file`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`why-is-it-a-list`,children:`Why is it a list?`}),`\n`,_jsx(_components.p,{children:`Being a list allows you to define multiple models that can be used by the agent. This is useful for a few reasons:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`If one model times out or fails, the agent can try another model.`}),`\n`,_jsx(_components.li,{children:`Having a single global list of models and filtering it based on certain keys (e.g. name, tag) in order to pass select models into a certain agent (e.g. use cheaper GPT 4o-mini for agents solving easier tasks)`}),`\n`,_jsxs(_components.li,{children:[`While the core agents, (e.g. conversable or assistant) do not have special logic around selecting configs, some of the specialized agents `,_jsx(_components.em,{children:`may`}),` have logic to select the best model based on the task at hand.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`how-does-an-agent-decide-which-model-to-pick-out-of-the-list`,children:`How does an agent decide which model to pick out of the list?`}),`\n`,_jsx(_components.p,{children:`An agent uses the very first model available in the “config_list” and makes LLM calls against this model. If the model fails (e.g. API throttling) the agent will retry the request against the 2nd model and so on until prompt completion is received (or throws an error if none of the models successfully completes the request). In general there’s no implicit/hidden logic inside agents that is used to pick “the best model for the task”. However, some specialized agents may attempt to choose “the best model for the task”. It is developers responsibility to pick the right models and use them with agents.`}),`\n`,_jsx(Heading,{level:`3`,id:`config-list-filtering`,children:`Config list filtering`}),`\n`,_jsx(_components.p,{children:`As described above the list can be filtered based on certain criteria. This is defined as a dictionary of key to filter on and values to filter by. For example, if you have a list of configs and you want to select the one with the model “gpt-4o-mini” you can use the following filter:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`filter_dict `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o-mini\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]}`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This can then be applied to a config when constructing `,_jsx(_components.code,{children:`LLM_CONFIG`}),` with `,_jsx(_components.code,{children:`where`}),` method:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`llm_config `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen.LLMConfig(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`path`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"OAI_CONFIG_LIST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).where(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`filter_dict)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Or, directly when loading the config list using `,_jsx(_components.code,{children:`from_json`}),`:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`llm_config `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen.LLMConfig.from_json(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`path`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"OAI_CONFIG_LIST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).where(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`filter_dict)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`4`,id:`tags`,children:`Tags`}),`\n`,_jsxs(_components.p,{children:[`Model names can differ between OpenAI and Azure OpenAI, so tags offer an easy way to smooth over this inconsistency. Tags are a list of strings in the `,_jsx(_components.code,{children:`config_list`}),`, for example for the following `,_jsx(_components.code,{children:`config_list`}),`:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`config_list `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"my-gpt-4o-deployment\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tags\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt4o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"llama-7B\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"http://127.0.0.1:8080\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tags\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"llama\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"local\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Then when filtering the `,_jsx(_components.code,{children:`config_list`}),` you can can specify the desired tags. A config is selected if it has at least one of the tags specified in the filter. For example, to just get the `,_jsx(_components.code,{children:`llama`}),` model, you can use the following filter:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`filter_dict `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tags\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"llama\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"another_tag\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`llm_config `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen.LLMConfig(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`config_list`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`config_list).where(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`filter_dict)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`assert`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` len`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(llm_config.config_list) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`adding-http-client-in-llm_config-for-proxy`,children:`Adding http client in llm_config for proxy`}),`\n`,_jsxs(_components.p,{children:[`In AG2, a deepcopy is used on llm_config to ensure that the llm_config passed by user is not modified internally. You may get an error if the llm_config contains objects of a class that do not support deepcopy. To fix this, you need to implement a `,_jsx(_components.code,{children:`__deepcopy__`}),` method for the class.`]}),`\n`,_jsxs(_components.p,{children:[`The below example shows how to implement a `,_jsx(_components.code,{children:`__deepcopy__`}),` method for http client and add a proxy.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`21`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`#!pip install httpx`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` httpx`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` LLMConfig`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` MyHttpClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`httpx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` __deepcopy__`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`self`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`memo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` self`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`config_list `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`llm_config `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` LLMConfig(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"my-gpt-4o-deployment\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` http_client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`MyHttpClient(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`proxy`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"http://localhost:8030\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`using-azure-active-directory-aad-authentication`,children:`Using Azure Active Directory (AAD) Authentication`}),`\n`,_jsx(_components.p,{children:`Azure Active Directory (AAD) provides secure access to resources and applications. Follow the steps below to configure AAD authentication for AG2.`}),`\n`,_jsx(Heading,{level:`4`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`An Azure subscription - `,_jsx(_components.a,{href:`https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account?icid=azurefreeaccount`,children:`Create one for free`}),`.`]}),`\n`,_jsx(_components.li,{children:`Access granted to the Azure OpenAI Service in the desired Azure subscription.`}),`\n`,_jsx(_components.li,{children:`Appropriate permissions to register an application in AAD.`}),`\n`,_jsx(_components.li,{children:`Custom subdomain names are required to enable features like Microsoft Entra ID for authentication.`}),`\n`,_jsxs(_components.li,{children:[`Azure CLI - `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/cli/azure/install-azure-cli`,children:`Installation Guide`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For more detailed and up-to-date instructions, please refer to the official `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/azure/ai-services/openai/`,children:`Azure OpenAI documentation`}),`.`]}),`\n`,_jsx(Heading,{level:`4`,id:`step-1-register-an-application-in-aad`,children:`Step 1: Register an Application in AAD`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Navigate to the `,_jsx(_components.a,{href:`https://azure.microsoft.com/en-us/get-started/azure-portal`,children:`Azure portal`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Go to `,_jsx(_components.code,{children:`Azure Active Directory`}),` > `,_jsx(_components.code,{children:`App registrations`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Click on `,_jsx(_components.code,{children:`New registration`}),`.`]}),`\n`,_jsx(_components.li,{children:`Enter a name for your application.`}),`\n`,_jsxs(_components.li,{children:[`Set the `,_jsx(_components.code,{children:`Redirect URI`}),` (optional).`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.code,{children:`Register`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For detailed instructions, refer to the official `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate`,children:`Azure AD Quickstart documentation`}),`.`]}),`\n`,_jsx(Heading,{level:`4`,id:`step-2-configure-api-permissions`,children:`Step 2: Configure API Permissions`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`After registration, go to `,_jsx(_components.code,{children:`API permissions`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.code,{children:`Add a permission`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Select `,_jsx(_components.code,{children:`Microsoft Graph`}),` and then `,_jsx(_components.code,{children:`Delegated permissions`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Add the necessary permissions (e.g., `,_jsx(_components.code,{children:`User.Read`}),`).`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For more details, see `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/entra/identity-platform/permissions-consent-overview`,children:`API permissions in Microsoft Graph`})]}),`\n`,_jsx(Heading,{level:`4`,id:`step-3-obtain-client-id-and-tenant-id`,children:`Step 3: Obtain Client ID and Tenant ID`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Go to `,_jsx(_components.code,{children:`Overview`}),` of your registered application.`]}),`\n`,_jsxs(_components.li,{children:[`Note down the `,_jsx(_components.code,{children:`Application (client) ID`}),` and `,_jsx(_components.code,{children:`Directory (tenant) ID`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For more details, visit `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate`,children:`Register an application with the Microsoft identity platform`})]}),`\n`,_jsx(Heading,{level:`4`,id:`step-4-configure-your-application`,children:`Step 4: Configure Your Application`}),`\n`,_jsxs(_components.p,{children:[`Use the obtained `,_jsx(_components.code,{children:`Client ID`}),` and `,_jsx(_components.code,{children:`Tenant ID`}),` in your application configuration. Here’s an example of how to do this in your configuration file:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`aad_config = {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"client_id\": \"YOUR_CLIENT_ID\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"tenant_id\": \"YOUR_TENANT_ID\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"authority\": \"https://login.microsoftonline.com/YOUR_TENANT_ID\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"scope\": [\"https://graph.microsoft.com/.default\"],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`4`,id:`step-5-authenticate-and-acquire-tokens`,children:`Step 5: Authenticate and Acquire Tokens`}),`\n`,_jsx(_components.p,{children:`Use the following code to authenticate and acquire tokens:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`15`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`from msal import ConfidentialClientApplication`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`app = ConfidentialClientApplication(`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` client_id=aad_config[\"client_id\"],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` client_credential=\"YOUR_CLIENT_SECRET\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` authority=aad_config[\"authority\"]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`result = app.acquire_token_for_client(scopes=aad_config[\"scope\"])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`if \"access_token\" in result:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` print(\"Token acquired\")`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`else:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` print(\"Error acquiring token:\", result.get(\"error\"))`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`For more details, refer to the `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/azure/api-management/api-management-authenticate-authorize-azure-openai`,children:`Authenticate and authorize in Azure OpenAI Service`}),` and `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/managed-identity`,children:`How to configure Azure OpenAI Service with Microsoft Entra ID authentication`}),`.`]}),`\n`,_jsx(Heading,{level:`4`,id:`step-6-configure-azure-openai-with-aad-auth-in-ag2`,children:`Step 6: Configure Azure OpenAI with AAD Auth in AG2`}),`\n`,_jsxs(_components.p,{children:[`To use AAD authentication with Azure OpenAI in AG2, configure the `,_jsx(_components.code,{children:`llm_config`}),` with the necessary parameters.`]}),`\n`,_jsx(_components.p,{children:`Here is an example configuration:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`11`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`from autogen import LLMConfig`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`llm_config = LLMConfig(`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` model=\"gpt-4\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` base_url=\"YOUR_BASE_URL\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` api_type=\"azure\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` api_version=\"2025-01-01\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` max_tokens=1000,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` azure_ad_token_provider=\"DEFAULT\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`For more details, refer to the `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/azure/api-management/api-management-authenticate-authorize-azure-openai`,children:`Authenticate and authorize in Azure OpenAI Service`}),` and `,_jsx(_components.a,{href:`https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/managed-identity`,children:`How to configure Azure OpenAI Service with Microsoft Entra ID authentication`}),`.`]}),`\n`,_jsx(_components.p,{children:`In this configuration:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),`: The Azure OpenAI deployment name.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`base_url`}),`: The base URL of the Azure OpenAI endpoint.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`api_type`}),`: Should be set to “azure”.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`api_version`}),`: The API version to use.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`azure_ad_token_provider`}),`: Set to “DEFAULT” to use the default token provider.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`4`,id:`example-of-initializing-an-assistant-agent-with-aad-auth`,children:`Example of Initializing an Assistant Agent with AAD Auth`}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`import autogen`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`# Initialize the assistant agent with the AAD authenticated config`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`with llm_config:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` assistant = autogen.AssistantAgent(name=\"assistant\")`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`4`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsx(_components.p,{children:`If you encounter issues, check the following:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Ensure your `,_jsx(_components.code,{children:`Client ID`}),` and `,_jsx(_components.code,{children:`Tenant ID`}),` are correct.`]}),`\n`,_jsx(_components.li,{children:`Verify the permissions granted to your application.`}),`\n`,_jsx(_components.li,{children:`Check network connectivity and Azure service status.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`This documentation provides a complete guide to configure and use AAD authentication with Azure OpenAI in AG2.`}),`\n`,_jsx(Heading,{level:`2`,id:`other-configuration-parameters`,children:`Other configuration parameters`}),`\n`,_jsxs(_components.p,{children:[`Besides the `,_jsx(_components.code,{children:`config_list`}),`, there are other parameters that can be used to configure the LLM. These are split between parameters specifically used by Autogen and those passed into the model client.`]}),`\n`,_jsx(Heading,{level:`3`,id:`ag2-specific-parameters`,children:`AG2 specific parameters`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`cache_seed`}),` - This is a legacy parameter and not recommended to be used unless the reason for using it is to disable the default caching behavior. To disable default caching, set this to `,_jsx(_components.code,{children:`None`}),`. Otherwise, by default or if an int is passed the DiskCache will be used. For the new way of using caching, pass a Cache object into `,_jsx(_components.code,{children:`initiate_chat`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`extra-model-client-parameters`,children:`Extra model client parameters`}),`\n`,_jsxs(_components.p,{children:[`It is also possible to passthrough parameters through to the OpenAI client. Parameters that correspond to the `,_jsxs(_components.a,{href:`https://github.com/openai/openai-python/blob/d231d1fa783967c1d3a1db3ba1b52647fff148ac/src/openai/_client.py#L67`,children:[_jsx(_components.code,{children:`OpenAI`}),` client`]}),` or the `,_jsxs(_components.a,{href:`https://github.com/openai/openai-python/blob/d231d1fa783967c1d3a1db3ba1b52647fff148ac/src/openai/resources/completions.py#L35`,children:[_jsx(_components.code,{children:`OpenAI`}),` completions create API`]}),` can be supplied.`]}),`\n`,_jsxs(_components.p,{children:[`This is commonly used for things like `,_jsx(_components.code,{children:`temperature`}),`, or `,_jsx(_components.code,{children:`timeout`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsx(CodeBlock,{numberOfLines:`21`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` LLMConfig`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`llm_config `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` LLMConfig(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` config_list`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"my-gpt-4o-deployment\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: os.environ.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"AZURE_OPENAI_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"azure\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: os.environ.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"AZURE_OPENAI_API_BASE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_version\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-02-01\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"llama-7B\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"http://127.0.0.1:8080\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` temperature`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.9`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 300`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`other-helpers-for-loading-a-config-list`,children:`Other helpers for loading a config list`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/api-reference/autogen/get_config_list`,children:_jsx(_components.code,{children:`get_config_list`})}),`: Generates configurations for API calls, primarily from provided API keys.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/api-reference/autogen/config_list_openai_aoai`,children:_jsx(_components.code,{children:`config_list_openai_aoai`})}),`: Constructs a list of configurations using both Azure OpenAI and OpenAI endpoints, sourcing API keys from environment variables or local files.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/api-reference/autogen/config_list_from_models`,children:_jsx(_components.code,{children:`config_list_from_models`})}),`: Creates configurations based on a provided list of models, useful when targeting specific models without manually specifying each configuration.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/api-reference/autogen/config_list_from_dotenv`,children:_jsx(_components.code,{children:`config_list_from_dotenv`})}),`: Constructs a configuration list from a `,_jsx(_components.code,{children:`.env`}),` file, offering a consolidated way to manage multiple API configurations and keys from a single file.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/docs/use-cases/notebooks/notebooks/config_loader_utility_functions`,children:`this notebook`}),` for examples of using the above functions.`]}),`\n`,_jsx(`div`,{className:`edit-url-container`,children:_jsxs(`a`,{className:`edit-url`,href:`https://github.com/ag2ai/ag2/edit/main/website/docs/user-guide/advanced-concepts/llm-configuration-deep-dive.mdx`,target:`_blank`,children:[_jsx(Icon,{icon:`pen`,iconType:`solid`,size:`13px`}),` Edit this page`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"LLM Config Deep-dive","description":null,"href":"/docs/user-guide/advanced-concepts/llm-configuration-deep-dive"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"LLM Configuration","slug":"llm-configuration","depth":1,"children":[]},{"title":"Introduction to config_list","slug":"introduction-to-config_list","depth":2,"children":[{"title":"OAI_CONFIG_LIST pattern","slug":"oai_config_list-pattern","depth":3,"children":[]},{"title":"Why is it a list?","slug":"why-is-it-a-list","depth":3,"children":[]},{"title":"How does an agent decide which model to pick out of the list?","slug":"how-does-an-agent-decide-which-model-to-pick-out-of-the-list","depth":3,"children":[]},{"title":"Config list filtering","slug":"config-list-filtering","depth":3,"children":[]},{"title":"Tags","slug":"tags","depth":4,"children":[]},{"title":"Adding http client in llm_config for proxy","slug":"adding-http-client-in-llm_config-for-proxy","depth":3,"children":[]},{"title":"Using Azure Active Directory (AAD) Authentication","slug":"using-azure-active-directory-aad-authentication","depth":3,"children":[]},{"title":"Prerequisites","slug":"prerequisites","depth":4,"children":[]},{"title":"Step 1: Register an Application in AAD","slug":"step-1-register-an-application-in-aad","depth":4,"children":[]},{"title":"Step 2: Configure API Permissions","slug":"step-2-configure-api-permissions","depth":4,"children":[]},{"title":"Step 3: Obtain Client ID and Tenant ID","slug":"step-3-obtain-client-id-and-tenant-id","depth":4,"children":[]},{"title":"Step 4: Configure Your Application","slug":"step-4-configure-your-application","depth":4,"children":[]},{"title":"Step 5: Authenticate and Acquire Tokens","slug":"step-5-authenticate-and-acquire-tokens","depth":4,"children":[]},{"title":"Step 6: Configure Azure OpenAI with AAD Auth in AG2","slug":"step-6-configure-azure-openai-with-aad-auth-in-ag2","depth":4,"children":[]},{"title":"Example of Initializing an Assistant Agent with AAD Auth","slug":"example-of-initializing-an-assistant-agent-with-aad-auth","depth":4,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":4,"children":[]}]},{"title":"Other configuration parameters","slug":"other-configuration-parameters","depth":2,"children":[{"title":"AG2 specific parameters","slug":"ag2-specific-parameters","depth":3,"children":[]},{"title":"Extra model client parameters","slug":"extra-model-client-parameters","depth":3,"children":[]}]},{"title":"Example","slug":"example","depth":2,"children":[]},{"title":"Other helpers for loading a config list","slug":"other-helpers-for-loading-a-config-list","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/private-04b27de1/eb75e01a19010b3e/docusaurus.config.js","/_mintlify/custom/private-04b27de1/2750b385f6fad3d7/mint-app-gallery-deps.js","/_mintlify/custom/private-04b27de1/00d416e040b2eaa6/mint-script.js"],"subdomain":"private-04b27de1","siteName":"AG2","title":"LLM Config Deep-dive - AG2","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"docs/user-guide/advanced-concepts/llm-configuration-deep-dive.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"AG2\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"LLM Config Deep-dive - AG2\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"AG2\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://media.githubusercontent.com/media/ag2ai/ag2/refs/heads/main/website/static/img/cover.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"LLM Config Deep-dive - AG2\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://media.githubusercontent.com/media/ag2ai/ag2/refs/heads/main/website/static/img/cover.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/private-04b27de1/5PK9RLmJtXeBrawe/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"AG2\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4b9cd6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/user-guide/advanced-concepts/llm-configuration-deep-dive.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://private-04b27de1.mintlify.app/#organization\",\"name\":\"AG2\",\"url\":\"https://private-04b27de1.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/private-04b27de1/pvm3Z7mIWzwbwn7q/logo/ag2.svg?fit=max\u0026auto=format\u0026n=pvm3Z7mIWzwbwn7q\u0026q=85\u0026s=7e064e1c72768237baa4e260a7828dfe\"}},{\"@type\":\"WebSite\",\"@id\":\"https://private-04b27de1.mintlify.app#website\",\"name\":\"AG2\",\"url\":\"https://private-04b27de1.mintlify.app\",\"publisher\":{\"@id\":\"https://private-04b27de1.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive#webpage\",\"url\":\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive\",\"name\":\"LLM Config Deep-dive\",\"isPartOf\":{\"@id\":\"https://private-04b27de1.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"User Guide\",\"item\":\"https://private-04b27de1.mintlify.app/docs/user-guide/basic-concepts/installing-ag2\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LLM Config Deep-dive\",\"item\":\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive#article\",\"headline\":\"LLM Config Deep-dive\",\"name\":\"LLM Config Deep-dive\",\"url\":\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive\",\"mainEntityOfPage\":{\"@id\":\"https://private-04b27de1.mintlify.app/docs/user-guide/advanced-concepts/llm-configuration-deep-dive#webpage\"},\"image\":\"https://media.githubusercontent.com/media/ag2ai/ag2/refs/heads/main/website/static/img/cover.png\",\"publisher\":{\"@id\":\"https://private-04b27de1.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://private-04b27de1.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"AG2\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"AG2\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/user-guide/advanced-concepts/llm-configuration-deep-dive.md","siteName":"AG2","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/docs/quick-start"}]},{"tab":"User Guide","groups":[{"group":"User Guide","pages":[{"title":"Installing AG2","href":"/docs/user-guide/basic-concepts/installing-ag2"},{"group":"Basic Concepts","pages":[{"title":"LLM Configuration: Powering Agent Intelligence","sidebarTitle":"LLM Configuration: Powering Agent Intelligence","href":"/docs/user-guide/basic-concepts/llm-configuration"},{"title":"ConversableAgent: Building Intelligent Agents","sidebarTitle":"ConversableAgent: Building Intelligent Agents","href":"/docs/user-guide/basic-concepts/conversable-agent"},{"title":"Human in the Loop: Adding Human Oversight","sidebarTitle":"Human in the Loop: Adding Human Oversight","href":"/docs/user-guide/basic-concepts/human-in-the-loop"},{"title":"Agent Orchestration: Coordinating Multiple Agents","sidebarTitle":"Agent Orchestration: Coordinating Multiple Agents","href":"/docs/user-guide/basic-concepts/introducing-group-chat"},{"title":"Tools: Extending Agent Capabilities","sidebarTitle":"Tools: Extending Agent Capabilities","href":"/docs/user-guide/basic-concepts/introducing-tools"},{"title":"Structured Outputs: Ensuring Consistent Responses","sidebarTitle":"Structured Outputs: Ensuring Consistent Responses","description":null,"href":"/docs/user-guide/basic-concepts/structured-outputs"}]},{"group":"Advanced Concepts","pages":[{"title":"LLM Config Deep-dive","href":"/docs/user-guide/advanced-concepts/llm-configuration-deep-dive"},{"group":"Agent Orchestration Deep Dive","pages":[{"title":"Orchestrating agents","sidebarTitle":"Overview","description":null,"href":"/docs/user-guide/advanced-concepts/orchestration/orchestrations"},{"title":"Two-Agent Chat","href":"/docs/user-guide/advanced-concepts/orchestration/two-agent-chat"},{"title":null,"href":"/docs/user-guide/advanced-concepts/orchestration/sequential-chat"},{"title":null,"href":"/docs/user-guide/advanced-concepts/orchestration/nested-chat"},{"group":"Group Chats","pages":[{"sidebarTitle":"Overview","title":null,"href":"/docs/user-guide/advanced-concepts/orchestration/group-chat/introduction"},{"sidebarTitle":"Tools and Functions","title":null,"href":"/docs/user-guide/advanced-concepts/orchestration/group-chat/agent-tools-functions"},{"sidebarTitle":"Context Variables","title":null,"href":"/docs/user-guide/advanced-concepts/orchestration/group-chat/context-variables"},{"title":null,"href":"/docs/user-guide/advanced-concepts/orchestration/group-chat/handoffs"},{"sidebarTitle":"Orchestration Patterns","title":null,"href":"/docs/user-guide/advanced-concepts/orchestration/group-chat/patterns"}]},{"group":"Swarm","pages":[{"title":"Swarm deprecation","href":"/docs/user-guide/advanced-concepts/orchestration/swarm/deprecation"}]},{"title":"Ending a chat","href":"/docs/user-guide/advanced-concepts/orchestration/ending-a-chat"},{"group":"Pattern Cookbook","pages":[{"title":"Pattern Cookbook","sidebarTitle":"Overview","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/overview"},{"title":"Context-Aware Routing","sidebarTitle":"Context-Aware Routing","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/context_aware_routing"},{"title":"Escalation","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/escalation"},{"title":"Feedback Loop","sidebarTitle":"Feedback Loop","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/feedback_loop"},{"title":"Hierarchical / Tree","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/hierarchical"},{"title":"Organic","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/organic"},{"title":"Pipeline / Sequential Processing","sidebarTitle":"Pipeline / Sequential","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/pipeline"},{"title":"Redundant","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/redundant"},{"title":"Star / Hub-and-Spoke","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/star"},{"title":"Triage with Tasks","sidebarTitle":"Triage with Tasks","href":"/docs/user-guide/advanced-concepts/pattern-cookbook/triage_with_tasks"}]}]},{"group":"Tools","pages":[{"sidebarTitle":"Tools","title":null,"href":"/docs/user-guide/advanced-concepts/tools/index"},{"title":"Overview","sidebarTitle":"Overview","href":"/docs/user-guide/advanced-concepts/tools/basics"},{"title":"Controlling Tool Use","sidebarTitle":"Controlling Use","href":"/docs/user-guide/advanced-concepts/tools/controlling-use"},{"title":"Tools with Secrets","href":"/docs/user-guide/advanced-concepts/tools/tools-with-secrets"},{"group":"Model Context Protocol","pages":[{"title":"MCP Clients","href":"/docs/user-guide/advanced-concepts/tools/mcp/client"}]},{"group":"Interoperability","pages":[{"title":"LangChain Tools Integration","sidebarTitle":"LangChain Tools Integration","href":"/docs/user-guide/advanced-concepts/tools/interop/langchain"},{"title":"CrewAI Tools Integration","sidebarTitle":"CrewAI Tools Integration","href":"/docs/user-guide/advanced-concepts/tools/interop/crewai"},{"title":"PydanticAI Tools Integration","sidebarTitle":"PydanticAI Tools Integration","href":"/docs/user-guide/advanced-concepts/tools/interop/pydanticai"}]}]},{"group":"RealtimeAgent","pages":[{"title":"Overview","href":"/docs/user-guide/advanced-concepts/realtime-agent/index"},{"title":"RealtimeAgent over WebSocket Audio Adapter","sidebarTitle":"WebSocket Audio Adapter","href":"/docs/user-guide/advanced-concepts/realtime-agent/websocket"},{"title":"RealtimeAgent over WebRTC","sidebarTitle":"WebRTC Integration","href":"/docs/user-guide/advanced-concepts/realtime-agent/webrtc"},{"title":"RealtimeAgent over Twilio Audio Adapter","sidebarTitle":"Twilio Audio Adapter","href":"/docs/user-guide/advanced-concepts/realtime-agent/twilio"}]},{"title":"RAG","href":"/docs/user-guide/advanced-concepts/rag"},{"title":"Code Execution","href":"/docs/user-guide/advanced-concepts/code-execution"}]},{"group":"Model Providers","pages":[{"title":"Amazon Bedrock","sidebarTitle":"Amazon Bedrock","href":"/docs/user-guide/models/amazon-bedrock"},{"title":"Anthropic","sidebarTitle":"Anthropic","href":"/docs/user-guide/models/anthropic"},{"title":"Cerebras","sidebarTitle":"Cerebras","href":"/docs/user-guide/models/cerebras"},{"title":"Cohere","sidebarTitle":"Cohere","href":"/docs/user-guide/models/cohere"},{"title":"DeepSeek","sidebarTitle":"DeepSeek","href":"/docs/user-guide/models/deepseek-v3"},{"title":"Google Gemini","sidebarTitle":"Google Gemini","href":"/docs/user-guide/models/google-gemini"},{"title":"Google Vertex AI","sidebarTitle":"Google Vertex AI","href":"/docs/user-guide/models/google-vertexai"},{"title":"Groq","sidebarTitle":"Groq","href":"/docs/user-guide/models/groq"},{"group":"LiteLLM Proxy Server","pages":[{"title":"Installation","sidebarTitle":"Installation","href":"/docs/user-guide/models/litellm-proxy-server/installation"},{"title":"LiteLLM with OpenAI","sidebarTitle":"LiteLLM with OpenAI","href":"/docs/user-guide/models/litellm-proxy-server/openai"},{"title":"LiteLLM with Azure","sidebarTitle":"LiteLLM with Azure","href":"/docs/user-guide/models/litellm-proxy-server/azure"},{"title":"LiteLLM with WatsonX","sidebarTitle":"LiteLLM with WatsonX","href":"/docs/user-guide/models/litellm-proxy-server/watsonx"}]},{"title":"LM Studio","sidebarTitle":"LM Studio","href":"/docs/user-guide/models/lm-studio"},{"title":"Mistral AI","sidebarTitle":"Mistral AI","href":"/docs/user-guide/models/mistralai"},{"title":"Ollama","sidebarTitle":"Ollama","href":"/docs/user-guide/models/ollama"},{"title":"OpenAI","sidebarTitle":"OpenAI","href":"/docs/user-guide/models/openai"},{"title":"Together AI","sidebarTitle":"Together AI","href":"/docs/user-guide/models/togetherai"},{"title":"vLLM","sidebarTitle":"vLLM","href":"/docs/user-guide/models/vLLM"}]},{"group":"Reference Agents","pages":[{"title":"Overview","href":"/docs/user-guide/reference-agents/index"},{"title":"CaptainAgent","sidebarTitle":"CaptainAgent","href":"/docs/user-guide/reference-agents/captainagent"},{"group":"Communication Platforms","pages":[{"title":"Communication Agents","sidebarTitle":"Overview","href":"/docs/user-guide/reference-agents/communication-platforms/overview"},{"title":"DiscordAgent","sidebarTitle":"DiscordAgent","href":"/docs/user-guide/reference-agents/communication-platforms/discordagent"},{"title":"SlackAgent","sidebarTitle":"SlackAgent","href":"/docs/user-guide/reference-agents/communication-platforms/slackagent"},{"title":"TelegramAgent","sidebarTitle":"TelegramAgent","href":"/docs/user-guide/reference-agents/communication-platforms/telegramagent"}]},{"title":"DocAgent","sidebarTitle":"DocAgent","href":"/docs/user-guide/reference-agents/docagent"},{"title":"DocAgent Performance","sidebarTitle":"DocAgent Performance","href":"/docs/user-guide/reference-agents/docagent-performance"},{"title":"ReasoningAgent","sidebarTitle":"ReasoningAgent","href":"/docs/user-guide/reference-agents/reasoningagent"},{"title":"DeepResearchAgent","sidebarTitle":"DeepResearchAgent","href":"/docs/user-guide/reference-agents/deepresearchagent"},{"title":"WebSurferAgent","sidebarTitle":"WebSurferAgent","href":"/docs/user-guide/reference-agents/websurferagent"},{"title":"WikipediaAgent","sidebarTitle":"WikipediaAgent","href":"/docs/user-guide/reference-agents/wikipediaagent"}]},{"group":"Reference Tools","pages":[{"title":"Overview","href":"/docs/user-guide/reference-tools/index"},{"group":"Google APIs","pages":[{"title":"YouTube Search Tool","href":"/docs/user-guide/reference-tools/google-api/youtube-search"},{"title":"Google Search Tool","href":"/docs/user-guide/reference-tools/google-api/google-search"},{"title":"Google Drive Tools","href":"/docs/user-guide/reference-tools/google-api/google-drive"}]},{"title":"Perplexity Search Tool","href":"/docs/user-guide/reference-tools/perplexity-search"},{"title":"Wikipedia Search Tools","href":"/docs/user-guide/reference-tools/wikipedia-search"},{"title":"Browser Use","href":"/docs/user-guide/reference-tools/browser-use"},{"title":"Deep Research","href":"/docs/user-guide/reference-tools/deep-research"},{"group":"Communication Platforms","pages":[{"title":"Discord Tools","href":"/docs/user-guide/reference-tools/communication-platforms/discord"},{"title":"Slack Tools","href":"/docs/user-guide/reference-tools/communication-platforms/slack"},{"title":"Telegram Tools","href":"/docs/user-guide/reference-tools/communication-platforms/telegram"}]},{"title":"Crawl4AI","sidebarTitle":"Crawl4AI","href":"/docs/user-guide/reference-tools/crawl4ai"}]}]}]},{"tab":"API References","pages":[{"title":"API References","href":"/docs/api-reference/autogen/overview"}]},{"tab":"Use Cases","pages":[{"title":"Use Cases","href":"/docs/use-cases/use-cases/customer-service"}]},{"tab":"User Stories","pages":[{"title":"User Stories","href":"/docs/user-stories/2025-04-30-Cegid-Pulse-OS"}]},{"tab":"Contribute","pages":[{"title":"Contribute","href":"/docs/contributor-guide/contributing"}]},{"tab":"FAQs","pages":[{"title":"FAQs","href":"/docs/faq/FAQ"}]},{"tab":"Ecosystem","pages":[{"title":"Ecosystem","href":"/docs/ecosystem/agentops"}]},{"tab":"Blog","pages":[{"title":"Blog","href":"/docs/blog/2025-05-07-AG2-Copilot-Integration"}]}]},"basePath":"","title":"LLM Config Deep-dive - AG2","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":[],"chunks":[]}