@tuned-tensor/local 0.2.9 → 0.4.0

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 (89) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +110 -201
  3. package/dist/active-model.d.ts +16 -0
  4. package/dist/active-model.js +88 -0
  5. package/dist/active-model.js.map +1 -0
  6. package/dist/artifacts.d.ts +5 -4
  7. package/dist/artifacts.js +57 -33
  8. package/dist/artifacts.js.map +1 -1
  9. package/dist/compare.d.ts +1 -8
  10. package/dist/compare.js +1 -23
  11. package/dist/compare.js.map +1 -1
  12. package/dist/contracts.d.ts +234 -365
  13. package/dist/contracts.js +95 -224
  14. package/dist/contracts.js.map +1 -1
  15. package/dist/dataset.d.ts +11 -4
  16. package/dist/dataset.js +67 -125
  17. package/dist/dataset.js.map +1 -1
  18. package/dist/doctor.d.ts +2 -3
  19. package/dist/doctor.js +23 -161
  20. package/dist/doctor.js.map +1 -1
  21. package/dist/evaluation.d.ts +11 -71
  22. package/dist/evaluation.js +212 -572
  23. package/dist/evaluation.js.map +1 -1
  24. package/dist/general-regression.d.ts +10 -0
  25. package/dist/general-regression.js +16 -0
  26. package/dist/general-regression.js.map +1 -0
  27. package/dist/huggingface-cache.d.ts +8 -7
  28. package/dist/huggingface-cache.js +16 -8
  29. package/dist/huggingface-cache.js.map +1 -1
  30. package/dist/index.d.ts +2 -10
  31. package/dist/index.js +358 -627
  32. package/dist/index.js.map +1 -1
  33. package/dist/local-project.d.ts +1 -11
  34. package/dist/local-project.js +33 -61
  35. package/dist/local-project.js.map +1 -1
  36. package/dist/model-registry.d.ts +3 -16
  37. package/dist/model-registry.js +76 -292
  38. package/dist/model-registry.js.map +1 -1
  39. package/dist/model-server.d.ts +7 -3
  40. package/dist/model-server.js +34 -25
  41. package/dist/model-server.js.map +1 -1
  42. package/dist/orchestrator.d.ts +11 -25
  43. package/dist/orchestrator.js +393 -563
  44. package/dist/orchestrator.js.map +1 -1
  45. package/dist/prefetch.d.ts +1 -5
  46. package/dist/prefetch.js +14 -19
  47. package/dist/prefetch.js.map +1 -1
  48. package/dist/process-runner.d.ts +10 -29
  49. package/dist/process-runner.js +63 -169
  50. package/dist/process-runner.js.map +1 -1
  51. package/dist/process-training.d.ts +0 -1
  52. package/dist/process-training.js +10 -87
  53. package/dist/process-training.js.map +1 -1
  54. package/dist/store.d.ts +1 -3
  55. package/dist/store.js +92 -290
  56. package/dist/store.js.map +1 -1
  57. package/docs/architecture.md +87 -152
  58. package/docs/spark.md +66 -97
  59. package/examples/dry-runner.json +14 -0
  60. package/examples/general-regression.jsonl +4 -0
  61. package/examples/local-runner.json +13 -6
  62. package/examples/smoke-spec.json +41 -0
  63. package/package.json +6 -6
  64. package/training/local-runner/pyproject.toml +0 -5
  65. package/training/local-runner/src/evaluate.py +89 -234
  66. package/training/local-runner/src/model_contract.py +47 -0
  67. package/training/local-runner/src/prefetch.py +18 -4
  68. package/training/local-runner/src/serve.py +60 -117
  69. package/training/local-runner/src/sft_data.py +97 -0
  70. package/training/local-runner/src/train.py +146 -346
  71. package/training/local-runner/uv.lock +0 -1197
  72. package/dist/labeling-sanitize.d.ts +0 -31
  73. package/dist/labeling-sanitize.js +0 -158
  74. package/dist/labeling-sanitize.js.map +0 -1
  75. package/dist/labeling.d.ts +0 -155
  76. package/dist/labeling.js +0 -496
  77. package/dist/labeling.js.map +0 -1
  78. package/dist/openrouter.d.ts +0 -29
  79. package/dist/openrouter.js +0 -66
  80. package/dist/openrouter.js.map +0 -1
  81. package/dist/server.d.ts +0 -9
  82. package/dist/server.js +0 -211
  83. package/dist/server.js.map +0 -1
  84. package/docs/local-workflow-remediation-2026-07-13.md +0 -130
  85. package/docs/local-workflow-ux-review-2026-07-13.md +0 -458
  86. package/examples/dpo-preferences.jsonl +0 -2
  87. package/examples/dpo-run-request.json +0 -34
  88. package/examples/smoke-run-request.json +0 -34
  89. package/training/local-runner/src/train_dpo.py +0 -286
@@ -1,41 +1,27 @@
1
1
  import { type FineTuneRunRequest, type LocalRunnerConfig, type RunReport } from "./contracts.js";
2
2
  import type { LocalRunReporter } from "./run-reporter.js";
3
- export type LocalRunStage = "prepare" | "baseline" | "train" | "candidate" | "score" | "report" | "all";
4
3
  export interface LocalRunResult {
5
4
  request: FineTuneRunRequest;
6
5
  report: RunReport;
7
6
  reportPath: string;
8
7
  artifactDir: string;
9
8
  }
10
- export interface LocalStageRunResult {
11
- request: FineTuneRunRequest;
12
- stage: LocalRunStage;
13
- report?: RunReport;
14
- reportPath?: string;
15
- artifactDir: string;
16
- artifacts: {
17
- training_jsonl: string;
18
- stage_metadata: string;
19
- training_report: string;
20
- baseline_eval: string;
21
- candidate_eval: string;
22
- report: string;
23
- artifact_manifest: string;
24
- };
25
- }
26
9
  export declare function loadJsonFile<T>(path: string): Promise<T>;
27
10
  export declare function loadRunRequest(path: string): Promise<FineTuneRunRequest>;
28
11
  export declare function loadLocalRunnerConfig(path?: string): Promise<LocalRunnerConfig>;
29
- /** Hash a local base model while permitting Hugging Face snapshot file links. */
30
- export declare function fingerprintLocalBaseModel(uri: string): Promise<string>;
31
- export declare function runLocalFineTuneStage(input: {
12
+ /**
13
+ * Parses the public contracts and fully validates every dataset before a run
14
+ * lock, store record, or artifact-directory claim is created.
15
+ */
16
+ export declare function validateLocalFineTuneInput(input: {
17
+ request: unknown;
18
+ config: unknown;
19
+ }): Promise<{
32
20
  request: FineTuneRunRequest;
33
21
  config: LocalRunnerConfig;
34
- reporter?: LocalRunReporter;
35
- stage?: LocalRunStage;
36
- force?: boolean;
37
- modelArtifact?: string;
38
- }): Promise<LocalStageRunResult>;
22
+ }>;
23
+ /** Hash a local base model while permitting Hugging Face snapshot file links. */
24
+ export declare function fingerprintLocalBaseModel(uri: string): Promise<string>;
39
25
  export declare function runLocalFineTune(input: {
40
26
  request: FineTuneRunRequest;
41
27
  config: LocalRunnerConfig;