Skip to main content

OpenAI and Anthropic tracing package for LLM applications.

Project description

freesolo

freesolo is a Python tracing package for LLM apps.

It is built for the lowest-friction integration possible:

  1. Install the package
  2. Set FREESOLO_API_KEY
  3. Wrap your OpenAI or Anthropic client
  4. Call the client normally

Current provider support

freesolo currently supports automatic client instrumentation for:

  • OpenAI
  • Anthropic

Install

Install the package plus the provider SDK you use:

pip install freesolo openai

or

pip install freesolo anthropic

Environment

  • FREESOLO_API_KEY

Quickstart

from openai import OpenAI
from freesolo import instrument_openai

client = instrument_openai(OpenAI())

result = client.chat.completions.create(
    model="gpt-4.1-mini",
    messages=[
        {"role": "user", "content": "How do I reset my password?"},
    ],
)

print(result.choices[0].message.content or "")

Group Multiple Model Calls

For agentic or long-horizon tasks, strongly prefer wrapping the whole task in start_trace(...) so all of the model calls land in one trace.

For a single one-off OpenAI or Anthropic request, you can skip it.

from anthropic import Anthropic
from freesolo import instrument_anthropic, start_trace

client = instrument_anthropic(Anthropic())

with start_trace("support-agent-run"):
    first = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=64,
        messages=[{"role": "user", "content": "Say hello"}],
    )
    second = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=64,
        messages=[{"role": "user", "content": "Say goodbye"}],
    )

What Gets Stored

  • Trace metadata if you explicitly pass it to start_trace(..., metadata=...)
  • OpenAI and Anthropic request + response payloads
  • Token usage when available
  • Image inputs with inline previews for the trace UI

Notes

  • You do not need @trace() for ordinary LLM tracing.
  • A single instrumented OpenAI or Anthropic request creates a trace automatically.
  • For agentic or long-horizon workflows, strongly recommend start_trace(trace_id=...) so planning, retries, and follow-up calls stay grouped.
  • Delivery is best-effort by default. Trace ingestion failures do not break your app.

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

freesolo-0.1.3.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

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

freesolo-0.1.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file freesolo-0.1.3.tar.gz.

File metadata

  • Download URL: freesolo-0.1.3.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for freesolo-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5ace352859a54e73f98e983151e4b75c17b16bd92e43d467d1b0302e26bdd61d
MD5 2c7b6fc8fa54d8e8c17d7b16c4372449
BLAKE2b-256 c81575bebbab8f9c7640b20c8f457fff100c0082080b34abd8b324da1a2d545b

See more details on using hashes here.

File details

Details for the file freesolo-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: freesolo-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for freesolo-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 735db9ac238f82730670efd15e3330bfcf1c09e488ea2fde70d7a257d5081b53
MD5 786e2688bfc102df991a95b6da7a42e3
BLAKE2b-256 4df71738c813ccb6a71624b3c628c6dcd8714f4dca5983f57b5e311d94e663ba

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