Portkey-AI / gateway

A Blazing Fast AI Gateway. Route to 200+ LLMs with 1 fast & friendly API.
https://portkey.ai/features/ai-gateway
MIT License
5.21k stars 356 forks source link

Need help with azure config #389

Closed haouarihk closed 1 month ago

haouarihk commented 1 month ago

What Happened?

I searched the documentation extensively but could not find any information on configuring azure-openai in the config object.

What Should Have Happened?

The documentation should include detailed guidance on configuring azure-openai.

Relevant Code Snippet

here's my config example

{
  "strategy": {
    "mode": "loadbalance"
  },
  "targets": [
    {
      "provider": "openai",
      "api_key": "sk-proj-",
      "weight": 1
    },
    {
      "provider": "azure-openai",
      "api_key": "sk-proj-",
      "azureResourceName": "AZURE_RESOURCE_NAME",
      "azureDeploymendId": "AZURE_DEPLOYMENT_NAME",
      "azureApiVersion": "AZURE_API_VERSION",
      "weight": 1
    }
  ]
}

Your Twitter/LinkedIn

@haouarihk

vrushankportkey commented 1 month ago

Hey @haouarihk, sorry for that! Here's the config for Azure that should work:

{
  "strategy": {
    "mode": "loadbalance"
  },
  "targets": [
    {
      "provider": "openai",
      "api_key": "sk-proj-",
      "weight": 1
    },
    {
      "provider": "azure-openai",
      "api_key": "sk-proj-",
      "resource_name": "AZURE_RESOURCE_NAME",
      "deployment_id": "AZURE_DEPLOYMENT_NAME",
      "api_version": "AZURE_API_VERSION",
      "weight": 1
    }
  ]
}

Also updating on the docs. Thanks for the nudge!