{"id":3540,"library":"litellm-proxy-extras","title":"LiteLLM Proxy Extras","description":"LiteLLM Proxy Extras (`litellm-proxy-extras`) is a supplementary Python package for the LiteLLM Proxy, providing additional files and components like database migration scripts (Prisma `schema.prisma` and migrations folder). Its primary purpose is to reduce the size of the main `litellm` package by externalizing these non-core proxy components. As of April 2026, it is at version `0.4.65` and is an actively maintained part of the LiteLLM ecosystem, following the frequent release cadence of `litellm`.","status":"active","version":"0.4.65","language":"en","source_language":"en","source_url":"https://github.com/BerriAI/litellm","tags":["LLM","proxy","AI gateway","database migrations","Prisma","LiteLLM","utility"],"install":[{"cmd":"pip install litellm-proxy-extras","lang":"bash","label":"Install only extras"},{"cmd":"pip install 'litellm[proxy]'","lang":"bash","label":"Install LiteLLM with proxy extras (recommended)"}],"dependencies":[{"reason":"This package provides supplementary files (e.g., Prisma migrations) for the LiteLLM Proxy, which is part of the main `litellm` library.","package":"litellm","optional":false}],"imports":[{"note":"The `litellm-proxy-extras` package primarily provides internal files like database migration scripts (e.g., Prisma schema.prisma) for the LiteLLM Proxy. Users interact with the `litellm` CLI or SDK, which then utilizes the contents of this package internally.","symbol":"None","correct":"This package is not meant for direct Python import or usage in user code."}],"quickstart":{"code":"import os\n\n# Ensure litellm[proxy] is installed\n# pip install 'litellm[proxy]'\n\n# To apply database migrations provided by litellm-proxy-extras\n# This command starts the LiteLLM proxy and runs pending migrations.\n# Ensure your database environment variables (e.g., POSTGRES_URL) are set.\n# Example: os.environ['POSTGRES_URL'] = 'postgresql://user:password@host:port/database'\n\n# In a terminal, run the following command:\n# litellm --use_prisma_migrate\n\nprint(\"Refer to LiteLLM documentation for proxy setup and migration usage.\")\n# Example of starting the proxy with a model (requires API key in environment)\n# os.environ[\"OPENAI_API_KEY\"] = os.environ.get(\"OPENAI_API_KEY\", \"sk-your-openai-key\")\n# litellm --model openai/gpt-4o","lang":"python","description":"The `litellm-proxy-extras` package is not directly callable. Its primary function is to provide database migration files for the LiteLLM Proxy. To utilize its contributions, you typically install `litellm[proxy]` and then interact with the `litellm` CLI, for example, to run migrations. The quickstart demonstrates how to apply these migrations via the `litellm` CLI."},"warnings":[{"fix":"Do not attempt to import or use `litellm-proxy-extras` in your Python code. Instead, manage and interact with the LiteLLM Proxy and its features (like migrations) through the `litellm` CLI or SDK.","message":"The `litellm-proxy-extras` package is not intended for direct Python imports or programmatic use. It is an internal dependency for the `litellm` proxy, providing components like database migration files that are utilized by the `litellm` CLI or framework, not by user-written Python code directly referencing `litellm-proxy-extras`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"After `pip install --upgrade litellm[proxy]`, you must explicitly run `litellm --use_prisma_migrate` to apply any new database schema changes. It is recommended to back up your database before running migrations.","message":"When upgrading LiteLLM Proxy via `pip` (which includes `litellm-proxy-extras`), database migrations are *not* automatically applied. Users must manually regenerate the Prisma client and run migrations. This is a common footgun, as Docker deployments typically handle this automatically.","severity":"breaking","affected_versions":"All versions"},{"fix":"Avoid using or immediately upgrade any `litellm` installations from affected versions. If you installed via `pip` on March 24, 2026, between 10:39 UTC and 16:00 UTC, verify your installation. Official Docker images were not impacted. Refer to the official LiteLLM security advisory for detailed steps and verified safe versions.","message":"A supply chain attack affected `litellm` versions `1.82.7` and `1.82.8` on PyPI, which were live briefly on March 24, 2026. While `litellm-proxy-extras` itself was not explicitly named as containing the malicious payload, it is a core component of the `litellm` ecosystem, and caution is advised regarding all packages within that timeframe.","severity":"gotcha","affected_versions":"LiteLLM versions 1.82.7 and 1.82.8 (March 24, 2026)"},{"fix":"Always refer to and use the `schema.prisma` file that ships with your installed `litellm-proxy-extras` package version when performing manual database operations or troubleshooting migrations.","message":"When dealing with LiteLLM Proxy database schema, the `schema.prisma` file located within the `litellm-proxy-extras` package is considered the definitive source of truth. Using `schema.prisma` files from other sources (e.g., older versions, Git repository) can lead to migration issues or data corruption.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}