Skip to main content
QUICK REVIEW

[Paper Review] Prompto: An open source library for asynchronous querying of LLM endpoints

Ryan Sze-Yin Chan, Federico Nanni|arXiv (Cornell University)|Aug 12, 2024
Power Systems and TechnologiesEngineering3 citations
TL;DR

Prompto is an open-source Python library that enables asynchronous, concurrent querying of multiple LLM endpoints—both proprietary (e.g., OpenAI, Gemini) and self-hosted (e.g., Ollama, Hugging Face)—to accelerate comparative LLM research. By leveraging asynchronous I/O and per-API rate limit management, it achieves up to 36.55× speedup over synchronous querying, significantly improving efficiency and reproducibility in large-scale LLM evaluation workflows.

ABSTRACT

Recent surge in Large Language Model (LLM) availability has opened exciting avenues for research. However, efficiently interacting with these models presents a significant hurdle since LLMs often reside on proprietary or self-hosted API endpoints, each requiring custom code for interaction. Conducting comparative studies between different models can therefore be time-consuming and necessitate significant engineering effort, hindering research efficiency and reproducibility. To address these challenges, we present prompto, an open source Python library which facilitates asynchronous querying of LLM endpoints enabling researchers to interact with multiple LLMs concurrently, while maximising efficiency and utilising individual rate limits. Our library empowers researchers and developers to interact with LLMs more effectively and allowing faster experimentation, data generation and evaluation. prompto is released with an introductory video (https://youtu.be/lWN9hXBOLyQ) under MIT License and is available via GitHub (https://github.com/alan-turing-institute/prompto).

Motivation & Objective

  • To address the inefficiency and engineering overhead of manually coding interactions with multiple LLM APIs for comparative research.
  • To enable researchers to query multiple LLM endpoints simultaneously while respecting individual rate limits, reducing idle wait times.
  • To improve reproducibility in LLM evaluation by centralizing prompts and inputs in a single JSONL file and storing outputs in structured format.
  • To support both proprietary LMaaS and self-hosted models, including open-source models like Llama and Gemma, via a modular, extensible architecture.
  • To streamline large-scale LLM experimentation by enabling parallel processing of diverse models across different endpoints.

Proposed method

  • Uses Python's async/await pattern to send concurrent requests to multiple LLM endpoints without blocking.
  • Manages per-API rate limits dynamically, ensuring compliance and maximizing throughput.
  • Supports a unified input format via JSON Lines (JSONL), enabling mixed queries across different models and APIs in a single experiment file.
  • Integrates with both third-party LMaaS (e.g., OpenAI, Anthropic, Google Gemini) and self-hosted inference servers (e.g., Ollama, Hugging Face text-generation-inference).
  • Provides a modular, extensible codebase that allows easy addition of new API endpoints and model configurations.
  • Offers Jupyter Notebook tutorials and CLI tools to generate input files and support automated evaluation workflows.
Figure 1: Illustration of the folder structure of the pipeline data folder after a exp_1.jsonl experiment file has been processed while exp_2.jsonl and exp_3.jsonl are experiment files yet to be processed in the input folder. After processing exp_1.jsonl , a exp_1 folder is created in the output fol
Figure 1: Illustration of the folder structure of the pipeline data folder after a exp_1.jsonl experiment file has been processed while exp_2.jsonl and exp_3.jsonl are experiment files yet to be processed in the input folder. After processing exp_1.jsonl , a exp_1 folder is created in the output fol

Experimental results

Research questions

  • RQ1How can researchers efficiently query multiple LLM endpoints with varying rate limits in a single, scalable pipeline?
  • RQ2To what extent does asynchronous querying reduce total experiment runtime compared to synchronous approaches?
  • RQ3Can a unified, reproducible input format improve transparency and sharing of LLM evaluation experiments?
  • RQ4How does prompto’s performance scale when querying multiple models on the same API (e.g., OpenAI) in parallel?
  • RQ5What is the impact of prompto on the efficiency of comparative LLM studies involving both proprietary and self-hosted models?

Key findings

  • Prompto achieved a 2.08× speedup when querying 100 prompts per model across three different LLM endpoints (OpenAI, Gemini, Anthropic) using parallel asynchronous requests versus synchronous processing.
  • When querying three different models (gpt-3.5-turbo, gpt-4, gpt-4o) on the same OpenAI API, prompto achieved a 36.55× speedup over the synchronous baseline.
  • The runtime of prompto with parallel processing was dominated by the slowest model (gpt-4), confirming that performance is limited by the slowest endpoint, not the number of concurrent requests.
  • The library reduced total experiment time from 705.38 seconds (synchronous) to just 19.30 seconds (asynchronous) when querying three models on the OpenAI API at 500 QPM.
  • The use of a single JSONL input file enabled consistent, reproducible experiment definition across diverse models and APIs, with outputs stored in structured JSONL format for easy sharing and analysis.
  • Prompto’s architecture supports extensibility, with native support for both LMaaS and self-hosted models, and is designed to be easily extended for new APIs and multimodal model integration.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.