fastsft 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. fastsft-0.1.0/.env.example +1 -0
  2. fastsft-0.1.0/.gitattributes +2 -0
  3. fastsft-0.1.0/.github/CODEOWNERS +4 -0
  4. fastsft-0.1.0/.github/dependabot.yml +13 -0
  5. fastsft-0.1.0/.github/workflows/build.yml +20 -0
  6. fastsft-0.1.0/.github/workflows/codeql.yml +33 -0
  7. fastsft-0.1.0/.github/workflows/lint.yml +16 -0
  8. fastsft-0.1.0/.github/workflows/publish.yml +25 -0
  9. fastsft-0.1.0/.github/workflows/test.yml +17 -0
  10. fastsft-0.1.0/.github/workflows/typecheck.yml +17 -0
  11. fastsft-0.1.0/.gitignore +13 -0
  12. fastsft-0.1.0/.python-version +1 -0
  13. fastsft-0.1.0/LICENSE +21 -0
  14. fastsft-0.1.0/PKG-INFO +544 -0
  15. fastsft-0.1.0/README.md +517 -0
  16. fastsft-0.1.0/TUTORIAL.md +275 -0
  17. fastsft-0.1.0/data_generation_tutorial.md +459 -0
  18. fastsft-0.1.0/evaluation_tutorial.md +265 -0
  19. fastsft-0.1.0/pyproject.toml +144 -0
  20. fastsft-0.1.0/src/fastsft/__init__.py +3 -0
  21. fastsft-0.1.0/src/fastsft/constants.py +36 -0
  22. fastsft-0.1.0/src/fastsft/data/__init__.py +0 -0
  23. fastsft-0.1.0/src/fastsft/data/config.py +34 -0
  24. fastsft-0.1.0/src/fastsft/data/constants.py +33 -0
  25. fastsft-0.1.0/src/fastsft/data/prompt_generator.py +97 -0
  26. fastsft-0.1.0/src/fastsft/data/refiner.py +72 -0
  27. fastsft-0.1.0/src/fastsft/data/response_generator.py +21 -0
  28. fastsft-0.1.0/src/fastsft/data/viewer.py +93 -0
  29. fastsft-0.1.0/src/fastsft/device.py +53 -0
  30. fastsft-0.1.0/src/fastsft/eval/__init__.py +7 -0
  31. fastsft-0.1.0/src/fastsft/eval/config.py +40 -0
  32. fastsft-0.1.0/src/fastsft/eval/constants.py +53 -0
  33. fastsft-0.1.0/src/fastsft/eval/embeddings.py +44 -0
  34. fastsft-0.1.0/src/fastsft/eval/evaluator.py +243 -0
  35. fastsft-0.1.0/src/fastsft/eval/inference.py +129 -0
  36. fastsft-0.1.0/src/fastsft/eval/inference_viewer.py +83 -0
  37. fastsft-0.1.0/src/fastsft/eval/prompt_set.py +120 -0
  38. fastsft-0.1.0/src/fastsft/eval/results.py +221 -0
  39. fastsft-0.1.0/src/fastsft/eval/results_viewer.py +153 -0
  40. fastsft-0.1.0/src/fastsft/eval/run.py +252 -0
  41. fastsft-0.1.0/src/fastsft/findings.py +21 -0
  42. fastsft-0.1.0/src/fastsft/findings_view.py +30 -0
  43. fastsft-0.1.0/src/fastsft/helper.py +121 -0
  44. fastsft-0.1.0/src/fastsft/main.py +344 -0
  45. fastsft-0.1.0/src/fastsft/model/__init__.py +0 -0
  46. fastsft-0.1.0/src/fastsft/model/_logging.py +21 -0
  47. fastsft-0.1.0/src/fastsft/model/base.py +154 -0
  48. fastsft-0.1.0/src/fastsft/model/constants.py +41 -0
  49. fastsft-0.1.0/src/fastsft/model/guide.py +53 -0
  50. fastsft-0.1.0/src/fastsft/model/judge.py +123 -0
  51. fastsft-0.1.0/src/fastsft/pipeline.py +105 -0
  52. fastsft-0.1.0/src/fastsft/progress.py +39 -0
  53. fastsft-0.1.0/src/fastsft/py.typed +0 -0
  54. fastsft-0.1.0/src/fastsft/stages/__init__.py +0 -0
  55. fastsft-0.1.0/src/fastsft/stages/base.py +53 -0
  56. fastsft-0.1.0/src/fastsft/stages/constants.py +11 -0
  57. fastsft-0.1.0/src/fastsft/stages/data_formatter.py +77 -0
  58. fastsft-0.1.0/src/fastsft/stages/data_generator.py +154 -0
  59. fastsft-0.1.0/src/fastsft/stages/fine_tuner.py +161 -0
  60. fastsft-0.1.0/src/fastsft/training/__init__.py +0 -0
  61. fastsft-0.1.0/src/fastsft/training/config.py +67 -0
  62. fastsft-0.1.0/src/fastsft/training/constants.py +59 -0
  63. fastsft-0.1.0/src/fastsft/training/heuristic.py +300 -0
  64. fastsft-0.1.0/src/fastsft/training/local_trainer.py +56 -0
  65. fastsft-0.1.0/src/fastsft/training/modal_app.py +79 -0
  66. fastsft-0.1.0/src/fastsft/training/stats.py +246 -0
  67. fastsft-0.1.0/src/fastsft/training/stats_viewer.py +181 -0
  68. fastsft-0.1.0/src/fastsft/training/trainer.py +234 -0
  69. fastsft-0.1.0/src/fastsft/validation_checks.py +62 -0
  70. fastsft-0.1.0/src/fastsft/warnings_filter.py +48 -0
  71. fastsft-0.1.0/tests/conftest.py +152 -0
  72. fastsft-0.1.0/tests/data/test_constants.py +59 -0
  73. fastsft-0.1.0/tests/data/test_prompt_generator.py +181 -0
  74. fastsft-0.1.0/tests/data/test_refiner.py +183 -0
  75. fastsft-0.1.0/tests/eval/test_constants.py +73 -0
  76. fastsft-0.1.0/tests/eval/test_embeddings.py +169 -0
  77. fastsft-0.1.0/tests/eval/test_evaluator.py +396 -0
  78. fastsft-0.1.0/tests/eval/test_inference.py +374 -0
  79. fastsft-0.1.0/tests/eval/test_prompt_set.py +99 -0
  80. fastsft-0.1.0/tests/eval/test_results.py +256 -0
  81. fastsft-0.1.0/tests/eval/test_run.py +303 -0
  82. fastsft-0.1.0/tests/model/conftest.py +23 -0
  83. fastsft-0.1.0/tests/model/test_base.py +248 -0
  84. fastsft-0.1.0/tests/model/test_constants.py +73 -0
  85. fastsft-0.1.0/tests/model/test_guide.py +79 -0
  86. fastsft-0.1.0/tests/model/test_judge.py +137 -0
  87. fastsft-0.1.0/tests/stages/test_base.py +67 -0
  88. fastsft-0.1.0/tests/stages/test_constants.py +28 -0
  89. fastsft-0.1.0/tests/stages/test_data_formatter.py +119 -0
  90. fastsft-0.1.0/tests/stages/test_data_generator.py +155 -0
  91. fastsft-0.1.0/tests/stages/test_fine_tuner.py +100 -0
  92. fastsft-0.1.0/tests/test_constants.py +67 -0
  93. fastsft-0.1.0/tests/test_e2e_live.py +206 -0
  94. fastsft-0.1.0/tests/test_fake_conformance.py +58 -0
  95. fastsft-0.1.0/tests/test_findings_view.py +53 -0
  96. fastsft-0.1.0/tests/test_helper.py +194 -0
  97. fastsft-0.1.0/tests/test_imports.py +35 -0
  98. fastsft-0.1.0/tests/test_main.py +150 -0
  99. fastsft-0.1.0/tests/test_pipeline.py +184 -0
  100. fastsft-0.1.0/tests/test_validation_checks.py +172 -0
  101. fastsft-0.1.0/tests/training/test_constants.py +97 -0
  102. fastsft-0.1.0/tests/training/test_heuristic.py +125 -0
  103. fastsft-0.1.0/tests/training/test_stats.py +219 -0
  104. fastsft-0.1.0/training_tutorial.md +239 -0
  105. fastsft-0.1.0/uv.lock +3215 -0
@@ -0,0 +1 @@
1
+ OPENROUTER_API_KEY=sk-or-your-key-here
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,4 @@
1
+ # Every file requires a review from @AniDas10 before it can merge into main
2
+ # (paired with "Require review from Code Owners" + a push restriction to
3
+ # AniDas10 in the main branch protection rule).
4
+ * @AniDas10
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ updates:
3
+ # Project dependencies, pinned via uv.lock.
4
+ - package-ecosystem: "uv"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+
9
+ # The workflow actions themselves (actions/checkout, astral-sh/setup-uv, ...).
10
+ - package-ecosystem: "github-actions"
11
+ directory: "/"
12
+ schedule:
13
+ interval: "weekly"
@@ -0,0 +1,20 @@
1
+ name: Build
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ # Builds the sdist + wheel (dynamic version resolved from
15
+ # src/fastsft/__init__.py via hatchling) -- catches packaging
16
+ # regressions before the actual PyPI publish, which this does NOT do.
17
+ - run: uv build
18
+ # Validates package metadata (README rendering, classifiers, etc.)
19
+ # without uploading anywhere.
20
+ - run: uvx twine check dist/*
@@ -0,0 +1,33 @@
1
+ name: CodeQL
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ schedule:
9
+ # Weekly scan catches newly-disclosed vulnerability patterns even when
10
+ # nothing in the repo changed.
11
+ - cron: "0 6 * * 1"
12
+
13
+ jobs:
14
+ analyze:
15
+ name: Analyze (python)
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ security-events: write
19
+ packages: read
20
+ actions: read
21
+ contents: read
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - uses: github/codeql-action/init@v3
27
+ with:
28
+ languages: python
29
+ build-mode: none
30
+
31
+ - uses: github/codeql-action/analyze@v3
32
+ with:
33
+ category: "/language:python"
@@ -0,0 +1,16 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ ruff:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ # --only-group dev installs just ruff (pinned in pyproject.toml), not the
15
+ # project's ML dependencies -- keeps the lint job fast and self-contained.
16
+ - run: uv run --only-group dev ruff check .
@@ -0,0 +1,25 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - uses: astral-sh/setup-uv@v3
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - run: uv build
22
+
23
+ - uses: pypa/gh-action-pypi-publish@release/v1
24
+ with:
25
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,17 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ pytest:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ # Bare `uv run` syncs the default groups (incl. dev -> pytest) plus the
15
+ # project itself -- tests import fastsft directly. Live tests (real
16
+ # OpenRouter calls / local training) stay skipped -- no --run-live here.
17
+ - run: uv run pytest -v --tb=short
@@ -0,0 +1,17 @@
1
+ name: Type Check
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ mypy:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ # --only-group dev installs just mypy, mirroring lint.yml. [tool.mypy]'s
15
+ # ignore_missing_imports=true means the local-training/evaluation ML
16
+ # extras aren't needed to type-check.
17
+ - run: uv run --only-group dev mypy
@@ -0,0 +1,13 @@
1
+ .env
2
+ .venv/
3
+ __pycache__/
4
+ *.pyc
5
+ datasets/
6
+ modelsets/
7
+ evalsets/
8
+
9
+ # Coverage
10
+ .coverage
11
+ .coverage.*
12
+ htmlcov/
13
+ coverage.xml
@@ -0,0 +1 @@
1
+ 3.12
fastsft-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aniruddha Das
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.