Records what your AI agent did (model calls, tool calls, steps) and sends it to your Redline project.
pip install redlineai-sdk==0.3.6 Copy PIP instructions
Records what your AI agent did — every model call, tool call and step — and sends it to your Redline project. The tracing API is Langfuse's Python SDK (MIT, langfuse 5.x), so an agent is instrumented exactly as it would be for Langfuse.
pip install redlineai-sdk import redline from redline import observe, propagate_attributes redline.init(api_key="rl_…", url="https://your-redline-server") @observe(as_type="agent") # a step per call: input, output, timing, errors, nesting def answer(question: str) -> str: ... # model calls inside are recorded too (see below) @observe(as_type="tool") def lookup_order(order_id: str) -> dict: ... with propagate_attributes(session_id="chat-42", user_id="customer-7", tags=["support"]): answer("Where is my order?") # every call in the same session_id is one conversation api_key and url can come from REDLINE_API_KEY and REDLINE_URL instead. init() returns the client (also get_client()); call redline.flush() before a short script exits.
init() records the libraries your agent uses, each only when it is installed, the way Langfuse's integration page for that library records it (langfuse-docs, src/redline/_integrations.py):
Langfuse's pages switch on one integration at a time; init() switches on all installed ones. When one library runs on another (LangChain, OpenAI Agents or LlamaIndex on the OpenAI client), the model client's record of a call made inside a model call another integration records is not sent, so each model call is one generation. Spans are sent with Langfuse's default filter (is_default_export_span), plus LiveKit's.
init(auto_instrument=False) turns all of this off.
If your app already set up OpenTelemetry, init() records into your tracer provider instead of replacing it.
from redline import get_client langfuse = get_client() langfuse.score_current_trace(name="user-feedback", value=1, data_type="BOOLEAN", comment="thumbs up") langfuse.score_current_span(name="relevance", value=0.7) langfuse.create_score(trace_id=..., observation_id=..., name="tone", value="friendly") # CATEGORICAL Tests from Redline (Experiments, Workflows) redline.serve() takes the tests Redline gives your agent (Experiments → "New experiment", Workflows → "Run") and runs each one with your own code, in any framework. Return the agent's reply; raising fails the step.
redline.init() def run(task: str, step: redline.Step) -> str: # a workflow's steps come in order in one session: keep the conversation by step.session_id return support_agent.run_sync(task, message_history=history(step.session_id)).output redline.serve(agent="support-agent", run=run) # blocks; block=False runs it in a thread await redline.serve_async(agent="support-agent", run=run) # inside an event loop; run may be async While it runs, the agent is connected on the Experiments page. Each step is recorded as one run under the test's session (propagate_attributes(session_id=…), an agent observation with the task as input and the reply as output). One test at a time.
LANGFUSE_BASE_URL=https://your-redline-server LANGFUSE_PUBLIC_KEY=pk-bt- # shown on the Setup page LANGFUSE_SECRET_KEY=rl_… Tested with: langfuse 5.0.2, langchain 1.4 / langchain-core 1.6 / langgraph 1.2 (create_agent, invoke, ainvoke, stream), openai 3.33, openai-agents (Runner.run), scores.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




