Skip to main content

A reusable library for LLM clients with LangChain framework

Project description

llm-clients

A reusable library for LLM clients with LangChain.

Supports OpenAI, Anthropic, Azure OpenAI, Google Gemini, and HuggingFace.

Install

# Core only
pip install llm-clients

# With specific provider(s)
pip install "llm-clients[openai]"
pip install "llm-clients[anthropic]"
pip install "llm-clients[azure]"
pip install "llm-clients[google]"
pip install "llm-clients[huggingface]"

# All providers
pip install "llm-clients[all]"

Quick start

from llm_clients import LLMClientFactory

# Create any LLM (reads API keys from env vars by default)
llm = LLMClientFactory.create("openai", model="gpt-4o")
llm = LLMClientFactory.create("anthropic")
llm = LLMClientFactory.create("azure", azure_deployment="...", azure_endpoint="...")
llm = LLMClientFactory.create("google", model="gemini-2.0-flash")
llm = LLMClientFactory.create("huggingface", repo_id="HuggingFaceH4/zephyr-7b-beta")

Environment variables

Variable Provider
OPENAI_API_KEY OpenAI
ANTHROPIC_API_KEY Anthropic
AZURE_OPENAI_API_KEY Azure
GOOGLE_API_KEY Google Gemini
HUGGINGFACEHUB_API_TOKEN HuggingFace

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_clients-0.1.2.tar.gz (4.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_clients-0.1.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file llm_clients-0.1.2.tar.gz.

File metadata

  • Download URL: llm_clients-0.1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for llm_clients-0.1.2.tar.gz
Algorithm Hash digest
SHA256 29d02de172de3c3b7e4ffef3388a6dc9ff08c8ccf33663b8db290205b6b63641
MD5 aba0ffafae493acdbe5202b10dc7fe34
BLAKE2b-256 e9b46b42551bfc5d0155355e89fbbaf587442d2ec7f6c5178df4eedd6d2349c0

See more details on using hashes here.

File details

Details for the file llm_clients-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: llm_clients-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for llm_clients-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c648a9d4c6080f123380fdec610307d70894f7caadfb23725e8f0bd7249f57
MD5 a6d70c18094a79fddfe77e9abba01e86
BLAKE2b-256 3d58f40ab9e568653544b3f1f719a744f5b7b81e862012f78888540a20d30f37

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