Skip to main content
View module source on GitHub This module is a wrapper around the Portkey client that allows for easy integration with Maxim. It instruments the Portkey client to log to Maxim. It also provides a wrapper around the Portkey chat-completions client that allows for easy integration with Maxim.

instrument_portkey

Attach Maxim OpenAI wrappers to a Portkey client. This helper patches the openai_client attribute of a Portkey or AsyncPortkey instance so that all OpenAI-compatible calls are logged via Maxim. Arguments: Returns: The same client instance with its openai_client patched.