-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
163 lines (151 loc) · 5.17 KB
/
pyproject.toml
File metadata and controls
163 lines (151 loc) · 5.17 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "onellm"
dynamic = ["version"]
description = "A unified interface for interacting with large language models from various providers - a complete drop-in replacement for OpenAI's client"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "Apache-2.0"}
authors = [
{name = "Ran Aroussi", email = "ran@aroussi.com"}
]
dependencies = [
"requests>=2.32.5",
# httpx replaces aiohttp as the async HTTP client (see CHANGELOG
# 0.20260427.0). The [http2] extra pulls in `h2`, which we negotiate
# via TLS ALPN inside ``onellm/http_pool.py``.
"httpx[http2]>=0.27.0",
"pydantic>=2.12.5",
"PyYAML>=6.0.3",
"openai>=2.15.0",
"tiktoken>=0.12.0",
"huggingface-hub>=1.3.4",
# Transitive pins — minimum safe versions for known CVEs
"urllib3>=2.6.3",
"filelock>=3.20.3",
"pyasn1>=0.6.2",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
]
[project.urls]
"Homepage" = "https://github.com/muxi-ai/onellm"
"Documentation" = "https://docs.muxi.io"
"Issues" = "https://github.com/muxi-ai/onellm/issues"
[project.optional-dependencies]
# Lean local-embedding backend: onnxruntime (CPU) + transformers tokenizer.
# Does NOT pull torch. Repos that ship only PyTorch weights need the
# [local-pytorch] extra in addition. This is a HARD BREAK from the v0.20260415
# shape of [cache] which pulled sentence-transformers; see CHANGELOG.
cache = [
"onnxruntime>=1.20.0",
"transformers>=4.44.0",
"numpy>=1.26.0",
"faiss-cpu>=1.13.2",
]
# CUDA-accelerated end-to-end GPU stack for local embeddings:
# - onnxruntime-gpu: CUDAExecutionProvider auto-selected at session build
# - faiss-gpu-cu12: GPU vector index (community-maintained PyPI wheel;
# the official FAISS project ships GPU via conda only)
# Replaces the earlier half-baked [local-gpu] shape that paired GPU ONNX
# with CPU FAISS. Installs the same transformers/numpy baseline as [cache].
# CUDA-only: Apple Silicon should use [cache] (CoreML EP auto-activates);
# AMD/Intel GPUs and DirectML are not supported today (no matching FAISS
# GPU wheel). See CHANGELOG 0.20260422.2.
local-cuda = [
"onnxruntime-gpu>=1.20.0",
"transformers>=4.44.0",
"numpy>=1.26.0",
"faiss-gpu-cu12>=1.13.0",
]
# Deprecated alias kept for back-compat. Resolves to [local-cuda] via the
# transitive-extra mechanism, so pinning onellm[local-gpu] still works and
# now gets the faiss-gpu-cu12 upgrade transparently. Scheduled for removal
# in a future major release; please migrate to onellm[local-cuda].
local-gpu = [
"onellm[local-cuda]",
]
# Fallback backend for repos that don't ship ONNX weights. Pulls torch +
# sentence-transformers (~1 GB install). Use only when you're pinned to a
# PyTorch-only repo; prefer ONNX-ready repos (e.g. nomic-ai/*) otherwise.
local-pytorch = [
"sentence-transformers>=5.2.2",
]
all = [
"anthropic>=0.76.0",
"google-generativeai>=0.8.6",
"boto3>=1.42.35",
"llama-cpp-python>=0.3.16",
"google-auth>=2.48.0",
"google-cloud-aiplatform>=1.134.0",
# Default to the CPU onnxruntime + faiss stack for [all] so it stays
# installable on every platform (including macOS, which has no CUDA).
# Callers who want GPU should use onellm[local-cuda] explicitly.
"onnxruntime>=1.20.0",
"transformers>=4.44.0",
"sentence-transformers>=5.2.2",
"numpy>=1.26.0",
"faiss-cpu>=1.13.2",
]
bedrock = [
"boto3>=1.42.35",
]
vertexai = [
"google-auth>=2.48.0",
"google-cloud-aiplatform>=1.134.0",
]
llama = [
"llama-cpp-python>=0.3.16",
]
dev = [
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.0.0",
"black>=26.1.0",
"isort>=7.0.0",
"mypy>=1.19.1",
"ruff>=0.14.14",
"python-dotenv>=1.2.1",
]
[project.scripts]
onellm = "onellm.cli:main"
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
where = ["."]
include = ["onellm*"]
[tool.setuptools.dynamic]
version = {file = ["onellm/.version"]}
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
select = ["E", "F", "N", "W", "C90", "I", "B", "UP", "A"]
ignore = [
"E501", # Line too long (handled by black)
"A002", # Argument shadowing builtin (e.g. `input`) — OpenAI API compat
"C901", # Function too complex — tracked for incremental cleanup
"E402", # Module-level import not at top — integration test path setup
"B904", # raise ... from err — tracked for incremental cleanup
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
markers = [
"slow: marks tests as slow (real model downloads, cold starts); deselect with '-m \"not slow\"'",
"integration: marks tests that require real external services or API keys",
]
[tool.black]
line-length = 100
target-version = ["py310"]
[tool.isort]
profile = "black"
line_length = 100