Skip to main content

A Python library for making asynchronous LLM calls

Project description

async-llms: A Python Library for Asynchronous LLM Calls

async-llms is a Python library for making asynchronous LLM calls to accelerate LLM evaluation experiments.

Installation

You can install the package using pip:

pip install async-llms

Usage

Set API Key

Set the API key for the LLM provider you want to use.

export OPENAI_API_KEY="your_api_key"
export GOOGLE_API_KEY="your_api_key"

Command Line Interface

You can use the package directly from the command line:

async-llms \
    --api_type "openai" \
    --input_jsonl "path/to/input.jsonl" \
    --output_jsonl "path/to/output.jsonl" \
    --num_parallel_tasks "num_parallel_tasks"

Input Format

The input JSONL file format is identical to the one used in OpenAI's Batch API: https://platform.openai.com/docs/guides/batch

{
    "custom_id": "unique_id_for_this_request",
    "body": {
        // Your LLM request parameters here
    }
}

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

async_llms-0.1.5.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

async_llms-0.1.5-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file async_llms-0.1.5.tar.gz.

File metadata

  • Download URL: async_llms-0.1.5.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for async_llms-0.1.5.tar.gz
Algorithm Hash digest
SHA256 3deffa59f4b26e30979ad19db58290d064b4e8597e9cff3fafe584a4de2e6bf8
MD5 7b725842ddf41967e6eaf943fd2e631b
BLAKE2b-256 66105fa4a42f00fcc2a48161042a686411c9fb3cd82967f3bb56a13acd5318a4

See more details on using hashes here.

File details

Details for the file async_llms-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: async_llms-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for async_llms-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0b13ed85bab5d2ceb1d0dc4dcf189b48fa5dbad7a7f3b9bc427c02097c6e5043
MD5 65c96bbd542198913dcc28c9568dfd54
BLAKE2b-256 60f77da705e4bd4812d916eb9e5441bb24a956e4f79abe24bd9a487f02c3f119

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