summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b387e96bdc3e612ed9bbfef510d664368ff1dc1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Maintainer: AlphaJack <alphajack at tuta dot io>
# Contributor: Darius Niminenn <root at dnim dot dev>
# Contributor: Sir-Photch <sir-photch@posteo.me>

pkgname="litellm"
pkgver=1.51.3
pkgrel=1
pkgdesc="Call all LLM APIs using the OpenAI format"
arch=(any)
url="https://pypi.org/project/litellm/"
license=("MIT")
depends=(
 "gunicorn"
 "uvicorn"
 "python"
 "python-aiohttp"
 "python-argon2_cffi"
 "python-backoff"
 "python-click"
 "python-dotenv"
 "python-fastapi"
 "python-importlib-metadata"
 "python-jinja"
 "python-openai"
 "python-orjson"
 "python-pyjwt"
 "python-python-multipart"
 "python-requests"
 "python-setuptools"
 "python-tiktoken"
 "python-tokenizers"
)
makedepends=(
 "python-build"
 "python-installer"
 "python-poetry-core"
 "python-wheel"
)
optdepends=(
 "uvicorn: ASGI server for asyncio"
 "gunicorn: WSGI HTTP Server"
 "python-fastapi: Framework for building APIs"
 "python-backoff: Backoff strategies for retrying operations"
 "python-yaml: YAML parser and emitter"
 "python-rq: Simple job queues for Python"
 "python-orjson: Fast JSON parser and serializer"
 "python-apscheduler: Task scheduler"
 "python-streamlit: App framework for Machine Learning and Data Science"
 "ollama: Serve local ollama models"
)

source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz")
b2sums=('6798d707fc54c4f0d7449926ce268ced317b4af1e60e7247f12a4c1d3b7e1e75433a3c380fcacf188e326f58423c36f1411d806e071c46b61e101734ee76c195')
options=("!strip")

prepare(){
 cd "$pkgname-$pkgver"
 # fix relative import
 sed -i "litellm/proxy/proxy_cli.py" \
     -e "s|from proxy_server import|from .proxy_server import|g"
}

build(){
 cd "$pkgname-$pkgver"
 python -m build --wheel --no-isolation
}

package(){
 cd "$pkgname-$pkgver"
 python -m installer --destdir="$pkgdir" dist/*.whl

 # wrapper script for server
 cat << EOF > "$pkgdir/usr/bin/$pkgname"
#!/usr/bin/env python3
import litellm
litellm.run_server()
EOF
 chmod +x "$pkgdir/usr/bin/$pkgname"
}