Quickstart
Create an account
You'll need a GitHub or Google account to sign up.
First, navigate to https://lilypad.mirascope.com and create an account.
Environment Variables
Navigate to Settings -> Organization and:
- Create a new project.
- Generate an API key for that project.
The API key will only be shown once, so make sure to copy and save it.
LILYPAD_PROJECT_ID="YOUR_PROJECT_ID"
LILYPAD_API_KEY="YOUR_API_KEY"
If using a .env
file, remember to use something like load_dotenv()
so they are properly loaded.
LLM API Key
You'll need to set the API key for the provider you're using in your environment.
We recommend creating one in Google AI Studio if you don't have one yet.
They have a very generous free tier.
Installation
Install the lilypad-sdk
with any additional dependencies you may need:
# For spans / tracing
uv add lilypad-sdk
# For Google Gemini/Vertex support
uv add "lilypad-sdk[google]"
# For multiple providers
uv add "lilypad-sdk[google,openai,anthropic]"
Available provider extras:
google
- Google Gemini/Vertex models (genai SDK)openai
- OpenAI modelsanthropic
- Anthropic modelsbedrock
- AWS Bedrock modelsazure
- Azure AI modelsmistral
- Mistral modelsoutlines
- Outlines framework
Automatically Trace & Version
Run your first automatically traced and versioned function:
from google.genai import Client
import lilypad
lilypad.configure(
project_id=os.environ["LILYPAD_PROJECT_ID"],
api_key=os.environ["LILYPAD_API_KEY"],
auto_llm=True,
)
client = Client()
@lilypad.trace(versioning="automatic")
def answer_question(question: str) -> str | None:
response = client.models.generate_content(
model="gemini-2.0-flash-001",
contents=f"Answer this question: {question}",
)
return response.text
response = answer_question("What is the capital of France?")
print(response)
# > The capital of France is Paris.
Follow the link output in your terminal to view the captured version and corresponding trace.
See the observability section to learn more.
Look At Your Data!
Go build and run some LLM functions and inspect their results using Lilypad.
While you're at it, try annotating some data too.