Skip to main content

luca-litellm

Send the cost of every call through your LiteLLM proxy to Luca, so your finance team gets AI spend by customer, team and model, accrued and matched to each provider's invoice, with journal entries for the ERP.

Only the fields accounting needs leave your network: when the call was made, the provider and model, the cost and token counts, and the team, key, project, customer, tags and MCP server LiteLLM records with it. The plugin drops the prompt, the response, tool arguments and tool results before anything is sent. Email addresses are left out unless you turn them on.

Set up

  1. In Luca, add a LiteLLM AI gateway connection. Luca shows its webhook URL. Make an ingest token for it: openssl rand -hex 32
  2. On the machine that runs the proxy:
    pip install luca-litellm
    
  3. Add the plugin to the proxy's config.yaml:
    litellm_settings:
      callbacks: ["luca_litellm.handler"]
    
  4. Set two environment variables for the proxy:
    LUCA_LITELLM_URL=<the webhook URL Luca shows>
    LUCA_LITELLM_TOKEN=<the ingest token>
    
  5. Restart the proxy.

The plugin sends calls in batches (every 10 seconds, or every 200 calls), outside the request path, so it adds no time to your calls. If Luca can't be reached, it keeps the calls and tries again.

Which customer a call served

LiteLLM records a customer for each call when your app passes user in the request, or when the call uses a key or team set up for that customer. Luca uses it to show AI cost by customer.

Options

Variable What it does
LUCA_LITELLM_URL The connection's webhook URL (required)
LUCA_LITELLM_TOKEN The connection's ingest token (required)
LUCA_LITELLM_INCLUDE_EMAIL true to send the user's email address with each call (off by default)

To use it from the LiteLLM Python SDK instead of the proxy:

import litellm
from luca_litellm import LucaLogger
litellm.callbacks = [LucaLogger(url="https://…", token="…")]

Without installing a package

LiteLLM's built-in webhook callback can send the same calls. Luca shows that configuration on the connection too. With it, turn message logging off (turn_off_message_logging: true) so prompts and responses are not sent.

Apache-2.0. Questions: hello@luca.network

Metadata

Release files for luca-litellm 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for luca-litellm 0.1.0
File Size Uploaded Provenance Actions
luca_litellm-0.1.0.tar.gz 11.6 kB With provenance Details for luca_litellm-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for luca-litellm 0.1.0
File Interpreter ABI Platform Actions
luca_litellm-0.1.0-py3-none-any.whl Python 3 none any Details for luca_litellm-0.1.0-py3-none-any.whl

Total release size: 21.9 kB

Release files / luca_litellm-0.1.0.tar.gz

Download URL luca_litellm-0.1.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
784dad26039f8b56980d2a823a2bab244840930122c5595e49d2dfd0edc8afe9
BLAKE2b-256 checksum
How to use checksums
90b30fdb5c7b68f5ff27778356eca323f085a6a0150b67f4416f61fbb981d2b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / luca_litellm-0.1.0-py3-none-any.whl

Download URL luca_litellm-0.1.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb63f721e7c84501044a85f64fbdef66a247a394aa546b9edeec4646b54da96e
BLAKE2b-256 checksum
How to use checksums
48905bec505dbefd1d1d7548eb6f111b38281e6ba8c292cb05f267e226ec7604
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for luca-litellm 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for luca_litellm-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page