← Vetro Attest · Free Art. 12/14 checker · Free EU AI Act tools

Audit log for LiteLLM

LiteLLM gives you two ways to reach a hundred-odd model providers through one interface: the Python SDK (litellm.completion(...), a drop-in for provider SDK calls) and the Proxy, a standalone server that speaks the OpenAI API regardless of which provider is behind it. The recording point differs depending on which one you use.

Proxy: it is an OpenAI-compatible endpoint

If your app talks to the LiteLLM proxy through the openai SDK — which is the normal way to use it, since that is the whole point of the proxy — @vetro/openai's wrapOpenAI works unmodified, because it is duck-typed against the chat.completions.create / responses.create shape, not against OpenAI's servers specifically:

import OpenAI from 'openai';
import { wrapOpenAI } from '@vetro/openai';

const client = new OpenAI({ baseURL: 'http://localhost:4000', apiKey: process.env.LITELLM_KEY });
const wrapped = wrapOpenAI(client, run);

await wrapped.chat.completions.create({ model: 'claude-sonnet-4-5', messages: [...] });

Every call is recorded as llm.request / llm.response with model, usage and cost, whatever provider LiteLLM actually routed to underneath.

SDK: wrap the call site directly

Using litellm.completion() from Python bypasses HTTP entirely, so there is no client object to wrap. The reliable point to record is the call site itself, with vetro-py's Run API: call run.llm_request(model=..., provider="litellm", messages=messages) before litellm.completion(...) and run.llm_response(...) after, guarded the same way ag2_safeguard_hooks.py guards AG2's calls (see the AG2 guide) — a PolicyViolationError from run.llm_request() should stop your code from calling litellm.completion() at all.

LiteLLM's own callback system

LiteLLM also has a built-in callback mechanism (a CustomLogger class with hooks for pre-call, success and failure events) that some deployments already use for cost tracking or observability. If yours does, check your installed version's documentation for the exact hook names available — they have changed across releases — before deciding whether they run early enough to block a call rather than only record it after the fact.

Policy before the call, not after

Whichever route you take, check an inline policy — a spend cap, a denied model, a content rule — before the request leaves your process, the same budget.* / tool.deny shape used throughout Vetro's policy packs.

Check your own logs

Paste a Vetro ledger or an OpenTelemetry GenAI trace export into the free checker: it verifies integrity and shows which record-keeping obligations your evidence covers. For a report to hand to an auditor, Vetro Attest issues a 29 USD counter-signed mapping to EU AI Act articles.

See a sample ledger verified in one click, check your own logs free or get the countersigned EU AI Act report.

Pricing