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
  • GPT-4-vision
  • 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. Or you can just follow the docs from OpenAi: ~~python generator=model.get_chat_completion(messages=messages,functions=functions,function_call=function_call,stream=True,temperature=0,completion_extractor=GPT.AutoGeneratorExtractor,print_chunk=False)

## Set Environment Variables
Unix:
~~~shell 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.11.tar.gz (12.7 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.11-py2.py3-none-any.whl (14.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: LLM_Mediator-0.9.11.tar.gz
  • Upload date:
  • Size: 12.7 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.11.tar.gz
Algorithm Hash digest
SHA256 361982adfdd9c78b1ee8daa560511351d86efaa6e8086ac0ee77e4cc6c26c905
MD5 f67f77a82888f4ad4186019f8608596d
BLAKE2b-256 7b721b958582a8e7662320af0ec5f14803313440501e6e6ee5e19f0fb135d0dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: LLM_Mediator-0.9.11-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.5 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.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 054a695d12f77a7c5e049f804c856042df946d9d70edf5001d17c27d7d4ffc35
MD5 a7d7803e998b649c53f33b69282bb1d5
BLAKE2b-256 11d33911c2b66fd28b3d09eff5a167c60f31666ed19ac1bea335330c3b4f667d

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