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.5.tar.gz (12.1 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.5-py2.py3-none-any.whl (13.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: LLM_Mediator-0.9.5.tar.gz
  • Upload date:
  • Size: 12.1 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.5.tar.gz
Algorithm Hash digest
SHA256 9511f8527716ff46d71f71f6b5cf96ab4c22d45c9c1ac116ebab036675ce88bb
MD5 d3c501af3dfd5fd362015dc9672e5b6c
BLAKE2b-256 e38a309c7ba90780e930d4135edef1ead036536eee6217a7e6f243c3482dfeec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: LLM_Mediator-0.9.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.8 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.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5fe03abc5e41ca7ed64c850717b2f7555a1ef50637f5cc746e729da75da85c35
MD5 72905ad149fdb81c59d46a338e379be3
BLAKE2b-256 90f19282be2ef6706edd96d3d7eddd93f9ee306faa9c638d1a4f8ca6cd1ec323

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