Skip to main content

Init LLM

A toolkit for initializing LLMs(Langchain) and embeddings with multiple providers. All models are openai compatible.

Installation

pip install init-llm

Quick Start

from init_llm import ChatLLM, EmbeddingLLM

# Initialize chat model
llm = ChatLLM('openai')  # or 'azure', 'anthropic', etc.
response = llm.invoke('Hello!')

# Initialize embeddings
embeddings = EmbeddingLLM('text-embedding-3-small')
vector = embeddings.embed_query('Hello world')

Configuration

The package uses two configuration files:

  • model_providers.toml: Model configurations and provider settings
  • .env: API keys and other sensitive information

Auto Configuration

On first use, the package will:

  1. Check for configuration files in the working directory
  2. If not found, create them automatically with default settings
  3. Load environment variables from .env

Custom Configuration

You can specify custom configuration location and env file name:

llm = ChatLLM(
    'openai',
    config_dir='/path/to/config',
    env_file='custom.env'
)

See Supported Providers in model_providers.toml

License

MIT

Metadata

Release files for init-llm 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for init-llm 0.1.3
File Size Uploaded
init_llm-0.1.3.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for init-llm 0.1.3
File Interpreter ABI Platform
init_llm-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / init_llm-0.1.3.tar.gz

Download URL init_llm-0.1.3.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1b3e3203a4f09e7093d1685dcc7167737b41389aa1ea8890dfa6b5a4c1cd5a55
BLAKE2b-256 checksum
How to use checksums
08820e61c8934174cd24ae15809ed404660e2dcffb916e26fbd9f308552fe37e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Release files / init_llm-0.1.3-py3-none-any.whl

Download URL init_llm-0.1.3-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62fe220f2ef0e5e216ecb10ade92c4bb2a196285858eae83210d40ad7348c3d2
BLAKE2b-256 checksum
How to use checksums
1082a2b3befdddc46f50ce3d06efdc264ee6d618e843e43e616381bc81e90864
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page