Skip to content

Commit f6ce997

Browse files
authored
Merge pull request #59 from meta-llama/frontend
Add Web Frontend for prompt-ops
2 parents 4ead714 + 3cd76b7 commit f6ce997

154 files changed

Lines changed: 18115 additions & 409 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[run]
2+
source = src/prompt_ops
3+
omit =
4+
*/tests/*
5+
*/site-packages/*
6+
setup.py
7+
8+
[report]
9+
exclude_lines =
10+
pragma: no cover
11+
def __repr__
12+
raise NotImplementedError
13+
if __name__ == .__main__.:
14+
pass
15+
raise ImportError

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
echo "Package version: $VERSION"
4141
4242
# Check if this version already exists on PyPI
43-
if pip index versions llama-prompt-ops 2>/dev/null | grep -q "$VERSION"; then
43+
if pip index versions prompt-ops 2>/dev/null | grep -q "$VERSION"; then
4444
echo "Error: Version $VERSION already exists on PyPI"
4545
exit 1
4646
fi

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ Add your API key to the `.env` file:
130130
```bash
131131
OPENROUTER_API_KEY=your_key_here
132132
```
133-
You can get an OpenRouter API key by creating an account at [OpenRouter](https://openrouter.ai/). For more inference provider options, see [Inference Providers](./docs/inference_providers.md).
133+
134+
prompt-ops uses LiteLLM as a unified API client. LiteLLM automatically detects the provider from your model name (e.g., `openrouter/model`, `groq/model`) and looks for the corresponding provider-specific environment variable (`OPENROUTER_API_KEY`, `GROQ_API_KEY`, etc.). For more inference provider options, see [Inference Providers](./docs/inference_providers.md).
134135

135136
### Step 4: Run Optimization
136137
The optimization will take about 5 minutes.

configs/facility-simple.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dataset:
1010
golden_output_field: "answer"
1111

1212
# Model configuration (minimal required settings)
13+
# LiteLLM auto-detects API keys from provider-specific env vars (e.g., OPENROUTER_API_KEY)
1314
model:
1415
name: "openrouter/meta-llama/llama-3.3-70b-instruct"
1516
task_model: "openrouter/meta-llama/llama-3.3-70b-instruct"

configs/facility.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# Facility dataset configuration for prompt optimization
22

3-
#TODO: think if there are any way to abstract this
4-
# provider: openrouter/hosted_vllm/togethercomputer
5-
# model: meta-llama/llama-3.3-70b-instruct
6-
# litellm
3+
# Model configuration - uses LiteLLM with provider prefix
4+
# LiteLLM auto-detects API key from provider-specific env vars (e.g., OPENROUTER_API_KEY, GROQ_API_KEY)
75
model:
86
name: "openrouter/meta-llama/llama-3.3-70b-instruct"
9-
api_base: "https://openrouter.ai/api/v1" # rename base_url:
107
temperature: 0.0
118
# max_tokens: 2048 # Maximum number of tokens to generate
129
# top_p: 0.9 # Nucleus sampling parameter

configs/hotpotqa.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
model:
22
name: "openrouter/meta-llama/llama-3.1-8b-instruct"
3-
api_base: "https://openrouter.ai/api/v1"
43
temperature: 0.0
54
max_tokens: 40960
65

docs/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
title: Getting Started
3+
category: Basics
4+
description: Learn the fundamentals of prompt-ops and choose your optimization path
5+
order: 1
6+
icon: book
7+
---
8+
19
# prompt-ops Getting Started Guide
210

311
Welcome to prompt-ops! This guide will help you understand what's supported out of the box and how to get started quickly.

docs/advanced/logging.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
title: Logging & Telemetry
3+
category: Advanced
4+
description: Configure logging levels and export optimization telemetry for analysis
5+
order: 32
6+
icon: settings
7+
---
8+
19
# Logging and Telemetry
210

311
The `prompt-ops` library includes a flexible logging framework to provide insights into the optimization process. You can control the verbosity of the output and export detailed telemetry for analysis.

docs/advanced/readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
title: Custom Adapters & Metrics
3+
category: Advanced
4+
description: Create custom dataset adapters and evaluation metrics for your use case
5+
order: 31
6+
icon: code
7+
---
8+
19
# Using prompt-ops for your use case (with Examples)
210

311
> **Note:** This guide explains how to add new use cases to prompt-ops by either configuring existing components or creating custom components.

docs/basic/readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
title: Quick Start Guide
3+
category: Basics
4+
description: Optimize your first prompt in 5 minutes with a guided walkthrough
5+
order: 2
6+
icon: zap
7+
---
8+
19
# Quick Start Guide: Optimizing Prompts in 5 Minutes
210

311
## What You'll Build

0 commit comments

Comments
 (0)