diff --git a/README.md b/README.md index 0aae401b..007adcf0 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,9 @@ More details can be found in the [development setup](https://rdagent.readthedocs REASONING_THINK_RM=True ``` -- You can also use a deprecated backend if you only use `OpenAI API` or `Azure OpenAI` directly. For this deprecated setting and more configuration information, please refer to the [documentation](https://rdagent.readthedocs.io/en/latest/installation_and_configuration.html). + You can also use a deprecated backend if you only use `OpenAI API` or `Azure OpenAI` directly. For this deprecated setting and more configuration information, please refer to the [documentation](https://rdagent.readthedocs.io/en/latest/installation_and_configuration.html). + + ### 🚀 Run the Application diff --git a/docs/installation_and_configuration.rst b/docs/installation_and_configuration.rst index 202ac5a9..112b6394 100644 --- a/docs/installation_and_configuration.rst +++ b/docs/installation_and_configuration.rst @@ -107,6 +107,46 @@ Besides, when you are using reasoning models, the response might include the tho For more details on LiteLLM requirements, refer to the `official LiteLLM documentation `_. +Configuration Example 2: Azure OpenAI Setup +------------------------------------------- +Here’s a sample configuration specifically for Azure OpenAI, based on the `official LiteLLM documentation `_: + +If you're using Azure OpenAI, below is a working example using the Python SDK, following the `LiteLLM Azure OpenAI documentation `_: + + .. code-block:: Properties + + from litellm import completion + import os + + # Set Azure OpenAI environment variables + os.environ["AZURE_API_KEY"] = "" + os.environ["AZURE_API_BASE"] = "" + os.environ["AZURE_API_VERSION"] = "" + + # Make a request to your Azure deployment + response = completion( + "azure/", + messages = [{ "content": "Hello, how are you?", "role": "user" }] + ) + +To align with the Python SDK example above, you can configure the `CHAT_MODEL` based on the `response` model setting and use the corresponding `os.environ` variables by writing them into your local `.env` file as follows: + + .. code-block:: Properties + + cat << EOF > .env + # CHAT MODEL: Azure OpenAI via LiteLLM + CHAT_MODEL=azure/ + AZURE_API_BASE=https://.openai.azure.com/ + AZURE_API_KEY= + AZURE_API_VERSION= + + # EMBEDDING MODEL: Using SiliconFlow via litellm_proxy + EMBEDDING_MODEL=litellm_proxy/BAAI/bge-large-en-v1.5 + LITELLM_PROXY_API_KEY= + LITELLM_PROXY_API_BASE=https://api.siliconflow.cn/v1 + EOF + +This configuration allows you to call Azure OpenAI through LiteLLM while using an external provider (e.g., SiliconFlow) for embeddings. Configuration(deprecated) =========================