Skip to main content

LLM plugin to access Azure OpenAI models

Project description

llm-azure-openai

PyPI Changelog Tests License

API access to Microsoft's Azure OpenAI models

Installation

Install this plugin in the same environment as LLM.

llm install llm-azure-openai

Usage

Export the environment variables:

export AZURE_TENANT_ID='...'
export AZURE_CLIENT_ID='...'
export AZURE_CLIENT_SECRET='...'

Configure the models you want to use from your deployments

On Mac: ~/Library/Application Support/io.datasette.llm/azure-openai-models.yaml

On Linux: ~/.config/io.datasette.llm/azure-openai-models.yaml

- model_id: o3-mini
  model_name: o3-mini
  azure_endpoint: https://example.openai.azure.com
  api_version: '2024-12-01-preview'
  aliases: ['azure-o3-mini']
  use_azure_ad: true
- model_id: gpt-35-turbo-blue
  model_name: gpt-35-turbo-blue
  azure_endpoint: https://example.openai.azure.com
  api_version: '2024-02-01'
  aliases: ['azure-gpt-35']
  use_azure_ad: true

Now run the model using -m your-model, for example:

llm -m azure-o3-mini "..."

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-azure-openai
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

llm install -e '.[test]'

To run the tests:

pytest

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

llm_azure_openai-0.1.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_azure_openai-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file llm_azure_openai-0.1.0.tar.gz.

File metadata

  • Download URL: llm_azure_openai-0.1.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for llm_azure_openai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e97c8e57ffe8e2ed522d8a994227a4319f757465e3807835505dd0803be2208
MD5 07948215b287943b367fb8642240bbb5
BLAKE2b-256 bd0cc7d2daf225a452444f5ca94a6e02e08f8adac1e0104bd041a388fcfc33cc

See more details on using hashes here.

File details

Details for the file llm_azure_openai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_azure_openai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ee94bf499bae81bd12501e2c37124f0f9d7de0a61bbdda32dfd97f1672a379b
MD5 2cb325db10587395572c00514e84ad77
BLAKE2b-256 566398fcf990d2bb6d326bd584ed4e7db9baafbb0e433009b905190f25589f56

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page