Skip to main content

PromptLab is a free, lightweight, open-source experimentation tool for Gen AI applications.

Project description

logo

PromptLab

A free, lightweight, open-source experimentation tool for Gen AI applications

PyPI Version License GitHub Stars

📋 Table of Contents

Overview 🔍

PromptLab is a free, lightweight, open-source experimentation tool for Gen AI applications. It streamlines prompt engineering, making it easy to set up experiments, evaluate prompts, and track them in production - all without requiring any cloud services or complex infrastructure.

With PromptLab, you can:

  • Create and manage prompt templates with versioning
  • Build and maintain evaluation datasets
  • Run experiments with different models and prompts
  • Evaluate model and prompt performance using built-in and custom metrics
  • Compare experiment results side-by-side
  • Deploy optimized prompts to production
PromptLab Studio

Features ✨

  • Truly Lightweight: No cloud subscription, no additional servers, not even Docker - just a simple Python package
  • Easy to Adopt: No ML or Data Science expertise required
  • Self-contained: No need for additional cloud services for tracking or collaboration
  • Seamless Integration: Works within your existing web, mobile, or backend project
  • Flexible Evaluation: Use built-in metrics or bring your own custom evaluators
  • Web Interface: Compare experiments and track assets through a web interface
  • Multiple Model Support: Works with Azure OpenAI, Ollama, DeepSeek and more. You can also bring your ownd model.
  • Version Control: Automatic versioning of all assets for reproducibility
  • Async Support: Run experiments and invoke models asynchronously for improved performance

Installation 📦

pip install promptlab

It's recommended to use a virtual environment:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install promptlab

Quick Start 🚀

Check the quick start example here - samples/quickstart

Core Concepts 🧩

Tracer

Tracer is responsible for persisting and updating assets and experiments in the storage layer. At present, only SQLite is supported.

Assets

Immutable artifacts used in experiments, with automatic versioning:

  • Prompt Templates: Prompts with optional placeholders for dynamic content
  • Datasets: JSONL files containing evaluation data

Experiments

Evaluate prompts against datasets using specified models and metrics.

PromptLab Studio

A web interface for visualizing experiments and comparing results.

Documentation 📖

For comprehensive documentation, visit our Documentation Page.

Key documentation:

Supported Models 🤖

  • Azure OpenAI: Connect to Azure-hosted OpenAI models
  • Ollama: Run experiments with locally-hosted models
  • OpenRouter: Access a wide range of AI models (OpenAI, Anthropic, DeepSeek, Mistral, etc.) via OpenRouter API
  • Custom Models: Integrate your own model implementations

Examples 📚

Articles & Tutorials 📝

CI/CD 🔄

PromptLab uses GitHub Actions for continuous integration and testing:

  • Unit Tests: Run unit tests for all components of PromptLab
  • Integration Tests: Run integration tests that test the interaction between components
  • Performance Tests: Run performance tests to ensure performance requirements are met

The tests are organized into the following directories:

  • tests/unit/: Unit tests for individual components
  • tests/integration/: Tests that involve multiple components working together
  • tests/performance/: Tests that measure performance
  • tests/fixtures/: Common test fixtures and utilities

You can find more information about the CI/CD workflows in the .github/workflows directory.

Contributing 👥

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

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

promptlab-0.1.2.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

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

promptlab-0.1.2-py3-none-any.whl (48.4 kB view details)

Uploaded Python 3

File details

Details for the file promptlab-0.1.2.tar.gz.

File metadata

  • Download URL: promptlab-0.1.2.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for promptlab-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c97b6cd9a6c6bf586b47748cd099e1002b4691954bcd7209db4c456f20f1282f
MD5 1a01cca56831ecdc97789b88cba34101
BLAKE2b-256 8197d560d7660d815f405bf9cfda9ca1769e4ddcc49dd8f9ace6c261e5c0854d

See more details on using hashes here.

File details

Details for the file promptlab-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: promptlab-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 48.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for promptlab-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4cb492a13ee9b6af2a8ee71797b57a1f97c72feab849b195353b5e6a357a99b
MD5 69c699b0036f27eae1ea649cf37cf07a
BLAKE2b-256 8e92fb54b187bf19fc6f721e958de2769949ae55f8b38f4bc7915b0c14589942

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