参考: https://github.com/saquibmansuri/CodeHub/tree/main/DockerComposeFiles/Open-WebUI/For-AzureOpenAI
https://uright.ca/blogs/2024-07-29-unlocking-the-power-of-azure-openai-on-open-webui/
1、配置好文件
创建目录 /home/litellm
创建一个名为litellm_config.yaml以下内容的新文件
model_list:
- model_name: azure-gpt-4o
litellm_params:
model: azure/gpt-4o
api_base: https://xxxxx.openai.azure.com/ # os.environ/AZURE_API_BASE # runs os.getenv("AZURE_API_BASE")
api_key: xxxxx #os.environ/AZURE_API_KEY # runs os.getenv("AZURE_API_KEY")
api_version: 2024-02-15-preview #os.environ/AZURE_API_VERSION # runs os.getenv("AZURE_API_VERSION")
2、利用docker安装litellm并启动
docker run -d \
-v /home/litellm//litellm_config.yaml:/app/config.yaml \
-p 4000:4000 \
--name litellm-proxy \
--restart always \
ghcr.io/berriai/litellm:main-latest \
--config /app/config.yaml
3、在open-webui添加配置