hegelai/prompttools
Self-hosted Python toolkit for testing prompts, model settings, and retrieval
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
PromptTools is a Python evaluation harness, not an inference server. Its unit of work is a backend-specific experiment object. In the OpenAI chat workflow, the caller supplies model names, sets of chat messages, and temperature values, invokes run() to execute the experiment, and then calls visualize() or exports the results. API-backed calls go directly from the local process to the selected provider, without a PromptTools relay.
The core library lives under prompttools/, with notebooks under examples/notebooks/ and a separate Streamlit entry point at prompttools/playground/playground.py. Setuptools reads dependencies from requirements.txt, which includes openai, tenacity, pandas, tabulate, jinja2, jupyterlab, ipywidgets, pylint, and sentry-sdk>=1.23.0. The integration surface is the experiment API: use the class appropriate to the backend rather than assuming a common inference endpoint or identical parameter semantics across providers.
Key Capabilities & Differentiators
The toolkit compares prompts, model choices, and generation settings; it also evaluates vector retrieval accuracy. Model integrations include OpenAI completion, chat, and fine-tuned models, Azure OpenAI, Anthropic, Mistral AI, Gemini, Vertex AI, Hugging Face Hub API and Inference Endpoints, and Replicate. LLaMA.cpp covers local LLaMA 1 and LLaMA 2. Ollama is marked in progress, so do not treat it as interchangeable with the supported local backend.
Retrieval targets include Chroma, Weaviate, Qdrant, LanceDB, and Pinecone; Milvus is exploratory and Epsilla is in progress. The v0.0.35 release added RAG support and utilities including chunk_text, autoeval_with_documents, and structural_similarity. Results can be exported with to_csv, to_json, to_lora_json, or to_mongo_db. The toolkit supplies experiment mechanics rather than a fixed evaluation dataset or leaderboard, so teams still need to define the inputs and scoring criteria that matter to them.
Trade-offs & Limitations
Compared with direct provider SDK scripts, PromptTools gives teams a common run, inspect, and export workflow without requiring them to build one per integration. The cost is an adapter layer: verify that the chosen experiment class exposes the model controls you need. The declared dependencies are largely unpinned, including openai, so lock a tested environment and record model identifiers, inputs, settings, and scoring rules for repeatable comparisons. Prefer a fixed benchmark when the goal is a comparable score on a standard dataset.
Self-hosting keeps experiment execution under your control, but it does not make a run offline. Remote providers still receive the requests you send them, and expanding an API-backed experiment can increase usage costs and expose rate limits. Local inference avoids the provider API for those calls but puts compute and model setup on your team. Sentry error tracking is separate from provider traffic and can be disabled with SENTRY_OPT_OUT. Apache-2.0 covers the toolkit, not the terms of the models or services it invokes.
Hardware & Deployment Guide
Use Python 3.10 or newer and install the library with pip install prompttools. To start in a notebook, clone the repository and run jupyter notebook examples/notebooks/OpenAIChatExperiment.ipynb from its root. For the browser interface, make Streamlit available separately and run streamlit run prompttools/playground/playground.py; Streamlit is not in the declared base dependencies. The Streamlit Community Cloud instance does not support LLaMA.cpp.
For API-backed runs, provision provider credentials and network access; model inference runs remotely, so the client does not need a GPU for that path. For offline evaluation, use local backends and model files, keep evaluation data local, and set SENTRY_OPT_OUT. Size RAM and any GPU offload for the chosen model and concurrency. Release v0.0.41 introduced a separate hosted Playground in private beta for versioned experiments and collaboration; v0.0.45 added hosted production observability in private beta. Neither is a prerequisite for local experiments.
OpenAIChatExperiment takes model names, chat messages, and temperature values, with run() for execution and visualize() for inspection.to_csv, to_json, to_lora_json, and to_mongo_db for export.SENTRY_OPT_OUT to disable Sentry error tracking; this does not disable requests to selected model or database providers.Teams comparing prompts, models, or retrieval backends on their own test cases in Python or notebooks, with exports for downstream analysis or regression checks.
You need a standardized benchmark score, turnkey shared experiment history and production monitoring in the self-hosted installation, or offline evaluation while relying on remote APIs.
Quick Start & Installation
pip install prompttoolsAI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/hegelai/prompttools.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about prompttools
How do I turn the same set of prompts into a comparison across models?
OpenAIChatExperiment accepts model names, chat messages, and temperature values. Call run() to execute the experiment and visualize() to inspect results. Use to_csv or to_json if you need artifacts for an external comparison or regression workflow.Do I need a GPU or a particular amount of VRAM?
Can we self-host it for commercial use?
SENTRY_OPT_OUT.When should we choose this over direct SDK scripts, a fixed benchmark, or a hosted platform?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy