The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
build(github/manual_pypi_publish.yml): manual workflow to publish pip package - used for pushing dev releases (#12985)
Krish Dholakia23d562b1a24f
diff --git a/.github/workflows/README.md b/.github/workflows/README.mdnew file mode 100644index 00000000000..b4e777969d9--- /dev/null+++ b/.github/workflows/README.md@@ -0,0 +1,35 @@+# Simple PyPI Publishing++A GitHub workflow to manually publish LiteLLM packages to PyPI with a specified version.++## How to Use++1. Go to the **Actions** tab in the GitHub repository+2. Select **Simple PyPI Publish** from the workflow list+3. Click **Run workflow**+4. Enter the version to publish (e.g., `1.74.10`)++## What the Workflow Does++1. **Updates** the version in `pyproject.toml`+2. **Copies** the model prices backup file+3. **Builds** the Python package+4. **Publishes** to PyPI++## Prerequisites++Make sure the following secret is configured in the repository:+- `PYPI_PUBLISH_PASSWORD`: PyPI API token for authentication++## Example Usage++- Version: `1.74.11` → Publishes as v1.74.11+- Version: `1.74.10-hotfix1` → Publishes as v1.74.10-hotfix1++## Features++- ✅ Manual trigger with version input+- ✅ Automatic version updates in `pyproject.toml`+- ✅ Repository safety check (only runs on official repo)+- ✅ Clean package building and publishing+- ✅ Success confirmation with PyPI package link\ No newline at end of filediff --git a/.github/workflows/simple_pypi_publish.yml b/.github/workflows/simple_pypi_publish.ymlnew file mode 100644index 00000000000..e1830556819--- /dev/null+++ b/.github/workflows/simple_pypi_publish.yml@@ -0,0 +1,67 @@+name: Simple PyPI Publish++on:+ workflow_dispatch:+ inputs:+ version:+ description: 'Version to publish (e.g., 1.74.10)'+ required: true+ type: string++env:+ TWINE_USERNAME: __token__++jobs:+ publish:+ runs-on: ubuntu-latest+ if: github.repository == 'BerriAI/litellm'++ steps:+ - name: Checkout code+ uses: actions/checkout@v4++ - name: Set up Python+ uses: actions/setup-python@v4+ with:+ python-version: '3.8'++ - name: Install dependencies+ run: |+ python -m pip install --upgrade pip+ pip install toml build wheel twine++ - name: Update version in pyproject.toml+ run: |+ python -c "+ import toml++ with open('pyproject.toml', 'r') as f:+ data = toml.load(f)++ data['tool']['poetry']['version'] = '${{ github.event.inputs.version }}'++ with open('pyproject.toml', 'w') as f:+ toml.dump(data, f)++ print(f'Updated version to ${{ github.event.inputs.version }}')+ "++ - name: Copy model prices file+ run: |+ cp model_prices_and_context_window.json litellm/model_prices_and_context_window_backup.json++ - name: Build package+ run: |+ rm -rf build dist+ python -m build++ - name: Publish to PyPI+ env:+ TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_PASSWORD }}+ run: |+ twine upload dist/*++ - name: Output success+ run: |+ echo "✅ Successfully published litellm v${{ github.event.inputs.version }} to PyPI"+ echo "📦 Package: https://pypi.org/project/litellm/${{ github.event.inputs.version }}/"\ No newline at end of file