Azure AI Foundry plugin for LLM - access Anthropic, Llama, Mistral and more via Azure
Project description
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_azure-2.1.tar.gz.
File metadata
- Download URL: llm_azure-2.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d71d5d90cf5efecd2d4f8f563ee6405232a3c2454c901bee9578fbd2c9c7f90
|
|
| MD5 |
58be67508c9f60ecfef0403f5f65831f
|
|
| BLAKE2b-256 |
3552847f80512b35f9f76520022c37e21f00a93f20becf266601ceeb25e72b2f
|
Provenance
The following attestation bundles were made for llm_azure-2.1.tar.gz:
Publisher:
publish.yml on fabge/llm-azure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_azure-2.1.tar.gz -
Subject digest:
5d71d5d90cf5efecd2d4f8f563ee6405232a3c2454c901bee9578fbd2c9c7f90 - Sigstore transparency entry: 788104094
- Sigstore integration time:
-
Permalink:
fabge/llm-azure@8d7ff59f1b487812fc427e8671d524ad09771c69 -
Branch / Tag:
refs/tags/2.1 - Owner: https://github.com/fabge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8d7ff59f1b487812fc427e8671d524ad09771c69 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_azure-2.1-py3-none-any.whl.
File metadata
- Download URL: llm_azure-2.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c55d2503fa1bfd18504c830aea40c21cc8ae168d3b22864005c38d399e2d0d28
|
|
| MD5 |
750197454f6d4e6d1094fae3249fd5a2
|
|
| BLAKE2b-256 |
8a7f34f10594da82f89cbf53f742444956c66ed963c3bba442c79f2db57dbc06
|
Provenance
The following attestation bundles were made for llm_azure-2.1-py3-none-any.whl:
Publisher:
publish.yml on fabge/llm-azure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_azure-2.1-py3-none-any.whl -
Subject digest:
c55d2503fa1bfd18504c830aea40c21cc8ae168d3b22864005c38d399e2d0d28 - Sigstore transparency entry: 788104110
- Sigstore integration time:
-
Permalink:
fabge/llm-azure@8d7ff59f1b487812fc427e8671d524ad09771c69 -
Branch / Tag:
refs/tags/2.1 - Owner: https://github.com/fabge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8d7ff59f1b487812fc427e8671d524ad09771c69 -
Trigger Event:
release
-
Statement type: