Skip to main content

Focus Export (Experimental)

Experimental feature

Focus Format export is under active development and currently considered experimental. Interfaces, schema mappings, and configuration options may change as we iterate based on user feedback. Please treat this integration as a preview and report any issues or suggestions to help us stabilize and improve the workflow.

LiteLLM can emit usage data in the FinOps FOCUS format and push artifacts (for example Parquet files) to destinations such as Amazon S3. This enables downstream cost-analysis tooling to ingest a standardised dataset directly from LiteLLM.

LiteLLM currently conforms to the FinOps FOCUS v1.2 specification when emitting this dataset.

Overview

PropertyDetails
DestinationExport LiteLLM usage data in FOCUS format to managed storage (currently S3)
Callback namefocus
Supported operationsAutomatic scheduled export
Data formatFOCUS Normalised Dataset (Parquet)

Environment Variables

Common settings

VariableRequiredDescription
FOCUS_PROVIDERNoDestination provider (defaults to s3).
FOCUS_FORMATNoOutput format (currently only parquet).
FOCUS_FREQUENCYNoExport cadence. Prefer hourly or daily for production; interval is intended for short test loops. Defaults to hourly.
FOCUS_CRON_OFFSETNoMinute offset used for hourly/daily cron triggers. Defaults to 5.
FOCUS_INTERVAL_SECONDSNoInterval (seconds) when FOCUS_FREQUENCY="interval".
FOCUS_PREFIXNoObject key prefix/folder. Defaults to focus_exports.

S3 destination

VariableRequiredDescription
FOCUS_S3_BUCKET_NAMEYesDestination bucket for exported files.
FOCUS_S3_REGION_NAMENoAWS region for the bucket.
FOCUS_S3_ENDPOINT_URLNoCustom endpoint (useful for S3-compatible storage).
FOCUS_S3_ACCESS_KEYYesAWS access key for uploads.
FOCUS_S3_SECRET_KEYYesAWS secret key for uploads.
FOCUS_S3_SESSION_TOKENNoAWS session token if using temporary credentials.

Setup via Config

Configure environment variables

export FOCUS_PROVIDER="s3"
export FOCUS_PREFIX="focus_exports"

# S3 example
export FOCUS_S3_BUCKET_NAME="my-litellm-focus-bucket"
export FOCUS_S3_REGION_NAME="us-east-1"
export FOCUS_S3_ACCESS_KEY="AKIA..."
export FOCUS_S3_SECRET_KEY="..."

Update LiteLLM config

model_list:
- model_name: gpt-4o
litellm_params:
model: openai/gpt-4o
api_key: sk-your-key

litellm_settings:
callbacks: ["focus"]

Start the proxy

litellm --config /path/to/config.yaml

During boot LiteLLM registers the Focus logger and a background job that runs according to the configured frequency.

Planned Enhancements

  • Add "Setup on UI" flow alongside the current configuration-based setup.
  • Add GCS / Azure Blob to the Destination options.
  • Support CSV output alongside Parquet.