Azure AI Foundry provider for lmux
Project description
lmux-azure-foundry
Azure AI Foundry provider for lmux. Uses the openai SDK's AzureOpenAI client.
Supports chat completions, streaming, and embeddings.
Part of the lmux ecosystem: standardized interface, cost tracking on every response, and registry-based routing across providers.
Optional Extras
lmux-azure-foundry[identity]: Azure AD token authentication viaazure-identity
Auth
Three authentication methods:
API Key (default)
Set AZURE_FOUNDRY_API_KEY in your environment:
from lmux_azure_foundry import AzureFoundryProvider
provider = AzureFoundryProvider(endpoint="https://your-resource.openai.azure.com")
Azure AD Token
from lmux_azure_foundry import AzureFoundryProvider, AzureAdToken
provider = AzureFoundryProvider(
endpoint="https://your-resource.openai.azure.com",
auth=my_auth_returning_azure_ad_token,
)
Token Provider
from lmux_azure_foundry import AzureFoundryTokenAuthProvider
provider = AzureFoundryProvider(
endpoint="https://your-resource.openai.azure.com",
auth=AzureFoundryTokenAuthProvider(), # uses azure-identity DefaultAzureCredential
)
Usage
Chat
from lmux import UserMessage
response = provider.chat("gpt-4o", [UserMessage(content="Hello")])
print(response.content)
print(response.cost)
Streaming
for chunk in provider.chat_stream("gpt-4o", [UserMessage(content="Hello")]):
if chunk.delta:
print(chunk.delta, end="")
Embeddings
response = provider.embed("text-embedding-3-small", "Hello")
print(response.embeddings)
Async
All methods have async variants: achat, achat_stream, aembed.
Registry
Use with the lmux registry to route across multiple providers:
from lmux import Registry
registry = Registry()
registry.register("azure", provider)
response = registry.chat("azure/gpt-4o", messages)
Provider Params
from lmux_azure_foundry import AzureFoundryParams
response = provider.chat(
"gpt-4o",
messages,
provider_params=AzureFoundryParams(deployment_type="data_zone"),
)
| Parameter | Type | Description |
|---|---|---|
reasoning_effort |
"low" | "medium" | "high" |
Reasoning effort for o-series models |
seed |
int |
Deterministic sampling seed |
user |
str |
End-user identifier |
deployment_type |
"global" | "data_zone" | "regional" |
Affects cost calculation only, not sent to API |
Constructor Options
AzureFoundryProvider(
endpoint=..., # required, Azure resource endpoint
auth=..., # AuthProvider, default: AzureFoundryKeyAuthProvider()
api_version=..., # API version (default: "2024-12-01-preview")
timeout=..., # Request timeout in seconds
max_retries=..., # Max retry attempts
)
Project details
Release history Release notifications | RSS feed
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 lmux_azure_foundry-0.4.1.tar.gz.
File metadata
- Download URL: lmux_azure_foundry-0.4.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7b85ad5b4510ab1e2a594f1ac84347559b8d569f558f103fe60f6c6bc21cb2d
|
|
| MD5 |
29a6333a5d82a5719ca21583ba6fda9e
|
|
| BLAKE2b-256 |
71377b1a16f50fb2e620e9b4440ed5f698fdbee59bc8eaf805daa0454b5c42b4
|
Provenance
The following attestation bundles were made for lmux_azure_foundry-0.4.1.tar.gz:
Publisher:
publish.yml on cluebbehusen/lmux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lmux_azure_foundry-0.4.1.tar.gz -
Subject digest:
e7b85ad5b4510ab1e2a594f1ac84347559b8d569f558f103fe60f6c6bc21cb2d - Sigstore transparency entry: 1233832783
- Sigstore integration time:
-
Permalink:
cluebbehusen/lmux@8b8ea3f9843e43339043499c5b6a1eb8c46419b7 -
Branch / Tag:
refs/tags/lmux-azure-foundry-v0.4.1 - Owner: https://github.com/cluebbehusen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b8ea3f9843e43339043499c5b6a1eb8c46419b7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lmux_azure_foundry-0.4.1-py3-none-any.whl.
File metadata
- Download URL: lmux_azure_foundry-0.4.1-py3-none-any.whl
- Upload date:
- Size: 14.3 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 |
907ddaf0cb2d2ba0326ad1131ba6ede9e0fa24a28dc53bf50f17ff577eee818e
|
|
| MD5 |
02f08814279da0472c919dda7bc85a37
|
|
| BLAKE2b-256 |
70bb715f884617f084adaf0e3090f41fb409c4c5f97017d194eea9d8eb29f416
|
Provenance
The following attestation bundles were made for lmux_azure_foundry-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on cluebbehusen/lmux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lmux_azure_foundry-0.4.1-py3-none-any.whl -
Subject digest:
907ddaf0cb2d2ba0326ad1131ba6ede9e0fa24a28dc53bf50f17ff577eee818e - Sigstore transparency entry: 1233832808
- Sigstore integration time:
-
Permalink:
cluebbehusen/lmux@8b8ea3f9843e43339043499c5b6a1eb8c46419b7 -
Branch / Tag:
refs/tags/lmux-azure-foundry-v0.4.1 - Owner: https://github.com/cluebbehusen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b8ea3f9843e43339043499c5b6a1eb8c46419b7 -
Trigger Event:
push
-
Statement type: