Blog / tag

python

5 posts tagged python.

Anthropic bills prompt caching at three rates. Your cost code probably knows about one

A cached Claude call splits usage across input_tokens, cache_read_input_tokens and cache_creation_input_tokens — three different prices in one response. Here is what the normalized event looks like, and the live numbers from a real gpt-4o-vs-Claude comparison.

read →

Your OpenAI bill is a black box. Here is the seam that opens it

A step-by-step journey from an unwrapped OpenAI client to a governed one: exact tokens, a Decimal cost, a pre-flight budget that refuses the call that would cross your cap, and a redaction that fires before the request leaves your process. Every step has a run command, its real output, and a screenshot. Python and TypeScript, no API key needed.

read →

Governing Microsoft Foundry: four ways to call it, and only three can be governed

On Foundry, how much governance you get is decided by one thing — who holds the model client. The Foundry SDK hands you a plain OpenAI client, so all seven Cendor libraries work with no Foundry-specific code. The Azure AI Inference SDK hands you a different shape, and instrument() returns it untouched: zero events, budgets that never bind, an empty audit chain, and an app that looks fine. Plus the deployment name that makes a USD cap silently do nothing. Python and TypeScript, runs offline with no Azure account.

read →

Your Teams agent's policy refusal is showing up as "the agent hit an error"

A Microsoft 365 Agents SDK custom engine agent holds its own model client, so it is ordinary library work — except that the guardrail call RAISES on a block rather than returning one, three separate exception types reach a governed handler, and on the TypeScript port the session cap silently never accumulates. A step-by-step journey with the real Agents Playground on screen, a mid-stream break, a verifiable audit chain, and the whole agent replayed for $0. No tenant, no tunnel, no key. Plus the governance Adaptive Card that makes all of it visible to the person in the chat, because `channelData` is not.

read →

Introducing Cendor: production plumbing for LLM applications

Seven composable libraries and a governed agent SDK for the layer beneath your agent framework — context, cost, guardrails, testing, and audit, in Python and TypeScript. Local-first, Apache-2.0.

read →

← all posts