@ruvector/ruvllm 3.0.0 → 4.0.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 (151) hide show
  1. package/GPU-LOOP.md +229 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +9 -0
  4. package/README.md +157 -362
  5. package/examples/gpu-loop.example.json +26 -0
  6. package/package.json +50 -121
  7. package/src/adapters-cli.mjs +23 -0
  8. package/src/adapters.mjs +91 -0
  9. package/src/cli.mjs +30 -0
  10. package/src/engine.mjs +238 -0
  11. package/src/fixture.mjs +38 -0
  12. package/src/gpu-host.mjs +47 -0
  13. package/src/gpu-loop-cli.mjs +67 -0
  14. package/src/gpu-loop.mjs +184 -0
  15. package/src/gpu-spool-adapter.mjs +80 -0
  16. package/src/vast-host-adapter.mjs +274 -0
  17. package/bin/cli.js +0 -1040
  18. package/dist/cjs/benchmarks/embedding-benchmark.d.ts +0 -102
  19. package/dist/cjs/benchmarks/embedding-benchmark.d.ts.map +0 -1
  20. package/dist/cjs/benchmarks/embedding-benchmark.js +0 -436
  21. package/dist/cjs/benchmarks/index.d.ts +0 -34
  22. package/dist/cjs/benchmarks/index.d.ts.map +0 -1
  23. package/dist/cjs/benchmarks/index.js +0 -132
  24. package/dist/cjs/benchmarks/model-comparison.d.ts +0 -71
  25. package/dist/cjs/benchmarks/model-comparison.d.ts.map +0 -1
  26. package/dist/cjs/benchmarks/model-comparison.js +0 -476
  27. package/dist/cjs/benchmarks/routing-benchmark.d.ts +0 -70
  28. package/dist/cjs/benchmarks/routing-benchmark.d.ts.map +0 -1
  29. package/dist/cjs/benchmarks/routing-benchmark.js +0 -289
  30. package/dist/cjs/contrastive.d.ts +0 -229
  31. package/dist/cjs/contrastive.d.ts.map +0 -1
  32. package/dist/cjs/contrastive.js +0 -589
  33. package/dist/cjs/engine.d.ts +0 -160
  34. package/dist/cjs/engine.d.ts.map +0 -1
  35. package/dist/cjs/engine.js +0 -552
  36. package/dist/cjs/export.d.ts +0 -182
  37. package/dist/cjs/export.d.ts.map +0 -1
  38. package/dist/cjs/export.js +0 -422
  39. package/dist/cjs/federated.d.ts +0 -233
  40. package/dist/cjs/federated.d.ts.map +0 -1
  41. package/dist/cjs/federated.js +0 -525
  42. package/dist/cjs/index.d.ts +0 -68
  43. package/dist/cjs/index.d.ts.map +0 -1
  44. package/dist/cjs/index.js +0 -104
  45. package/dist/cjs/intelligence.d.ts +0 -136
  46. package/dist/cjs/intelligence.d.ts.map +0 -1
  47. package/dist/cjs/intelligence.js +0 -226
  48. package/dist/cjs/lora.d.ts +0 -251
  49. package/dist/cjs/lora.d.ts.map +0 -1
  50. package/dist/cjs/lora.js +0 -509
  51. package/dist/cjs/models.d.ts +0 -129
  52. package/dist/cjs/models.d.ts.map +0 -1
  53. package/dist/cjs/models.js +0 -323
  54. package/dist/cjs/native.d.ts +0 -140
  55. package/dist/cjs/native.d.ts.map +0 -1
  56. package/dist/cjs/native.js +0 -98
  57. package/dist/cjs/session.d.ts +0 -80
  58. package/dist/cjs/session.d.ts.map +0 -1
  59. package/dist/cjs/session.js +0 -203
  60. package/dist/cjs/simd.d.ts +0 -90
  61. package/dist/cjs/simd.d.ts.map +0 -1
  62. package/dist/cjs/simd.js +0 -209
  63. package/dist/cjs/sona.d.ts +0 -223
  64. package/dist/cjs/sona.d.ts.map +0 -1
  65. package/dist/cjs/sona.js +0 -562
  66. package/dist/cjs/streaming.d.ts +0 -55
  67. package/dist/cjs/streaming.d.ts.map +0 -1
  68. package/dist/cjs/streaming.js +0 -131
  69. package/dist/cjs/training.d.ts +0 -312
  70. package/dist/cjs/training.d.ts.map +0 -1
  71. package/dist/cjs/training.js +0 -610
  72. package/dist/cjs/types.d.ts +0 -696
  73. package/dist/cjs/types.d.ts.map +0 -1
  74. package/dist/cjs/types.js +0 -6
  75. package/dist/esm/benchmarks/embedding-benchmark.d.ts +0 -102
  76. package/dist/esm/benchmarks/embedding-benchmark.d.ts.map +0 -1
  77. package/dist/esm/benchmarks/embedding-benchmark.js +0 -427
  78. package/dist/esm/benchmarks/index.d.ts +0 -34
  79. package/dist/esm/benchmarks/index.d.ts.map +0 -1
  80. package/dist/esm/benchmarks/index.js +0 -110
  81. package/dist/esm/benchmarks/model-comparison.d.ts +0 -71
  82. package/dist/esm/benchmarks/model-comparison.d.ts.map +0 -1
  83. package/dist/esm/benchmarks/model-comparison.js +0 -434
  84. package/dist/esm/benchmarks/routing-benchmark.d.ts +0 -70
  85. package/dist/esm/benchmarks/routing-benchmark.d.ts.map +0 -1
  86. package/dist/esm/benchmarks/routing-benchmark.js +0 -283
  87. package/dist/esm/contrastive.d.ts +0 -229
  88. package/dist/esm/contrastive.d.ts.map +0 -1
  89. package/dist/esm/contrastive.js +0 -578
  90. package/dist/esm/engine.d.ts +0 -160
  91. package/dist/esm/engine.d.ts.map +0 -1
  92. package/dist/esm/engine.js +0 -548
  93. package/dist/esm/export.d.ts +0 -182
  94. package/dist/esm/export.d.ts.map +0 -1
  95. package/dist/esm/export.js +0 -414
  96. package/dist/esm/federated.d.ts +0 -233
  97. package/dist/esm/federated.d.ts.map +0 -1
  98. package/dist/esm/federated.js +0 -520
  99. package/dist/esm/index.d.ts +0 -68
  100. package/dist/esm/index.d.ts.map +0 -1
  101. package/dist/esm/index.js +0 -84
  102. package/dist/esm/intelligence.d.ts +0 -136
  103. package/dist/esm/intelligence.d.ts.map +0 -1
  104. package/dist/esm/intelligence.js +0 -188
  105. package/dist/esm/lora.d.ts +0 -251
  106. package/dist/esm/lora.d.ts.map +0 -1
  107. package/dist/esm/lora.js +0 -504
  108. package/dist/esm/models.d.ts +0 -129
  109. package/dist/esm/models.d.ts.map +0 -1
  110. package/dist/esm/models.js +0 -282
  111. package/dist/esm/native.d.ts +0 -140
  112. package/dist/esm/native.d.ts.map +0 -1
  113. package/dist/esm/native.js +0 -93
  114. package/dist/esm/session.d.ts +0 -80
  115. package/dist/esm/session.d.ts.map +0 -1
  116. package/dist/esm/session.js +0 -199
  117. package/dist/esm/simd.d.ts +0 -90
  118. package/dist/esm/simd.d.ts.map +0 -1
  119. package/dist/esm/simd.js +0 -205
  120. package/dist/esm/sona.d.ts +0 -223
  121. package/dist/esm/sona.d.ts.map +0 -1
  122. package/dist/esm/sona.js +0 -556
  123. package/dist/esm/streaming.d.ts +0 -55
  124. package/dist/esm/streaming.d.ts.map +0 -1
  125. package/dist/esm/streaming.js +0 -126
  126. package/dist/esm/training.d.ts +0 -312
  127. package/dist/esm/training.d.ts.map +0 -1
  128. package/dist/esm/training.js +0 -603
  129. package/dist/esm/types.d.ts +0 -696
  130. package/dist/esm/types.d.ts.map +0 -1
  131. package/dist/esm/types.js +0 -5
  132. package/scripts/ensemble-model-compare.js +0 -287
  133. package/scripts/fix-esm-extensions.mjs +0 -181
  134. package/scripts/huggingface/README.md +0 -537
  135. package/scripts/huggingface/publish.sh +0 -112
  136. package/scripts/hybrid-model-compare.js +0 -373
  137. package/scripts/improved-model-compare.js +0 -288
  138. package/scripts/optimized-model-compare.js +0 -364
  139. package/scripts/real-model-compare.js +0 -280
  140. package/scripts/smoke-esm.mjs +0 -82
  141. package/scripts/training/agentic-flow-capabilities.json +0 -329
  142. package/scripts/training/claude-code-synth.js +0 -505
  143. package/scripts/training/claude-flow-capabilities.json +0 -1322
  144. package/scripts/training/claude-hard-negatives.js +0 -222
  145. package/scripts/training/contrastive-finetune.js +0 -517
  146. package/scripts/training/ecosystem-triplets.jsonl +0 -1467
  147. package/scripts/training/generate-ecosystem-triplets.js +0 -1324
  148. package/scripts/training/routing-dataset.js +0 -634
  149. package/scripts/training/ruvector-capabilities.json +0 -798
  150. package/scripts/training/validate-ecosystem.js +0 -381
  151. package/scripts/training/validation-results.json +0 -23
package/GPU-LOOP.md ADDED
@@ -0,0 +1,229 @@
1
+ # Scheduled GPU job loop
2
+
3
+ Run a durable GPU job queue from the CLI, Claude Code or a Ruflo MCP host.
4
+ The scheduler can be developed and contract-tested without live ruOS/Vast.ai
5
+ access. A host adapter owns real provider calls and uses its existing ruOS
6
+ authentication to resolve **secret references**, never export credential values.
7
+
8
+ This release implements the schedule, durable state, reservations, host loader,
9
+ file handoff and MCP tools. It does not include a live ruOS connector, invent a
10
+ secrets-service endpoint, or claim provider E2E validation. No GPU rental or model
11
+ download is started by installing the package. A zero-budget sample is disarmed.
12
+
13
+ ## Operator configuration
14
+
15
+ Install the existing [integration](README.md), then prepare a private directory
16
+ and copy [gpu-loop.example.json](examples/gpu-loop.example.json) outside your
17
+ output directories. Keep the config owner-only (`chmod 600`); create its
18
+ `stateRoot` with mode 700. Use canonical absolute paths without symlinks.
19
+
20
+ Edit the example's paths, model pin, resource ID and `secretRef`. The example
21
+ secret alias and instance ID are placeholders, not discovered ruOS resources.
22
+ Keep `budgetUsd: 0` until a spending ceiling is explicitly chosen. Merely reading
23
+ status does not submit work. A zero-budget tick records a budget-limit failure
24
+ and never calls the provider. Use a new state directory for a new reviewed
25
+ configuration; state binds the config's exact byte digest.
26
+
27
+ Configuration fields:
28
+
29
+ | Field | Meaning |
30
+ | --- | --- |
31
+ | `intervalSeconds` | Polling cadence, 1–86400 seconds; active deadlines and pending cleanup can become due sooner |
32
+ | `maxAttempts` | Maximum attempts per job, 1–10; retries require confirmed cleanup |
33
+ | `budgetUsd` | Total conservative admission budget in exact microdollars; zero disarms submissions |
34
+ | `jobs` | 1–128 fixed operator-approved jobs |
35
+ | `model` | Exact `repo` and 40-character model revision |
36
+ | `task` | `evaluate` or `train`; the host must implement that workload |
37
+ | `secretRef` | Opaque alias resolved only by the authenticated host |
38
+ | `resource` | Exactly one string `instanceId` or `offerId`; no automatic offer selection |
39
+ | `maxCostUsd` | Reserved cost ceiling for each attempt; never refunded automatically |
40
+ | `timeoutSeconds` | Per-attempt deadline, 1–86400 seconds |
41
+ | `experiment` | Optional absolute `configPath`/`planPath` for the host to execute using the native experiment workflow |
42
+
43
+ The schedule advances a finite queue. It does not reset succeeded jobs or start
44
+ unlimited training cycles. Another experiment cycle needs a new reviewed config
45
+ and state root. Reservations limit admitted work; they cannot impose a hard cap
46
+ on Vast billing. The host must separately enforce actual spend and worker runtime.
47
+
48
+ ## Host adapter
49
+
50
+ The host module must be a canonical, owner-only `.mjs` file pinned by SHA256.
51
+ Its entire transitive dependency tree is trusted operator code. No provider effects
52
+ or secret logging may occur at import: all effects belong in the methods below.
53
+ This interface is supplied by RuVLLM; these names are not claimed ruOS API methods.
54
+
55
+ ```js
56
+ export async function submit({ job, idempotencyKey, signal }) {
57
+ // Resolve job.secretRef at the authenticated host. Submit OR find the exact
58
+ // existing job by idempotencyKey. Enforce timeout/cost before starting work.
59
+ // Return only a bounded provider run identifier, never credential material.
60
+ return { runId };
61
+ }
62
+ export async function inspect({ job, runId, idempotencyKey, signal }) {
63
+ // Read the real executor's structured evidence. Do not trust worker stdout.
64
+ return { status: 'running' }; // Or failed/completed with costUsd and completion.
65
+ }
66
+ export async function cleanup({ job, runId, signal }) {
67
+ // Stop/release only this job's allocation. Do not destroy a shared instance.
68
+ // Confirm absence/release through the provider before returning true.
69
+ return { released: false };
70
+ }
71
+ ```
72
+
73
+ The snippet is an interface illustration, not a runnable provider implementation.
74
+ Use the host's actual supported ruOS secrets and Vast execution routes. Honor
75
+ AbortSignal and implement idempotent submit/cleanup. A thrown/late/ambiguous submit
76
+ blocks automatic resubmission, since a provider may already have allocated a GPU.
77
+
78
+ A completed result needs this structured contract, derived by the trusted host:
79
+
80
+ ```json
81
+ {
82
+ "status": "completed",
83
+ "costUsd": 0.25,
84
+ "completion": {
85
+ "completionVersion": 1,
86
+ "completionVerified": true,
87
+ "status": "ok",
88
+ "exitCode": 0,
89
+ "assertionsVerified": true,
90
+ "evidenceComplete": true,
91
+ "truncated": false,
92
+ "jobId": "EXACT_JOB_ID",
93
+ "modelRepo": "Qwen/Qwen3.5-4B",
94
+ "modelRevision": "851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a",
95
+ "runId": "EXACT_CURRENT_RUN_ID",
96
+ "idempotencyKey": "EXACT_CURRENT_ATTEMPT_KEY"
97
+ }
98
+ }
99
+ ```
100
+
101
+ Boolean flags are structural checks, not cryptographic attestation. Bind evidence
102
+ to the actual run and retain raw measurements at the host. An old attempt's reply,
103
+ wrong model, missing assertions or unverified completion cannot mark a job
104
+ successful. Terminal success also requires explicit resource-release confirmation.
105
+
106
+ ## Concrete file handoff
107
+
108
+ For a ruOS-side scheduled consumer, use the bundled
109
+ `src/gpu-spool-adapter.mjs`. Set `RUVLLM_GPU_SPOOL_ROOT` to an existing private
110
+ canonical directory. This adapter performs **no provider calls**; it hands work
111
+ to a host sharing that directory, or a securely synchronized copy of the files.
112
+ Transfer and remote authentication are separate host responsibilities.
113
+
114
+ For each persisted attempt key, files are:
115
+
116
+ | File | Writer and schema |
117
+ | --- | --- |
118
+ | `KEY.request.json` | Scheduler: `ruvllm-gpu-spool-request/v1`, `runId`, `job`, credential-handling notice |
119
+ | `KEY.status.json` | Host: `ruvllm-gpu-spool-status/v1`, matching `runId`, status, optional cost/completion |
120
+ | `KEY.cleanup-request.json` | Scheduler: `ruvllm-gpu-spool-cleanup-request/v1`, `runId`, `jobId` |
121
+ | `KEY.cleanup.json` | Host: `ruvllm-gpu-spool-cleanup/v1`, matching `runId`, boolean `released` |
122
+
123
+ All files must be owner-only, regular, nonsymlink files of at most 64 KiB. The
124
+ host should publish replies atomically. Repeated identical requests are idempotent;
125
+ conflicting contents under the same key are rejected. No status reply means
126
+ pending/running, not success. Missing cleanup acknowledgement keeps cleanup
127
+ pending. The request's `secretRef` is an alias; no credential belongs in any file.
128
+
129
+ Example local bindings (operator paths, not secrets):
130
+
131
+ ```sh
132
+ export RUVLLM_GPU_LOOP_CONFIG=/absolute/private/gpu-loop.json
133
+ export RUVLLM_GPU_SPOOL_ROOT=/absolute/private/gpu-spool
134
+ export RUVLLM_GPU_HOST_MODULE="$PWD/integrations/metaharness/src/gpu-spool-adapter.mjs"
135
+ chmod 600 "$RUVLLM_GPU_HOST_MODULE"
136
+ export RUVLLM_GPU_HOST_SHA256="$(shasum -a 256 "$RUVLLM_GPU_HOST_MODULE" | awk '{print $1}')"
137
+ ```
138
+
139
+ Prepare the private spool/state directories and config before ticking. The
140
+ source module's chmod is needed after a normal Git checkout because host modules
141
+ are deliberately required to be owner-only. A custom trusted module can replace
142
+ the spool adapter; recalculate and review its pin after any code change.
143
+
144
+ ## Vast.ai host adapter
145
+
146
+ `src/vast-host-adapter.mjs` is a real provider adapter (see
147
+ [ADR 017](../../docs/adr/ADR-017-vast-host-adapter-and-live-paired-run.md)). Set
148
+ `RUVLLM_VAST_HOST_CONFIG` to an owner-only `ruvllm-vast-host/v1` file:
149
+
150
+ | Field | Meaning |
151
+ | --- | --- |
152
+ | `apiBase` | `https://console.vast.ai` |
153
+ | `secrets` | `{ "<secretRef>": { "file": "/abs/owner-only/key" } }`; the key is sent only as a Bearer header |
154
+ | `image` | Container image pinned by digest |
155
+ | `repoUrl`, `commit`, `bundle` | Public checkout and exact commit the rental runs; frozen bundle name |
156
+ | `diskGb`, `armDeadlineSeconds` | Rental disk; per-arm worker deadline |
157
+ | `guardGraceSeconds` | Extra time after `timeoutSeconds` before the independent destroy timer fires |
158
+ | `resultsRoot`, `sshKey`, `repoRoot`, `python`, `node` | Absolute local paths for receipts, retrieval and local re-scoring |
159
+
160
+ Jobs must use `resource.offerId`. Submit refuses the offer when its hourly price
161
+ times `timeoutSeconds` exceeds `maxCostUsd`, labels the rental with the attempt's
162
+ idempotency key, and arms a `systemd-run --user` destroy timer. Inspect reports
163
+ accrued cost, pulls raw outputs when the remote run is done, and re-scores them
164
+ locally; only an identical report counts as verified completion. Cleanup returns
165
+ `released: true` only after the instance is absent from the account listing.
166
+ Receipts (`submission.json`, `progress.json`, `verification.json`,
167
+ `cleanup-ID.json`, `guard-ID.json`) contain no credential. Copy the module to a
168
+ private owner-only path and pin that copy's SHA256, as for any host module.
169
+
170
+ ## CLI and loop schedule
171
+
172
+ ```sh
173
+ node integrations/metaharness/src/gpu-loop-cli.mjs status --config "$RUVLLM_GPU_LOOP_CONFIG"
174
+ node integrations/metaharness/src/gpu-loop-cli.mjs tick \
175
+ --config "$RUVLLM_GPU_LOOP_CONFIG" \
176
+ --adapter "$RUVLLM_GPU_HOST_MODULE" --adapter-sha256 "$RUVLLM_GPU_HOST_SHA256"
177
+ node integrations/metaharness/src/gpu-loop-cli.mjs run \
178
+ --config "$RUVLLM_GPU_LOOP_CONFIG" \
179
+ --adapter "$RUVLLM_GPU_HOST_MODULE" --adapter-sha256 "$RUVLLM_GPU_HOST_SHA256" \
180
+ --max-ticks 60
181
+ ```
182
+
183
+ `run` defaults to one tick, caps the count at 10000, and waits until the next due
184
+ poll/deadline/cleanup step. SIGINT/SIGTERM stops between ticks; it does not erase
185
+ running work. State survives restarts. Alternatively, have the operator's existing
186
+ scheduler invoke `tick`; overlapping processes refuse the exclusive lock. A coarse
187
+ external interval can delay cleanup, so the host must always enforce its own
188
+ deadline. No cron entry or background process is installed automatically.
189
+
190
+ ## Claude Code and Ruflo
191
+
192
+ Load [ruflo-metaharness](../../plugins/ruflo-metaharness/README.md) with the four
193
+ bindings above in its process environment. `gpu_loop_status` and `gpu_loop_tick`
194
+ take `{}` only. Configuration, host code and budget cannot come from tool args.
195
+ The `/ruflo-metaharness:gpu-loop` command checks status and advances a tick within
196
+ the operator's configured scope. Ruflo can use the same MCP server and bindings.
197
+
198
+ If the Claude host supports recurring `/loop`, it can repeatedly invoke this command:
199
+
200
+ ```text
201
+ /loop 1m /ruflo-metaharness:gpu-loop
202
+ ```
203
+
204
+ That host-specific facility was not E2E-tested here. The durable scheduler still
205
+ enforces its own due time, budget, lock and submission state across host restarts.
206
+ Existing native experiment tools remain separate; no schedule grants activation.
207
+
208
+ ## Reconciliation and validation
209
+
210
+ `blocked` means the submit outcome is uncertain. `cleanup` means resource release
211
+ has not yet been confirmed. Do not delete state or launch a replacement rental
212
+ to make either status disappear. Use the saved key/run ID to inspect the actual
213
+ host/provider, reconcile its resources, and only then repair state or prepare a
214
+ new reviewed cycle. A crash may leave `tick.lock`; it is never auto-broken.
215
+
216
+ Run the local scheduler/host/spool tests and all plugin wire tests through the
217
+ existing `npm test`/Node commands. Test adapters and host files are explicitly
218
+ mock contracts; no secrets, provider, model inference or GPU E2E is exercised.
219
+ The [ADR](../../docs/adr/ADR-015-scheduled-gpu-loop-and-host-secret-boundary.md)
220
+ records the state machine, failure paths and threat boundary.
221
+
222
+ Validation on 2026-11-03: **60 local tests passed**, with no failures or skips:
223
+ 17 scheduler tests, 8 host/CLI tests, 3 spool tests (including the scheduled
224
+ handoff), 3 new GPU MCP wire tests, and the original 29 integration/plugin tests.
225
+ The long-interval deadline test uses a 60-second cadence and a one-second job
226
+ deadline and confirms cleanup becomes due without waiting the full cadence.
227
+ Repository integrity and unchanged native-source provenance checks also passed.
228
+ Live ruOS/Vast.ai, actual Claude `/loop`, secrets resolution and GPU inference/
229
+ training remain deliberately unrun. Existing CI test globs include these tests.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Alibaba Cloud
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,9 @@
1
+ RuFlo Code Model
2
+ Copyright 2026 rUv and contributors
3
+
4
+ Original experiment code and synthetic tool traces are licensed under Apache 2.0.
5
+ Base model: Qwen/Qwen3.5-4B, Apache 2.0, owned by the Qwen team.
6
+ HumanEval data in data/external is MIT licensed; see HumanEval.LICENSE.
7
+ MLX LM, Transformers, PEFT, and Claude Code Router retain their respective licenses.
8
+ Claude Code is a separate proprietary client. No Claude model weights or private
9
+ Claude training data are included. This project is not endorsed by Anthropic.