Skip to main content
watch_openai_compatible wraps any client that exposes chat.completions.create. That is the official OpenAI client, and it is also the sovereignty path: point a client at a base URL and the same wrapper witnesses Ollama, vLLM, TGI, or LM Studio running inside your own environment. One integration covers every runtime that speaks the OpenAI API.

Install

Wrap the client

The change is one line: wrap the client you already build. Everything downstream keeps calling it the same way.
See the shared shape for how sakshi and agent_id are created.

Self-hosted and sovereign runtimes

The provider is derived from the client’s base URL. A call to openai.com records as openai. A call to localhost, a private address, or a bare service hostname records as self-hosted (host), so the evidence reflects that the model never left your network.

What gets recorded

Each completion inside a witness session lands an llm_call step, and the served model identity auto-fills (para-56):
  • The provider, derived from the base URL as above.
  • model_requested versus model_served, so a silent model swap is visible.
  • system_fingerprint when the provider returns one.
  • Prompt and completion token usage.
  • The finish reason and the call latency.
  • With content capture on, the last message you sent and the response text, each truncated to content_limit.

Capture options

  • capture_content defaults to True. Content capture is safe by design: the platform tokenizes PII at ingest, before storage or hashing. Set it to False for a minimal-capture deployment where only metadata, tokens, and identity are recorded.
  • content_limit caps how much of each message and response is stored. The default is 1000 characters.
A call made outside a witness session passes through untouched and is not recorded. Recording is fail-open: it never breaks or delays the completion.

Full SDK reference

The client, the witness session, and enforcement.