LITELLM · PYTHON SDK

See what your LiteLLM agent proposed and ran.

Add Staso to direct LiteLLM calls. Follow the model response, the Guard decision, and the Python tool your code actually executes.

HOW IT WORKS

One run. Three distinct facts.

Staso instruments the customer Python SDK. LiteLLM usage inside Staso's own backend is a separate internal path.

  1. 01

    Trace the run

    Call litellm.completion() or acompletion() inside @st.agent. Staso records the supported non-streaming model span under that run.

  2. 02

    Check the proposal

    A scoped Guard policy checks a model-proposed tool call before your dispatch code receives it. Audit records a would-block finding; Enforce can raise GuardBlocked.

  3. 03

    Record execution

    Wrap the host function in @st.tool to record the tool that actually ran. A model proposal alone does not prove execution.

CURRENT SCOPE

Start with the tested route.

Release proof covers LiteLLM 1.84 through 1.103, direct non-streaming completion() and acompletion() calls using openai/gpt-4o-mini. It does not establish streaming, LiteLLM Proxy traffic, or every provider route.

Guard needs an enabled policy with the right scope. Missing or suppressed tool evidence can make a rule skip or abstain. Token usage appears when LiteLLM supplies supported fields. Cost needs an exact known model price; otherwise it remains Unknown or Partial.

The guide includes both API keys, runnable sync and async calls, a tool loop, and Guard handling.

Read the LiteLLM guide