Skip to main content

LLM plugin implementing Andrej Karpathy's model consortium tweet

Project description

LLM Consortium Plugin

A plugin for the llm package that enables managing a consortium of language models with arbitration capabilities. This plugin allows you to:

  • Send prompts to multiple language models simultaneously
  • Collect and evaluate responses based on confidence levels
  • Use an arbiter model to select or synthesize the best response
  • Track interaction history and model performance

Installation

pip install llm-consortium

Usage

llm -m consortium "Your prompt" --model gpt-4 --model claude-3 --arbiter-model claude-3-sonnet-20240307

Or programmatically:

import llm
from llm.plugins.consortium import ConsortiumPlugin

consortium = ConsortiumPlugin()
result = await consortium.run_consortium(
    prompt="Your prompt",
    models=["gpt-4", "claude-3"],
    arbiter_model="claude-3-sonnet-20240307",
    confidence_threshold=0.9,
    max_iterations=2
)
print(result.response)

Features

  • Asynchronous model execution
  • Confidence-based response selection
  • Automatic arbitration for low-confidence responses
  • CSV-based interaction logging
  • Configurable confidence thresholds and iteration limits

License

MIT License

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_consortium-0.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

llm_consortium-0.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file llm_consortium-0.1.tar.gz.

File metadata

  • Download URL: llm_consortium-0.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for llm_consortium-0.1.tar.gz
Algorithm Hash digest
SHA256 a5a2677cdb7782323e89b9a9ab147fe603a1beb18e523b5aebbd5929f3e62e59
MD5 23f9123de2d92e6e05cba1fe84e812dd
BLAKE2b-256 a325f5bcc4bca271d41f166856a17156a961184e1c18877e2a1cb37c325c6676

See more details on using hashes here.

File details

Details for the file llm_consortium-0.1-py3-none-any.whl.

File metadata

  • Download URL: llm_consortium-0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for llm_consortium-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 566cb73192157eba73496faeb6f8e04ad5cc07a0cff65b888e76eecbc75f825e
MD5 3676a6b726ea341fae5fe533acad41ea
BLAKE2b-256 8c866ebfd57ae5e6815b1d8abfe34c5abdabb4341ce1ea0abf3db0a85602b937

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