Skip to main content

A Python package that provides an easier user interface for multiple LLM providers.

Project description

azLLM: A Unified LLM Interface for Multi-Provider Access

azLLM is a Python package that provides a unified interface to work with multiple LLM providers including OpenAI, DeepSeek, Grok, Gemini, Meta's LLaMA, Anthropic, Ollama, and more.

NOTE: For advanced usage, see the full azLLM docuemntation and/or examples.


Features

  • One unified interface for all major LLM APIs
  • Batch and parallel prompt generation
  • Structured outputs (parsing) with Pydantic
  • Per-model configurations and lazy initialization
  • Clean error handling
  • .env-based API key management

Supported Clients

NOTE: If you would like to request support for additional LLMs, please open an issue on our GitHub page.

Installation

You can install the azLLM package via pip:

pip install azLLM

Prerequisites

  • Python 3.11+

  • Create a .env file to store your API keys. For example:

    OPENAI_API_KEY=your_openai_api_key
    DEEPSEEK_API_KEY=your_deepseek_api_key
    XAI_API_KEY=your_xai_api_key
    GEMINI_API_KEY=your_gemini_api_key
    ANTHROPIC_API_KEY=your_anthropic_api_key
    FIREWORKS_API_KEY=your_fireworks_api_key
    
  • Ollama must be installed and running locally to use Ollama models.

Quick Start

Basic Initialization

from azllm import azLLM
manager = azLLM()  # Instantiated with default parameters 

Generate Text from a Single Prompt

prompt = 'What is the captial of France?'
generated_text = manager.generate_text('openai', prompt)
print(generated_text)

Batch Generation

Generate responses for multiple prompts at once:

batch_prompts = [
    'What is the capital of France?',
    'Tell me a joke.'
    ]

results = manager.batch_generate('openai', batch_prompts)
for result in results:
    print(result)

Parallel Generation

Run a single prompt across multiple models simultaneously:

prompt = 'What is the capital of France?'
models = [
    'openai',
    'grok',
    'ollama']

results = manager.generate_parallel(prompt, models)
for model, result in results.items():
    print(f"Model: {model},\nResult: {result}\n")

License

MIT License

Citation

@misc{azLLM,
  title        = {azLLM},
  author       = {Hanif Sajid and Benjamin Radford and Yaoyao Dai and Jason Windett},
  year         = {2025},
  month        = apr,
  version      = {0.1.0},
  howpublished = {https://github.com/hanifsajid/azLLM},
  note         = {MIT License},
  abstract     = {azLLM is a Python package designed to interface with various large language models (LLMs) from different AI providers. It offers a unified interface for interacting with models from providers like OpenAI, DeepSeek, Grok, Gemini, Meta's Llama, Anthropic, Ollama, and others. The package allows for customizable configurations, batch generation, parallel generation, error handling, and the ability to parse structured responses from different models.}
}

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

azllm-0.1.1.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

azllm-0.1.1-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: azllm-0.1.1.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for azllm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1a7b353f1e42f38f34af02e81ceb376c9a25cd05420d1313148a77b5a4702b62
MD5 5309ae7268676188399af63346c48bc1
BLAKE2b-256 d397a95847b32b4c85af5f20450d706e4af150a89c8f1d8dd9e856b5ac476641

See more details on using hashes here.

File details

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

File metadata

  • Download URL: azllm-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for azllm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 176cc339db376c1d2ee99ac1abe260318250b61d33131f543f4e2279878cf686
MD5 8dc74b174d616c12f863cc86587196cd
BLAKE2b-256 ae52f4738a204772f74cc0bb3be1c5ae75270de41370f19e77faac2c08e724e4

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