File size: 2,850 Bytes
dfb775d
 
74da4f7
dfb775d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c4e0c8c
 
 
 
dfb775d
 
 
c4e0c8c
dfb775d
 
 
 
 
 
 
c4e0c8c
dfb775d
 
 
 
 
 
 
 
 
 
 
 
 
74da4f7
 
 
dfb775d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
[project]
name = "mindxtrain"
version = "1.0.4"
description = "Production training framework for fine-tuning open-weight LLMs on AMD MI300X and serving them through an OpenAI-compatible API."
requires-python = ">=3.12,<3.13"
license = { text = "Apache-2.0" }
authors = [{ name = "mindX" }]
readme = "README.md"
dependencies = [
    "pydantic>=2.9",
    "pyyaml>=6.0",
    "typer>=0.13",
    "rich>=13.9",
    "blake3>=0.4",
    "fastapi>=0.115",
    "uvicorn[standard]>=0.32",
    "httpx>=0.27",
]

[project.scripts]
mindxtrain = "mindxtrain.cli.main:app"

[project.optional-dependencies]
ml = [
    "trl>=0.13",
    "transformers>=4.46",
    "peft>=0.13",
    "accelerate>=1.0",
    "datasets>=3.0",
]
eval = [
    "lm-eval>=0.4",
    "lighteval>=0.7",
    "inspect-ai>=0.3",
    "jinja2>=3.1",
]
data = [
    "datasketch>=1.6",
    "sentence-transformers>=3.2",
    "faiss-cpu>=1.9",
    "pyarrow>=18.0",
]
serve = ["vllm>=0.6"]
ui = [
    "gradio[mcp]>=5.0",
    "pyyaml>=6.0",
]
# The Hub is not a chain. It had been living inside `chain`, so reaching Hugging Face
# meant installing web3 and the Algorand SDK; `chain` still pulls it so existing
# installs keep working.
hf = ["huggingface-hub>=0.26"]
chain = [
    "web3>=7.5",
    "py-algorand-sdk>=2.7",
    "mindxtrain[hf]",
]
obs = [
    "opentelemetry-sdk>=1.28",
    "prometheus-client>=0.21",
    "psutil>=6.1",
]
all = [
    "mindxtrain[ml,eval,data,serve,chain,obs,ui,hf]",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["mindxtrain"]

[dependency-groups]
dev = [
    "pytest>=8.3",
    "pytest-asyncio>=0.24",
    # starlette 1.6 deprecates driving its TestClient with httpx and asks for httpx2.
    # 24 test modules use TestClient, so the dependency moves rather than the tests.
    "httpx2>=2.13",
    "ruff>=0.7",
    "mypy>=1.13",
    "types-PyYAML>=6.0",
]

[tool.ruff]
target-version = "py312"
line-length = 100
extend-exclude = ["docs/blueprints/**"]

[tool.ruff.lint]
select = ["E", "F", "W", "I", "B", "UP", "RUF"]
# E501 — line length is enforced by `line-length` directly.
# RUF002/RUF003 — Unicode chars in docstrings/comments are intentional
#   throughout the MEI module: the spec uses α, ≥, ≤, ×, §, etc.
#   Rewriting them as ASCII obscures meaning.
ignore = ["E501", "RUF002", "RUF003"]

[tool.ruff.lint.per-file-ignores]
# Typer's idiomatic pattern is `arg: T = typer.Option(...)` — flagged as B008 falsely.
"mindxtrain/cli/main.py" = ["B008"]

[tool.mypy]
python_version = "3.12"
strict = true
files = ["mindxtrain/config", "mindxtrain/provenance"]
exclude = ["docs/", "tests/"]

[[tool.mypy.overrides]]
module = ["yaml.*", "blake3.*", "algosdk.*", "web3.*"]
ignore_missing_imports = true

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
addopts = "-ra"