Skip to main content

Just a simple mediator for different LLM models.

Project description

LLM Mediator

Just a simple mediator for different LLM models Will cache the response for the same input text during debug and save money for you.

Features

  • Cache
  • GPT-3.5
  • GPT-3.5-16k
  • GPT-4
  • GPT-4-32k
  • LLaMA2
  • Falcon

Quick Usage

Install:

pip install llm_mediator
# Install llm_mediator from github
pip install git+https://github.com/zeuscsc/llm_mediator.git

Usage:

model_name="GPT-4-32k"
model=LLM(GPT)
model.model_class.set_model_name(model_name)
response=model.get_response(system,assistant,user)

Where system, assistant, user are the input text, and response is the output text.

Set Environment Variables

Unix:

export OPENAI_API_KEY=your openai key (Nessary for GPT)
export TECKY_API_KEY=your tecky key (Nessary for GPT)

Windows:

$ENV:OPENAI_API_KEY="your openai key" (Nessary for GPT)
$ENV:TECKY_API_KEY="your tecky key" (Nessary for GPT)

Python: Create a

from llm_mediator import gpt
gpt.OPENAI_API_KEY="your openai key" (Nessary for GPT)
gpt.TECKY_API_KEY = "your tecky key" (Nessary for GPT)

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_Mediator-0.9.7.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

LLM_Mediator-0.9.7-py2.py3-none-any.whl (14.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file LLM_Mediator-0.9.7.tar.gz.

File metadata

  • Download URL: LLM_Mediator-0.9.7.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for LLM_Mediator-0.9.7.tar.gz
Algorithm Hash digest
SHA256 569a85fde8687b3e21d35ae64ffe865cd6b59280e1ca77f619535b43d780e497
MD5 fe3b7f7e26835e42c5fbdafa90ca0396
BLAKE2b-256 a0a7bfc1f7d3b2304703692632d96b9ac469a055b4e61cbbc30c473964730332

See more details on using hashes here.

File details

Details for the file LLM_Mediator-0.9.7-py2.py3-none-any.whl.

File metadata

  • Download URL: LLM_Mediator-0.9.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for LLM_Mediator-0.9.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0ff66b1f561f41abda678471e57fcaa51c3d9dac4b0a0cc20a7cb9a9c75237ee
MD5 ec6c9f0eb39f4f392cd6cfb63f1ff402
BLAKE2b-256 8fce2c0cb7dcaf14e47e30e216494f6965a748930a3eee2a390a81e20412a7c4

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