Skip to main content

Automatically inspect and visualize LLM prompts and responses in your Python projects

Project description

📦
anyprompt
PyPI version Python versions License: MIT

anyprompt screenshot


Installation

pip install anyprompt

What is anyprompt?

anyprompt is a lightweight tool that automatically captures and visualizes LLM prompts in your Python projects. With a single import, you get a beautiful web interface to inspect all communications with AI providers.

Quick Start

Just import and go!

from openai import OpenAI
import anyprompt  # Automatically starts at http://localhost:2400

client = OpenAI()

# This prompt will be automatically captured!
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Tell me a joke about programming"}]
)
print(response.choices[0].message.content)

That's it! Visit http://localhost:2400 in your browser to see your captured prompts.

Compatibility

Library Status
browser-use ✅ Supported
langchain ✅ Supported
openai ✅ Supported
anthropic ✅ Supported
requests ✅ Supported
httpx ✅ Supported
aiohttp ✅ Supported
urllib ✅ Supported
http.client ✅ Supported

Advanced Examples

LangChain Integration

import anyprompt  # This automatically starts the anyprompt server

from langchain_openai import ChatOpenAI
from langchain.schema import HumanMessage

# Initialize the LLM
llm = ChatOpenAI(model="gpt-3.5-turbo")

# Make a call - anyprompt will automatically capture it
response = llm.invoke([HumanMessage(content="What's the capital of France?")])
print(response.content)

browser-use Integration

import anyprompt  # This automatically starts the anyprompt server

from langchain_openai import ChatOpenAI
from browser_use import Agent
import asyncio

async def main():
    agent = Agent(
        task="Compare the price of gpt-4o and DeepSeek-V3",
        llm=ChatOpenAI(model="gpt-4o"),
    )
    await agent.run()

asyncio.run(main())

Privacy & Security

  • Runs locally on your machine
  • No data sent to external servers
  • All prompts stored locally in your project directory

⭐ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

anyprompt-0.3.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

anyprompt-0.3.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file anyprompt-0.3.0.tar.gz.

File metadata

  • Download URL: anyprompt-0.3.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for anyprompt-0.3.0.tar.gz
Algorithm Hash digest
SHA256 153953d45ea10768dcb15e640379536715545b5206fbe098a41c2f4b978ddde6
MD5 b316ae0647ae3c888bf92d43a427ac48
BLAKE2b-256 bccc9bc32fec30f3442ddef62e4ed57eb161ec666b8da686894b9db379df5249

See more details on using hashes here.

File details

Details for the file anyprompt-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: anyprompt-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for anyprompt-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 148fbac468f00276b03c7f027f8694648870a6ef900dc0f6f4221adfd1825ab0
MD5 31bff59894f1a980567927bdb93a9456
BLAKE2b-256 7c3670981a15653701aa0f32f56bb00a389af4154209c50d21f1bcccb66ba372

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