llm-azure
LLM plugin for Azure AI Foundry.
Why this plugin?
LLM has built-in support for OpenAI-compatible models via extra-openai-models.yaml, but it only supports API key authentication.
This plugin adds:
- Entra ID authentication - Use
az logininstead of managing API keys - Claude models on Azure - Access Anthropic models through Azure AI Foundry
If you only need API key authentication for OpenAI-compatible models, you don't need this plugin.
Installation
llm install llm-azure
# For Claude models:
llm install llm-azure[anthropic]
Quick Start
-
Login to Azure:
az login -
Create config file:
mkdir -p "$(dirname "$(llm logs path)")/azure"
-
Add models to
azure/config.yaml:- model_id: azure-gpt4o provider: openai model_name: gpt-4o endpoint: https://YOUR_RESOURCE.openai.azure.com/openai/v1/
-
Use it:
llm -m azure-gpt4o "Hello!"
Configuration
Models are configured in azure/config.yaml in your LLM config directory (find it with dirname "$(llm logs path)").
OpenAI-compatible models (GPT, Mistral, DeepSeek, Llama)
- model_id: azure-gpt4o
provider: openai
model_name: gpt-4o
endpoint: https://YOUR_RESOURCE.openai.azure.com/openai/v1/
aliases: [agpt]
- model_id: mistral-large
provider: openai
model_name: Mistral-Large-3
endpoint: https://YOUR_RESOURCE.openai.azure.com/openai/v1/
aliases: [mistral]
Claude models
Requires llm install llm-azure[anthropic].
- model_id: claude-opus
provider: anthropic
model_name: claude-opus-4-5
endpoint: https://YOUR_RESOURCE.openai.azure.com/anthropic/
aliases: [opus]
Configuration options
| Field | Required | Description |
|---|---|---|
model_id |
Yes | Name used with llm -m |
provider |
Yes | openai or anthropic |
model_name |
Yes | Model name as deployed in Azure |
endpoint |
Yes | Azure endpoint URL |
aliases |
No | Short names for the model |
api_key_name |
No | Use API key instead of Entra ID (see below) |
Authentication
Entra ID (default)
Uses DefaultAzureCredential from the Azure SDK. Make sure you're logged in:
az login
Your user needs the "Cognitive Services User" role on the Azure AI resource.
API Key
Add api_key_name to your model config:
- model_id: azure-gpt4o
provider: openai
model_name: gpt-4o
endpoint: https://YOUR_RESOURCE.openai.azure.com/openai/v1/
api_key_name: azure-prod
Then set the key (the name can be anything you choose):
llm keys set azure-prod
Multiple models can share the same key name.
Providers
| Provider | Models | SDK |
|---|---|---|
openai |
GPT, Mistral, DeepSeek, Llama, etc. | openai |
anthropic |
Claude | anthropic |
Migrating from v1.x
Version 2.0 has a new config format:
# Old format (v1.x)
- model_id: gpt-4o
model_name: gpt-4o
api_base: https://YOUR_RESOURCE.openai.azure.com/
api_version: '2024-12-01-preview'
# New format (v2.0)
- model_id: gpt-4o
provider: openai
model_name: gpt-4o
endpoint: https://YOUR_RESOURCE.openai.azure.com/openai/v1/
Changes:
api_base→endpoint(add/openai/v1/suffix)api_version→ removed (no longer needed)provider→ required (openaioranthropic)
Metadata
Release files for llm-azure 2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llm_azure-2.1.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_azure-2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.6 kB
Release files / llm_azure-2.1.tar.gz
| Download URL | llm_azure-2.1.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d71d5d90cf5efecd2d4f8f563ee6405232a3c2454c901bee9578fbd2c9c7f90
|
|
BLAKE2b-256 checksum How to use checksums |
3552847f80512b35f9f76520022c37e21f00a93f20becf266601ceeb25e72b2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 2, 2026.
Transparency logRelease files / llm_azure-2.1-py3-none-any.whl
| Download URL | llm_azure-2.1-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c55d2503fa1bfd18504c830aea40c21cc8ae168d3b22864005c38d399e2d0d28
|
|
BLAKE2b-256 checksum How to use checksums |
8a7f34f10594da82f89cbf53f742444956c66ed963c3bba442c79f2db57dbc06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 2, 2026.
Transparency log