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.1.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.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_azure_openai-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 c3f8ab34820df61eea7c4df4241ca0a5d3f52f7e472c9b3963b8dc1fd6183354
MD5 ee563fffec8bb5f23ff5a5397ad0de1e
BLAKE2b-256 1acf21a8ed10852cea4eabbe8d64083b600a5929c027da7ea91f8c50794c3560

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llm_azure_openai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4649d5f902785d23c38b85b9c4392b155c8b87d2256eda6b19a685787511aaea
MD5 cf440421a47c909fb89c7b99c3ca9f9c
BLAKE2b-256 7571c9be3df02a26eca7ff5df76b86a52a0bb1ebebbb1b3e9050bd1b547c56a2

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