Skip to main content
niadra.integrations.litellm brings completion() and acompletion(), which are litellm.completion and litellm.acompletion with the context, and NiadraLogger, a LiteLLM CustomLogger that records the answer of every call made inside a conversation. Python only; it covers any provider LiteLLM routes.

Install

The five primitives

Minimal example

The same code is in examples/litellm_completion.py.

Limits

  • Outside a block, completion() and acompletion() are LiteLLM’s own calls.
  • NiadraLogger only records; for the pack to go in, use completion().
  • The litellm extra pins versions incompatible with openai-agents; install one per environment.
  • Tested against litellm 1.102 with the transport replaced and Niadra on the emulator.

Next steps

OpenAI and Azure OpenAI

the client wrap(), with no router in between.

Python SDK

the conversation, mark_injected() and the provider’s usage.