LiteLLM
Overview
Simplify LLM API Calls across Anthropic, OpenAI, HuggingFace, Replicate, etc.
Use Supabase to log requests and see total spend across all LLM Providers (OpenAI, Azure, Anthropic, Cohere, Replicate, PaLM)
liteLLM provides success_callbacks
and failure_callbacks
, making it easy for you to send data to a particular provider depending on the status of your responses.
In this case, we want to log requests to Supabase in both scenarios - when it succeeds and fails.
Create a supabase table
Go to your Supabase project > go to the Supabase SQL Editor and create a new table with this configuration.
Note: You can change the table name. Just don't change the column names.
Use Callbacks
Use just 2 lines of code, to instantly see costs and log your responses across all providers with Supabase:
Complete code
Additional Controls
Different Table name
If you modified your table name, here's how to pass the new name.
Identify end-user
Here's how to map your llm call to an end-user
Details
Third-party integrations and docs are managed by Supabase partners.