Skip to main content

Loads a Langchain LLM by model name as a string.

Project description

pypi

Loads a Langchain LLM by model name as a string.

Installation

pip install llmloader

Or install from GitHub directly:

pip install git+https://github.com/rbturnbull/llmloader.git

Usage

Load the LLM with the llmloader.load function. e.g.

import llmloader

llm = llmloader.load("gpt-4o")
result = llm.invoke("Write me a haiku about love")

llm = llmloader.load("claude-3-5-sonnet-20240620")
result = llm.invoke("Write me a haiku about love")

llm = llmloader.load("grok-2-latest")
result = llm.invoke("Write me a haiku about love")

llm = llmloader.load("mistral-small-latest")
result = llm.invoke("Write me a haiku about love")

llm = llmloader.load("meta-llama/Llama-3.3-70B-Instruct")
result = llm.invoke("Write me a haiku about love")

CLI

You can test out prompts and models on the command line. Make sure you have your API keys set in your environment or add the key with the --api-key flag.

llmloader "Write me a haiku about love" --model gpt-4o-mini
llmloader "Write me a haiku about love" --model gpt-4o
llmloader "Write me a haiku about love" --model claude-3-5-sonnet-20240620
llmloader "Write me a haiku about love" --model grok-2-latest
llmloader "Write me a haiku about love" --model mistral-small-latest
llmloader "Write me a haiku about love" --model meta-llama/Meta-Llama-3-8B-Instruct
llmloader "Write me a haiku about love" --model meta-llama/Llama-3.3-70B-Instruct
llmloader --help

Credit

Robert Turnbull (Melbourne Data Analytics Platform, University of Melbourne)

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

llmloader-0.1.3.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

llmloader-0.1.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file llmloader-0.1.3.tar.gz.

File metadata

  • Download URL: llmloader-0.1.3.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for llmloader-0.1.3.tar.gz
Algorithm Hash digest
SHA256 23f9038e83cd416e0d060307476c53f9aa0dffb12e89484ab941157f22ba669f
MD5 3eaf608015c448b63b89407ed1508f22
BLAKE2b-256 11cdee23340ddda8045e9d027e00ab9b7bc573f1c02256a2c0e9cdf990e2b761

See more details on using hashes here.

File details

Details for the file llmloader-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: llmloader-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for llmloader-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4c067fbdc88f85a19e3c834b78bf9bb882c1a617e2a134ec7fdabb4bf3fd2901
MD5 19cd417e388672196f9177bf6d6c6d3e
BLAKE2b-256 3504476145c9a1b026fed9979b4c3199f2a5fe0301aac7dea63ef27c3cce9707

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