Skip to main content

An open-source prompt engineering framework.

Project description

Lilypad

An open-source LLM engineering platform built on these principles:

  • Building with LLMs introduces non-determinisim to your code, which requires...
  • Tracking all input/output pairs and the exact version of the code that produced them so you can...
  • Continuously evaluate and optimize your code, which requires...
  • Involving business users and domain experts.

[!IMPORTANT] Lilypad is still in beta

This means that things like the user interface, database schemas, etc. are still subject to change. We do not yet recommend fully relying on this project in production, but we've found it works quite well in its current stage.

If you're interested in participating in the closed beta of Lilypad Pro, join our community and DM William Bakst :)

We also welcome contributions with open arms! If you're interested in contributing, just do it! We're here to help.

Quickstart

To get started with Lilypad:

  1. Create an account at https://app.lilypad.so. You can also run Lilypad locally if you'd prefer.
  2. Navigate to your organization settings
  3. Create a project, and then create an API key for that project. a. Save your LILYPAD_PROJECT_ID and LILYPAD_API_KEY (e.g. in a .env file).
  4. Install Lilypad: uv add "python-lilypad[openai]" # specify your provider of choice
  5. Run your first generation:
import os

import lilypad
from openai import OpenAI  # use your provider of choice

os.environ["LILYPAD_PROJECT_ID"] = "..."
os.environ["LILYPAD_API_KEY"] = "..."
os.environ["OPENAI_API_KEY"] = "..."

lilypad.configure()    # Automatically trace LLM API calls
client = OpenAI()


@lilypad.generation()  # Automatically version non-deterministic functions
def answer_question(question: str) -> str | None:
    completion = client.chat.completions.create(
        model="gpt-4o",
        messages=[
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": f"Answer this question: {question}"},
        ],
    )
    return completion.choices[0].message.content


answer = answer_question("What is the capital of France?")
print(answer)
# > The capital of France is Paris.

And that's it! Now you've versioned and traced your first non-deterministic function with Lilypad.

Usage

We are actively working on this library and it's documentation, which you can find here

Versioning

Lilypad uses Semantic Versioning

License

This project uses a dual-license model:

Open-Source License (MIT)

Except for the contents and code contained in any ee directory or sub-directory of this repository, which is covered by a commercial license (see below), all code in this repository is licensed under the terms of the MIT License.

Enterprise Edition (EE) License

The contents and code of any ee directory or sub-directory of this repository are licensed under the Enterprise Edition (EE) License. This content and code is only available to users using the Lilypad App or those with a valid Enterprise Edition (EE) License. See ee/LICENSE for the full terms.

Self-Hosting:

For those looking to self-host the Enterprise Edition (EE) of Lilypad, please reach out to sales@mirascope.com.

You can find more information about self-hosting here.

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

python_lilypad-0.0.33.tar.gz (825.0 kB view details)

Uploaded Source

Built Distribution

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

python_lilypad-0.0.33-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file python_lilypad-0.0.33.tar.gz.

File metadata

  • Download URL: python_lilypad-0.0.33.tar.gz
  • Upload date:
  • Size: 825.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.6

File hashes

Hashes for python_lilypad-0.0.33.tar.gz
Algorithm Hash digest
SHA256 4f84818377cb21aaf6968b38c29715b1d9080f679932815f228f5570aa80229e
MD5 168b0244c86a6b08c5c7510b8808f4bf
BLAKE2b-256 968e7310ec69723ad7ff6fbcf57e7a7dd2f91f73495d782e82a65e085f1a7db1

See more details on using hashes here.

File details

Details for the file python_lilypad-0.0.33-py3-none-any.whl.

File metadata

File hashes

Hashes for python_lilypad-0.0.33-py3-none-any.whl
Algorithm Hash digest
SHA256 b793e9582bce692d926879194255d30b4fd9e91e7327cedc54c48fe37c92241c
MD5 a3886eb83718901d31433fc65fd2d44b
BLAKE2b-256 641f53f2c1598f2f9bf210b32b8d79e6b3b9185ab9967b9240c1924f55d658d9

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