Skip to main content

PrompTrace

From building and tracking experiments to productionizing prompts.

Why PrompTrace

Prompt engineering is often done by software engineers with little to no background in ML or Data Science. PrompTrace is designed to simplify the process, enabling easy experiment setup, prompt evaluation, and production tracking.

Key Benefits:

✅ 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.

Core Concepts

Experiment

Experiment is at the center of PrompTrace. An experiment means running a prompt for a dataset and evaluating the outcome against some defined metrics. It is provided as a json file.

Parts of an expriment are -

  • Model: Configuration to connect to an LLM endpoint.

  • Prompt Template: It is a path for a file which contains the prompt text. The prompt template may include placeholders, which are dynamically replaced with data from a dataset.

    Prompt template format

      <<system>>
      TEXT FOR SYSTEM PROMPT GOES HERE.
    
      <<user>>
      TEXT FOR USER PROMPT GOES HERE. FOR PLACEHOLDER, USE THIS SYNTAX <PLACEHOLDER>.
    

    Make sure <<system>> and <<user>> are written like this. For placeholders, use this syntax <placeholder>.

  • Dataset: It is a path for a json file which contains the evaluation dataset.

    Dataset template format

      [
          [
              {"title":"sample_title", "value":"sample_text"}, 
              ...
              ...
              {"title":"sample_title", "value":"sample_text"}
          ],
          [
              {"title":"sample_title", "value":"sample_text"}, 
              ...
              ...
              {"title":"sample_title", "value":"sample_text"}
          ]
      ]
    
  • Evaluation (optional): It is a list of evaluation metrics.

Tracer

Tracer stores the experiment output.

How to use

  • Install the promptrace library.

      pip install promptrace
    
  • Create a folder for prompt template and store the prompt template there.

  • Create a folder for dataset and store the dataset there.

Sample code

import json
from promptrace import PrompTrace

# Define the experiment configuration
experiment_config = {
    "model": {
        "type": "azure_openai",
        "api_key": "your_api_key",
        "api_version": "your_api_version",
        "endpoint": "your_endpoint",
        "deployment": "deployment_name"
    },
    "prompt_template": "prompt_template_path",
    "dataset": "dataset_path",
    "evaluation": [
        {"metric": "metric_name"}
        {"metric": "metric_name"}
    ]
}

# Define the tracer configuration
tracer_config = {
    "type": "tracer_type",
    "target": "target_folder"
}

# Create a PrompTrace instance and run the experiment
prompt_trace = PrompTrace(tracer=tracer_config)
prompt_trace.run(experiment_config)

Samples

[coming soon]

Metadata

Release files for promptrace 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for promptrace 0.1.3
File Size Uploaded
promptrace-0.1.3.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for promptrace 0.1.3
File Interpreter ABI Platform
promptrace-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / promptrace-0.1.3.tar.gz

Download URL promptrace-0.1.3.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0e277e8685b0bbe055d1a2b2ac21eeab232bfed4c29f1de8492dba2e0cc836af
BLAKE2b-256 checksum
How to use checksums
09177ef272db5223db079427dfc58d93fcb63dbfbdab28adef1352499d42a972
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / promptrace-0.1.3-py3-none-any.whl

Download URL promptrace-0.1.3-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc7ee8e9b4c84e4da5aa94536a6f8daaf9d4855b890e855940c73422c5e90c88
BLAKE2b-256 checksum
How to use checksums
d2f2671cc58880cd672ff3af800b27566297160bf250890338e3f1ef0a9b5f2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page