Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ repos:
args:
- "--fix"
- "--exit-non-zero-on-fix"
exclude: any-llm-sdk-stub
- id: ruff-format
exclude: any-llm-sdk-stub

- repo: local
hooks:
Expand All @@ -36,7 +38,7 @@ repos:
language: system
types: [python]
verbose: true
exclude: demos|scripts
exclude: demos|scripts|any-llm-sdk-stub

- repo: https://github.com/codespell-project/codespell
rev: "v2.4.1"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[![Integration Tests](https://github.com/mozilla-ai/any-llm/actions/workflows/tests-integration.yaml/badge.svg)](https://github.com/mozilla-ai/any-llm/actions/workflows/tests-integration.yaml/)

![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)
[![PyPI](https://img.shields.io/pypi/v/any-llm-sdk)](https://pypi.org/project/any-llm-sdk/)
[![PyPI](https://img.shields.io/pypi/v/any-llm)](https://pypi.org/project/any-llm/)
<a href="https://discord.gg/4gf3zXrQUc">
<img src="https://img.shields.io/static/v1?label=Chat%20on&message=Discord&color=blue&logo=Discord&style=flat-square" alt="Discord">
</a>
Expand All @@ -32,7 +32,7 @@ Switch between OpenAI, Anthropic, Mistral, Ollama, and more without changing you
## Quickstart

```python
pip install 'any-llm-sdk[mistral,ollama]'
pip install 'any-llm[mistral,ollama]'

export MISTRAL_API_KEY="YOUR_KEY_HERE" # or OPENAI_API_KEY, etc
from any_llm import completion
Expand Down Expand Up @@ -63,9 +63,9 @@ print(response.choices[0].message.content)
Install support for specific providers:

```bash
pip install 'any-llm-sdk[openai]' # Just OpenAI
pip install 'any-llm-sdk[mistral,ollama]' # Multiple providers
pip install 'any-llm-sdk[all]' # All supported providers
pip install 'any-llm[openai]' # Just OpenAI
pip install 'any-llm[mistral,ollama]' # Multiple providers
pip install 'any-llm[all]' # All supported providers
```

See our [list of supported providers](https://mozilla-ai.github.io/any-llm/providers/) to choose which ones you need.
Expand Down
31 changes: 31 additions & 0 deletions any-llm-sdk-stub/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Version file generated by setuptools_scm
src/any_llm/_version.py

# Virtual environments
venv/
env/
ENV/
.venv
101 changes: 101 additions & 0 deletions any-llm-sdk-stub/PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Publishing Guide for any-llm-sdk Stub Package

This guide explains how to publish the `any-llm-sdk` stub package to PyPI.

## Prerequisites

1. You must have maintainer access to the `any-llm-sdk` package on PyPI
2. Install build tools:
```bash
pip install build twine
```

## Publishing Steps

### 1. Build the Package

From the `any-llm-sdk-stub` directory:

```bash
cd any-llm-sdk-stub
python -m build
```

This creates distribution files in the `dist/` directory.

### 2. Check the Package

Verify the package is correctly formed:

```bash
twine check dist/*
```

### 3. Upload to TestPyPI (Optional but Recommended)

Test the upload first:

```bash
twine upload --repository testpypi dist/*
```

Then test installation:

```bash
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ any-llm-sdk
```

### 4. Upload to PyPI

Once you've verified everything works:

```bash
twine upload dist/*
```

You'll be prompted for your PyPI credentials (or use an API token).

## Version Management

The version is managed by `setuptools_scm` and automatically derived from git tags in the parent repository. The stub package should use the same version number as the main `any-llm` package for consistency.

To create a new version:

```bash
# In the root of the main repository
git tag v0.16.0
git push origin v0.16.0
```

Then rebuild and publish the stub package.

## Publishing Checklist

- [ ] Main `any-llm` package is published to PyPI
- [ ] Version tag exists in git
- [ ] Built the stub package: `python -m build`
- [ ] Checked the package: `twine check dist/*`
- [ ] (Optional) Tested on TestPyPI
- [ ] Uploaded to PyPI: `twine upload dist/*`
- [ ] Verified installation: `pip install any-llm-sdk`
- [ ] Confirmed deprecation warning appears

## Ongoing Maintenance

This stub package should be republished whenever a new major version of `any-llm` is released to ensure the dependency constraint stays up to date. The stub package version should match the main package version.

## Troubleshooting

### "File already exists" error

If you get an error that the file already exists on PyPI, you need to bump the version number. Clean the dist directory and rebuild:

```bash
rm -rf dist/
python -m build
twine upload dist/*
```

### Import errors

Make sure `any-llm` is installed and importable. The stub package depends on it, so it should be automatically installed when users install `any-llm-sdk`.
58 changes: 58 additions & 0 deletions any-llm-sdk-stub/QUICK_PUBLISH.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
# Quick publishing script for any-llm-sdk stub package
# Run this from the any-llm-sdk-stub directory

set -e # Exit on error

echo "🚀 Publishing any-llm-sdk stub package to PyPI"
echo ""

# Check if we're in the right directory
if [ ! -f "pyproject.toml" ]; then
echo "❌ Error: pyproject.toml not found. Run this from the any-llm-sdk-stub directory."
exit 1
fi

# Check if any-llm is published
echo "🔍 Checking if any-llm is available on PyPI..."
if pip index versions any-llm 2>&1 | grep -q "No matching distribution"; then
echo "❌ Error: 'any-llm' package not found on PyPI."
echo " You MUST publish the main 'any-llm' package first!"
exit 1
fi
echo "✅ Main package 'any-llm' found on PyPI"
echo ""

# Clean previous builds
echo "🧹 Cleaning previous builds..."
rm -rf dist/ build/ *.egg-info
echo ""

# Build the package
echo "📦 Building package..."
python -m build
echo ""

# Check the package
echo "🔍 Checking package..."
twine check dist/*
echo ""

# Ask for confirmation
read -p "Ready to upload to PyPI? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Cancelled."
exit 1
fi

# Upload to PyPI
echo "📤 Uploading to PyPI..."
twine upload dist/*
echo ""

echo "✅ Successfully published to PyPI!"
echo ""
echo "🧪 Test installation with:"
echo " pip install any-llm-sdk"
echo ""
66 changes: 66 additions & 0 deletions any-llm-sdk-stub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# any-llm-sdk → any-llm

⚠️ **DEPRECATION NOTICE** ⚠️

The `any-llm-sdk` package has been renamed to `any-llm`.

## Migration Guide

### Update Your Installation

**Old:**
```bash
pip install any-llm-sdk
```

**New:**
```bash
pip install any-llm
```

### Update Your Dependencies

If you have `any-llm-sdk` in your `requirements.txt`, `pyproject.toml`, or other dependency files:

**requirements.txt:**
```diff
- any-llm-sdk>=0.15.0
+ any-llm>=0.16.0
```

**pyproject.toml:**
```diff
dependencies = [
- "any-llm-sdk[all]>=0.15.0",
+ "any-llm[all]>=0.16.0",
]
```

### No Code Changes Required

Your import statements will continue to work without any changes:

```python
from any_llm import completion, AnyLLM
# Works exactly the same way!
```

## What This Package Does

This package (`any-llm-sdk`) now serves as a lightweight redirect to the real package (`any-llm`). When you install `any-llm-sdk`, it automatically installs `any-llm` as a dependency and re-exports all its functionality.

## Why the Change?

The shorter package name `any-llm` better matches the project name and is more concise for users to type and remember.

## Timeline

- **Now**: Both packages work. `any-llm-sdk` shows a deprecation warning.
- **Future**: `any-llm-sdk` stub package will be maintained for backwards compatibility but may eventually be deprecated.

## More Information

For the latest documentation and updates, visit:
- **Documentation**: https://mozilla-ai.github.io/any-llm/
- **GitHub**: https://github.com/mozilla-ai/any-llm
- **PyPI (new)**: https://pypi.org/project/any-llm/
Loading
Loading