-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathpyproject.toml
More file actions
442 lines (416 loc) · 11.1 KB
/
pyproject.toml
File metadata and controls
442 lines (416 loc) · 11.1 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
[build-system]
requires = ["setuptools>=69.0.0", "wheel>=0.42.0"]
build-backend = "setuptools.build_meta"
[project]
name = "effgen"
dynamic = ["version"]
description = "A comprehensive framework for building agents with Small Language Models"
readme = "README_PYPI.md"
requires-python = ">=3.10"
license = "Apache-2.0"
authors = [
{name = "Gaurav Srivastava", email = "gks@vt.edu"}
]
maintainers = [
{name = "Gaurav Srivastava", email = "gks@vt.edu"}
]
keywords = [
"ai", "agents", "llm", "slm", "language-models", "small-language-models",
"tool-use", "function-calling", "prompt-engineering", "multi-agent",
"agent-framework", "transformers", "vllm", "openai", "anthropic", "gemini",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Framework :: AsyncIO",
"Typing :: Typed",
]
dependencies = [
# Deep Learning & Model Support
"torch>=2.0.0",
"transformers>=4.35.0",
"accelerate>=0.24.0",
"safetensors>=0.4.0",
"sentencepiece>=0.1.99",
"protobuf>=3.20.0",
# API Model Adapters
"openai>=1.3.0",
"anthropic>=0.7.0",
"google-generativeai>=0.3.0",
"google-genai>=1.0.0",
# Configuration Management
"pyyaml>=6.0.1",
"jsonschema>=4.19.0",
"json5>=0.9.14",
"python-dotenv>=1.0.0",
# Tool Support & HTTP
"requests>=2.31.0",
"aiohttp>=3.9.0",
"httpx>=0.25.0",
# Web Search
"duckduckgo-search>=8.1.0",
"ddgs>=9.9.3",
# File Operations & Code Execution
"docker>=6.1.0",
"nbformat>=5.9.0",
"jupyter-client>=8.5.0",
# Utilities
"numpy>=1.24.0",
"pandas>=2.0.0",
"pydantic>=2.0.0",
"tqdm>=4.66.0",
"rich>=13.7.0",
"click>=8.1.0",
"colorama>=0.4.6",
"jinja2>=3.1.0",
# Async Support
"asyncio-throttle>=1.0.1",
"nest-asyncio>=1.5.8",
# Logging & Monitoring
"loguru>=0.7.0",
# GPU Management
"gputil>=1.4.0",
"nvidia-ml-py>=11.495.46",
# Protocol Support - MCP
"mcp>=1.25.0",
# Performance Monitoring
"psutil>=5.9.0",
# Data Processing
"tiktoken>=0.5.0",
"scikit-learn>=1.3.0",
# Security
"cryptography>=41.0.0",
# API Server
"fastapi>=0.109.0",
"uvicorn>=0.27.0",
]
[project.urls]
Homepage = "https://effgen.org/"
Documentation = "https://effgen.org/docs/"
Repository = "https://github.com/ctrl-gaurav/effGen"
"Bug Tracker" = "https://github.com/ctrl-gaurav/effGen/issues"
Changelog = "https://github.com/ctrl-gaurav/effGen/blob/main/CHANGELOG.md"
[project.scripts]
effgen = "effgen.cli:main"
effgen-agent = "effgen.cli:agent_main"
effgen-web = "effgen.cli:web_agent_main"
[project.optional-dependencies]
dev = [
"pytest>=7.4.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.1.0",
"pytest-timeout>=2.2.0",
"pytest-forked>=1.6.0",
"black>=23.12.0",
"isort>=5.13.0",
"flake8>=6.1.0",
"mypy>=1.7.0",
"bitsandbytes>=0.46.1",
]
vllm = ["vllm>=0.2.7"]
mlx = [
"mlx>=0.16.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
"mlx-lm>=0.18.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
]
mlx-vlm = [
"mlx>=0.16.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
"mlx-lm>=0.18.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
"mlx-vlm>=0.1.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
]
rag = [
"sentence-transformers>=2.2.0",
"faiss-cpu>=1.7.4",
]
finance = [
"yfinance>=0.2.31",
]
data = [
"matplotlib>=3.7.0",
"plotly>=5.18.0",
]
eval = [
"rouge-score>=0.1.2",
"nltk>=3.8.0",
]
gguf = [
"llama-cpp-python>=0.2.0",
]
cerebras = [
"cerebras-cloud-sdk>=1.0",
]
flash-attn = ["flash-attn>=2.3.0"]
vector-db = [
"faiss-cpu>=1.7.4",
"chromadb>=0.4.18",
"qdrant-client>=1.7.0",
]
search = [
"duckduckgo-search>=8.1.0",
"google-search-results>=2.4.2",
"google-api-python-client>=2.108.0",
]
cloud-secrets = [
"boto3>=1.28.0",
"hvac>=1.2.0",
"azure-keyvault-secrets>=4.7.0",
"azure-identity>=1.14.0",
]
monitoring = [
"wandb>=0.16.0",
"tensorboard>=2.15.0",
]
all = [
# NOTE: flash-attn is intentionally NOT in [all]. Its setup.py imports
# torch before pip's isolated build env has torch installed (well-known
# upstream bug), which makes `pip install effgen[all]` always fail.
# Install flash-attn separately: see docs/installation.md.
"vllm>=0.2.7",
"faiss-cpu>=1.7.4",
"chromadb>=0.4.18",
"qdrant-client>=1.7.0",
"duckduckgo-search>=8.1.0",
"google-search-results>=2.4.2",
"google-api-python-client>=2.108.0",
"boto3>=1.28.0",
"hvac>=1.2.0",
"azure-keyvault-secrets>=4.7.0",
"azure-identity>=1.14.0",
"wandb>=0.16.0",
"tensorboard>=2.15.0",
"sentence-transformers>=2.2.0",
"yfinance>=0.2.31",
"matplotlib>=3.7.0",
"plotly>=5.18.0",
"rouge-score>=0.1.2",
"nltk>=3.8.0",
"llama-cpp-python>=0.2.0",
"cerebras-cloud-sdk>=1.0",
"bitsandbytes>=0.46.1",
"datasets>=2.14.0",
]
[tool.setuptools.dynamic]
version = {attr = "effgen.__version__"}
[tool.setuptools.packages.find]
exclude = ["tests", "tests.*", "examples", "docs", "scripts"]
[tool.setuptools.package-data]
effgen = [
"prompts/templates/*.yaml",
"prompts/templates/*.json",
"config/schemas/*.json",
"config/schemas/*.yaml",
"config/*.yaml",
"config/*.json",
"py.typed",
]
# Black - Code Formatter
[tool.black]
line-length = 100
target-version = ['py310', 'py311', 'py312', 'py313']
include = '\.pyi?$'
extend-exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| migrations
)/
'''
# isort - Import Sorter
[tool.isort]
profile = "black"
line_length = 100
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
skip_glob = ["*/migrations/*", "*/build/*", "*/dist/*"]
known_first_party = ["effgen"]
known_third_party = [
"torch",
"transformers",
"openai",
"anthropic",
"google",
"yaml",
"docker",
"pytest",
]
# mypy - Type Checker
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
# Disabled: `# type: ignore` comments may appear "unused" on one Python/lib
# version but genuinely needed on another (optional-dep stubs, Python-version
# gated code). Enforcing this cross-version is flaky, so we trust the comment.
warn_unused_ignores = false
warn_no_return = true
# Unreachable-code warnings flap across Python/library versions (e.g. a sys.version
# branch mypy proves dead on one interpreter is live on another). Disabling here;
# dead code is caught by ruff (F) and tests.
warn_unreachable = false
strict_equality = true
show_error_codes = true
show_column_numbers = true
pretty = true
# Per-module options
[[tool.mypy.overrides]]
module = [
"vllm.*",
"transformers.*",
"anthropic.*",
"google.generativeai.*",
"duckduckgo_search.*",
"docker.*",
"faiss.*",
"chromadb.*",
"qdrant_client.*",
]
ignore_missing_imports = true
# pytest - Testing Framework
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--showlocals",
"--tb=short",
"--cov=effgen",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"gpu: marks tests that require GPU",
"api: marks tests that require API keys",
"docker: marks tests that require Docker",
]
asyncio_mode = "auto"
timeout = 120
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning",
]
# Coverage - Code Coverage
[tool.coverage.run]
source = ["effgen"]
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/site-packages/*",
"*/examples/*",
]
branch = true
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.coverage.html]
directory = "htmlcov"
# Pylint - Linter
[tool.pylint.main]
py-version = "3.10"
ignore = ["CVS", "migrations", "tests"]
jobs = 0 # Auto-detect CPUs
[tool.pylint.messages_control]
disable = [
"C0111", # missing-docstring
"C0103", # invalid-name
"R0903", # too-few-public-methods
"R0913", # too-many-arguments
"W0212", # protected-access
]
[tool.pylint.format]
max-line-length = 100
[tool.pylint.design]
max-args = 10
max-attributes = 15
# Bandit - Security Linter
[tool.bandit]
exclude_dirs = ["/tests", "/examples"]
skips = ["B101", "B601"] # Skip assert_used and paramiko_calls
# Ruff - Fast Python Linter (alternative to flake8)
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by black)
"B008", # do not perform function calls in argument defaults
"B028", # stacklevel in warnings.warn (pre-existing)
"B904", # raise ... from err (pre-existing, too many to fix in patch)
"B905", # zip() without strict= (pre-existing)
"C901", # too complex
"UP037", # quoted annotations (pre-existing, cosmetic)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Ignore unused imports in __init__.py
"effgen/cli.py" = ["F403"] # Star import is intentional
# Examples and validation scripts call load_dotenv() before effgen imports so
# env-dependent modules see the keys at import time — the E402 is intentional.
"examples/**/*.py" = ["E402"]
"build_plan/**/*.py" = ["E402"]
"scripts/**/*.py" = ["E402"]
"tests/conftest.py" = ["E402"] # sys.path manipulation must precede effgen imports
[tool.ruff.lint.isort]
known-first-party = ["effgen"]
# Pydocstyle - Docstring Checker
[tool.pydocstyle]
convention = "google"
add-ignore = ["D100", "D104", "D105", "D107"]
match = "(?!test_).*\\.py"
match-dir = "^(?!(tests|examples|docs)).*"