Using Azure OpenAI with Janito
Janito supports models hosted on Azure OpenAI in addition to OpenAI-compatible and OpenRouter endpoints.
Configuration Steps
-
Enable Azure OpenAI support: Set
use_azure_openai
totrue
in your configuration (local or global):bash janito --set-local-config use_azure_openai=true # or janito --set-global-config use_azure_openai=true
-
Set your Azure OpenAI endpoint: Set the
base_url
to your Azure OpenAI endpoint, for example:https://YOUR-RESOURCE-NAME.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT-NAME
-
Set your Azure API key: Use
--set-api-key
or add it to your config file:bash janito --set-api-key YOUR_AZURE_OPENAI_KEY
-
(Optional) Set API version: If you need a specific API version, set
azure_openai_api_version
(default:2023-05-15
).bash janito --set-local-config azure_openai_api_version=2023-05-15
Example Configuration
Here is an example of the relevant configuration keys:
api_key = "YOUR_AZURE_OPENAI_KEY"
base_url = "https://YOUR-RESOURCE-NAME.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT-NAME"
use_azure_openai = true
azure_openai_api_version = "2023-05-15" # Optional
Notes
- You can use either local or global config for these settings.
- For more information, see the main README and release notes.