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 or Google Cloud Storage. This enables downstream cost-analysis tooling to ingest a standardised dataset directly from LiteLLM.

The experimental export follows the FOCUS 1.5 release candidate Cost and Usage dataset.

Export columns and request meter​

ServiceProviderName and HostProviderName replace ProviderName and PublisherName. Both contain the LiteLLM provider name. InvoiceIssuerName remains available.

PrincipalId identifies the user. CredentialId contains the stored hashed API key, not an authenticating key. RequesterDetails is a JSON array with a Principal entry when a user ID exists and a Credential entry when a credential ID exists. Known user emails and key aliases supply descriptive attributes; unknown attributes are omitted. The column is null when neither ID exists.

Each row represents one daily per-key/model request meter. Rows are not split by token direction or cache action, because the daily spend aggregate combines their costs. PricingQuantity and ConsumedQuantity both contain the request count; PricingUnit and ConsumedUnit are Requests.

SkuId is a LiteLLM-defined stable identifier formed as provider/model. SkuPriceId adds /requests to identify the combined request meter, not an individual token price. These IDs do not include account identifiers or price amounts and are null if the provider or model is unknown. SkuPriceDetails is a JSON object with the FOCUS-defined ModelId property, set to the model. It is null when SkuPriceId is null and does not include TokenDirection or TokenCacheAction.

The Vantage destination removes columns outside its supported allowlist, including the SKU and requester details columns, before upload.

Overview​

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

Environment Variables​

Common settings​

VariableRequiredDescription
FOCUS_PROVIDERNoDestination provider. One of s3, gcs, vantage. Defaults to s3.
FOCUS_FORMATNoOutput format. One of parquet, csv. Defaults to 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.

GCS destination​

VariableRequiredDescription
FOCUS_GCS_BUCKET_NAMEYesDestination GCS bucket for exported files.
FOCUS_GCS_PATH_SERVICE_ACCOUNTNoPath to a service account JSON key file. Falls back to Application Default Credentials (ADC) if unset.

Setup via Config​

Configure environment variables​

export FOCUS_PROVIDER="s3"
export FOCUS_PREFIX="focus_exports"
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-6.1-sol
litellm_params:
model: openai/gpt-6.1-sol
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 Azure Blob to the Destination options.