-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
233 lines (207 loc) · 6.56 KB
/
pyproject.toml
File metadata and controls
233 lines (207 loc) · 6.56 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
[build-system]
requires = ["setuptools>=70", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "llmcore"
version = "0.49.8"
description = "A unified, flexible, and extensible interface for interacting with various Large Language Models (LLMs)."
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
authors = [
{ name = "Araray Velho", email = "araray@gmail.com" }
]
keywords = ["llm", "ai", "language-model", "chat", "rag", "nlp", "neural", "networks", "library", "module", "agents", "sandbox"]
# Classifiers to reflect library role
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Communications :: Chat",
"Operating System :: OS Independent",
"Framework :: AsyncIO",
"Typing :: Typed",
]
# Core dependencies for llmcore - LIBRARY MODE ONLY
dependencies = [
"confy>=0.4.0",
"aiohttp>=3.11.0",
"aiofiles>=24.0.0",
"python-dotenv>=1.0.0",
"typing_extensions>=4.0.0",
"toml>=0.10.2",
"pydantic>=2.0.0",
"psutil>=7.2.2",
"tiktoken>=0.9.0", # For token counting (Ollama, OpenAI)
"aiosqlite>=0.21.0", # For SQLite session storage
"deepdiff>=8.5.0", # For configuration diff/merge
"sqlalchemy[asyncio]>=2.0.40", # For session storage (SQLite/Postgres backends)
]
[project.optional-dependencies]
# Dependencies for specific LLM providers
openai = ["openai>=2.31.0"]
anthropic = ["anthropic>=0.94.0"]
gemini = ["google-genai>=1.72.0", "google-api-core>=2.30.0"]
ollama = ["ollama>=0.6.0"]
sentence_transformers = ["sentence-transformers>=5.2.0"]
# Dependencies for specific storage backends
sqlite = [] # sqlite3 is part of standard library
postgres = ["psycopg[binary]>=3.0.0", "psycopg_pool>=3.0.0", "pgvector>=0.4.1"]
chromadb = ["chromadb>=1.5.0"]
# ============================================================================
# SANDBOX DEPENDENCIES (NEW in v0.26.0)
# ============================================================================
# Dependencies for agent sandbox execution environments.
# Install with: pip install llmcore[sandbox] or pip install llmcore[sandbox-docker]
# Docker sandbox support
sandbox-docker = [
"docker>=7.0.0", # Docker SDK for Python
]
# VM/SSH sandbox support
sandbox-vm = [
"paramiko>=4.0.0", # SSH client library
]
# Full sandbox support (both Docker and VM)
sandbox = [
"docker>=7.0.0",
"paramiko>=4.0.0",
]
# ============================================================================
# Testing dependencies
# ============================================================================
test = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.0.0",
"pytest-mock>=3.10.0",
"respx>=0.20.0", # For mocking HTTP requests
"ruff>=0.1.0",
]
# Development dependencies (includes testing and other tools)
dev = [
"llmcore[test]",
"llmcore[sandbox]", # Include sandbox deps for development
"ruff", # Linter
"mypy>=1.0.0", # Type checker
"pre-commit>=3.0.0", # For git hooks
"tox>=4.0.0", # For testing in different environments
"build", # For building the package
"twine", # For uploading to PyPI
"pytes",
"pytest-asyncio",
]
# Full installation with all optional dependencies
all = [
"llmcore[openai]",
"llmcore[anthropic]",
"llmcore[gemini]",
"llmcore[ollama]",
"llmcore[sqlite]",
"llmcore[postgres]",
"llmcore[chromadb]",
"llmcore[sandbox]",
]
[project.urls]
Homepage = "https://github.com/araray/llmcore"
Repository = "https://github.com/araray/llmcore"
Issues = "https://github.com/araray/llmcore/issues"
Documentation = "https://github.com/araray/llmcore/blob/main/docs/USAGE.md"
Changelog = "https://github.com/araray/llmcore/blob/main/CHANGELOG.md"
[project.scripts]
llmcore-storage = "llmcore.storage.cli:main"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
llmcore = [
"py.typed",
"config/*.toml",
"model_cards/default_cards/**/*.json",
]
# --- Ruff Linter Configuration ---
[tool.ruff]
exclude = [
".bzr", ".direnv", ".eggs", ".git", ".hg", ".mypy_cache", ".nox",
".pants.d", ".pytype", ".ruff_cache", ".svn", ".tox", ".venv",
"__pypackages__", "_build", "buck-out", "build", "dist",
"node_modules", "venv", "*.egg-info",
]
line-length = 100
indent-width = 4
[tool.ruff.lint]
select = [
"E", "W", "F", "I", "C", "B", "A", "RUF", "ASYNC", "PYI",
]
ignore = [
"E501", # Line too long (handled by formatter)
"B008", # Do not perform function calls in argument defaults
"C901", # Too complex
"E731", # do not assign a lambda expression, use a def
"A003", # Class attribute shadowing builtin
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# --- MyPy Type Checker Configuration ---
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
disallow_untyped_defs = true
check_untyped_defs = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[[tool.mypy.overrides]]
module = [
"docker.*",
"paramiko.*",
]
ignore_missing_imports = true
# --- Pytest Configuration ---
[tool.pytest.ini_options]
minversion = "7.0"
#addopts = "-ra -q --cov=src/llmcore --cov-report=term-missing --cov-report=xml"
addopts = ""
testpaths = [
"tests",
]
asyncio_mode = "auto"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"sandbox: marks tests that require sandbox infrastructure",
"docker: marks tests that require Docker",
"vm: marks tests that require VM/SSH access",
"asyncio: mark test as an asyncio test",
"requires_postgres: Tests that require PostgreSQL database",
"requires_pgvector: Tests that require pgvector extension",
]
# --- Coverage Configuration ---
[tool.coverage.run]
source = ["src/llmcore"]
branch = true
omit = [
"src/llmcore/__main__.py",
"*/tests/*",
]
[tool.coverage.report]
show_missing = true
fail_under = 85
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]