Skip to main content

LiteLLM Core

litellm-core packages the LiteLLM Python SDK with fewer mandatory dependencies and without the bundled dashboard or gateway CLI entry points. It uses the same SDK sources and the same litellm Python namespace as the litellm distribution

Choose a package​

PackageWhen to use it
litellm-coreYour application calls the SDK directly and you want to install AWS and Python Hugging Face tokenizer dependencies only when needed
litellmYou want the existing distribution, its dependency defaults, and its supported installation extras

For a gateway deployment, follow the Gateway Quickstart. Core does not provide the litellm command or bundled Admin UI

Install​

Install core in a fresh virtual environment:

python -m venv .venv
source .venv/bin/activate
python -m pip install litellm-core

On Windows, activate the environment with .venv\Scripts\activate instead

Your Python imports still use litellm, including imports such as from litellm import completion or from litellm import Router. The distribution name is litellm-core; there is no change to the public import namespace

Install one distribution per environment

litellm and litellm-core install overlapping files. Installing both in the same environment causes import litellm to fail, even when their versions match

When moving an application to core, replace litellm in its dependency declaration and regenerate its lockfile in a fresh environment. If another dependency requires litellm, resolve that requirement before switching

SDK functionality​

Core retains provider request and response translation, synchronous and asynchronous completions, streaming, embeddings, token counting, model metadata, and cost calculations. The shared SDK also includes the Router, retries, fallbacks, and provider error mapping

The package split preserves the broader SDK API surface, including Responses, image, audio, and batch operations. Model and provider support still varies by endpoint, and individual integrations can require additional packages. See Supported Endpoints and the relevant provider guide

Optional dependencies​

Core removes boto3, tokenizers, and huggingface-hub from its mandatory dependencies. It declares python-dateutil directly and continues to require packages such as jsonschema and tiktoken

Install optional packages directly. Core does not currently declare installation extras such as litellm-core[aws] or litellm-core[tokenizers]

AWS operations​

Install boto3 for AWS credential resolution, SigV4 signing, and AWS event-stream decoding:

python -m pip install boto3

This also installs botocore. AWS-dependent features include signed Bedrock requests, SageMaker, Polly, and AWS integrations such as Secrets Manager and S3 logging

Bedrock bearer-token request preparation can work without botocore. Streaming paths that decode AWS event streams still require it, so bearer authentication alone does not make every Bedrock operation independent of the AWS packages

Python Hugging Face tokenizers​

Install the Python tokenizer packages when your application uses those paths:

python -m pip install tokenizers huggingface-hub

Core retains its native tokenizer implementation and tiktoken dependency. Token counting does not universally require the optional Python Hugging Face packages. Where token counting falls back to an approximation, LiteLLM emits a warning; treat that result as an estimate

Missing optional dependencies are reported when the operation requiring them runs, with installation guidance

Installation footprint​

In matching source-build comparisons, litellm-core reduced installed size by 32.2%, saving approximately 65.6 MB including runtime dependencies

Both builds used version 1.106.0, matching shared dependency versions, and the same Linux machine and Python interpreter. Measurements cover default installations without optional extras, excluding generated bytecode and common tooling. The source builds were baseline 5d207d85 and core 029a626c

Relationship to litellm​

Currently, litellm-core and litellm are independently packaged distributions built from shared sources. Installing or upgrading litellm continues to use its existing dependency set

The planned architecture makes litellm-core the shared SDK dependency, with litellm wrapping it. That relationship is not implemented yet: litellm does not currently depend on litellm-core. Continue to choose one distribution per environment and use the litellm Python import namespace with either package

LiteLLM Enterprise
SSO/SAML, audit logs, spend tracking, multi-team management, and guardrails, built for production.
Learn more →