adaptive-local 0.5.0a1__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 (162) hide show
  1. adaptive_local-0.5.0a1/.github/ISSUE_TEMPLATE/benchmark_report.yml +23 -0
  2. adaptive_local-0.5.0a1/.github/ISSUE_TEMPLATE/bug_report.yml +37 -0
  3. adaptive_local-0.5.0a1/.github/ISSUE_TEMPLATE/feature_request.yml +22 -0
  4. adaptive_local-0.5.0a1/.github/ISSUE_TEMPLATE/hardware_compatibility.yml +28 -0
  5. adaptive_local-0.5.0a1/.github/PULL_REQUEST_TEMPLATE.md +14 -0
  6. adaptive_local-0.5.0a1/.github/workflows/ci.yml +32 -0
  7. adaptive_local-0.5.0a1/.gitignore +27 -0
  8. adaptive_local-0.5.0a1/AGENTS.md +15 -0
  9. adaptive_local-0.5.0a1/ARCHITECTURE.md +101 -0
  10. adaptive_local-0.5.0a1/AUDIT.md +81 -0
  11. adaptive_local-0.5.0a1/AUTOTUNE_PROTOCOL.md +52 -0
  12. adaptive_local-0.5.0a1/BACKLOG.md +59 -0
  13. adaptive_local-0.5.0a1/BENCHMARK_PROTOCOL.md +41 -0
  14. adaptive_local-0.5.0a1/CAPABILITY_REGISTRY.md +29 -0
  15. adaptive_local-0.5.0a1/CHANGELOG.md +10 -0
  16. adaptive_local-0.5.0a1/CITATION.cff +9 -0
  17. adaptive_local-0.5.0a1/CODE_OF_CONDUCT.md +24 -0
  18. adaptive_local-0.5.0a1/CONTRIBUTING.md +45 -0
  19. adaptive_local-0.5.0a1/DECISIONS.md +134 -0
  20. adaptive_local-0.5.0a1/HARDWARE_BENCHMARK_PROTOCOL.md +39 -0
  21. adaptive_local-0.5.0a1/HARDWARE_SPEC.md +54 -0
  22. adaptive_local-0.5.0a1/LICENSE +202 -0
  23. adaptive_local-0.5.0a1/MASTER_ROADMAP.md +1446 -0
  24. adaptive_local-0.5.0a1/MIGRATION.md +40 -0
  25. adaptive_local-0.5.0a1/OPTIMIZER_SPEC.md +19 -0
  26. adaptive_local-0.5.0a1/PKG-INFO +218 -0
  27. adaptive_local-0.5.0a1/PROFILE_SCHEMA.md +28 -0
  28. adaptive_local-0.5.0a1/PROGRESS.md +53 -0
  29. adaptive_local-0.5.0a1/PUBLICATION_AUDIT.md +51 -0
  30. adaptive_local-0.5.0a1/README.md +193 -0
  31. adaptive_local-0.5.0a1/RELEASE_CHECKLIST.md +39 -0
  32. adaptive_local-0.5.0a1/RELEASE_NOTES_0.3.md +24 -0
  33. adaptive_local-0.5.0a1/RUNTIME_ARTIFACT_SPEC.md +25 -0
  34. adaptive_local-0.5.0a1/RUNTIME_INSTALLATION.md +37 -0
  35. adaptive_local-0.5.0a1/RUNTIME_SPEC.md +45 -0
  36. adaptive_local-0.5.0a1/SEARCH_SPACE.md +23 -0
  37. adaptive_local-0.5.0a1/SECURITY.md +43 -0
  38. adaptive_local-0.5.0a1/THIRD_PARTY_NOTICES.md +38 -0
  39. adaptive_local-0.5.0a1/adaptive.example.toml +8 -0
  40. adaptive_local-0.5.0a1/data/local_model_registry.json +29 -0
  41. adaptive_local-0.5.0a1/docs/.gitkeep +0 -0
  42. adaptive_local-0.5.0a1/docs/HARDWARE_SCHEMA.md +19 -0
  43. adaptive_local-0.5.0a1/docs/MODEL_HUB_SPEC.md +38 -0
  44. adaptive_local-0.5.0a1/docs/PHASE_05E_HARDWARE_VALIDATION_CHECKLIST.md +8 -0
  45. adaptive_local-0.5.0a1/docs/RESOURCE_MANAGER_SPEC.md +113 -0
  46. adaptive_local-0.5.0a1/docs/ROADMAP_ADDENDUM.md +31 -0
  47. adaptive_local-0.5.0a1/docs/decisions/ADR-0019-phase5-experimental-validation-deferral.md +57 -0
  48. adaptive_local-0.5.0a1/docs/examples/hardware_profile.example.json +77 -0
  49. adaptive_local-0.5.0a1/docs/examples/resource_snapshot.example.json +16 -0
  50. adaptive_local-0.5.0a1/pyproject.toml +55 -0
  51. adaptive_local-0.5.0a1/scripts/audit_phase4_quality.py +59 -0
  52. adaptive_local-0.5.0a1/scripts/run_phase4_closure_sanity.py +139 -0
  53. adaptive_local-0.5.0a1/scripts/run_phase4_experiments.py +216 -0
  54. adaptive_local-0.5.0a1/scripts/run_phase4_final_quality.py +147 -0
  55. adaptive_local-0.5.0a1/scripts/run_phase4_final_validation.py +206 -0
  56. adaptive_local-0.5.0a1/scripts/validate_phase3_failures.py +88 -0
  57. adaptive_local-0.5.0a1/scripts/validate_phase3_integrity.py +66 -0
  58. adaptive_local-0.5.0a1/scripts/validate_phase3_offline.py +62 -0
  59. adaptive_local-0.5.0a1/scripts/validate_phase3_runtime.py +95 -0
  60. adaptive_local-0.5.0a1/src/adaptive_local/__init__.py +3 -0
  61. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/__init__.py +4 -0
  62. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/comparison.py +87 -0
  63. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/quality.py +80 -0
  64. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/reporting.py +142 -0
  65. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/runner.py +396 -0
  66. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/sampling.py +130 -0
  67. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/schemas.py +235 -0
  68. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/sentinel.py +78 -0
  69. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/statistics.py +72 -0
  70. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/storage.py +69 -0
  71. adaptive_local-0.5.0a1/src/adaptive_local/benchmark/workloads.py +202 -0
  72. adaptive_local-0.5.0a1/src/adaptive_local/cli/__init__.py +3 -0
  73. adaptive_local-0.5.0a1/src/adaptive_local/cli/__main__.py +3 -0
  74. adaptive_local-0.5.0a1/src/adaptive_local/cli/main.py +1048 -0
  75. adaptive_local-0.5.0a1/src/adaptive_local/config/__init__.py +3 -0
  76. adaptive_local-0.5.0a1/src/adaptive_local/config/settings.py +60 -0
  77. adaptive_local-0.5.0a1/src/adaptive_local/core/__init__.py +1 -0
  78. adaptive_local-0.5.0a1/src/adaptive_local/diagnostics/__init__.py +3 -0
  79. adaptive_local-0.5.0a1/src/adaptive_local/diagnostics/doctor.py +79 -0
  80. adaptive_local-0.5.0a1/src/adaptive_local/errors.py +30 -0
  81. adaptive_local-0.5.0a1/src/adaptive_local/hardware/__init__.py +4 -0
  82. adaptive_local-0.5.0a1/src/adaptive_local/hardware/benchmarks.py +187 -0
  83. adaptive_local-0.5.0a1/src/adaptive_local/hardware/cache.py +71 -0
  84. adaptive_local-0.5.0a1/src/adaptive_local/hardware/capabilities.py +150 -0
  85. adaptive_local-0.5.0a1/src/adaptive_local/hardware/collectors.py +476 -0
  86. adaptive_local-0.5.0a1/src/adaptive_local/hardware/inspect.py +245 -0
  87. adaptive_local-0.5.0a1/src/adaptive_local/hardware/schemas.py +283 -0
  88. adaptive_local-0.5.0a1/src/adaptive_local/hub/__init__.py +19 -0
  89. adaptive_local-0.5.0a1/src/adaptive_local/hub/service.py +419 -0
  90. adaptive_local-0.5.0a1/src/adaptive_local/models/__init__.py +3 -0
  91. adaptive_local-0.5.0a1/src/adaptive_local/models/gguf.py +39 -0
  92. adaptive_local-0.5.0a1/src/adaptive_local/models/registry.py +111 -0
  93. adaptive_local-0.5.0a1/src/adaptive_local/optimization/__init__.py +1 -0
  94. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/__init__.py +4 -0
  95. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/budgets.py +20 -0
  96. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/cache.py +81 -0
  97. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/constraints.py +58 -0
  98. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/controller.py +191 -0
  99. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/evaluator.py +160 -0
  100. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/explanation.py +24 -0
  101. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/objective.py +73 -0
  102. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/pareto.py +29 -0
  103. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/schemas.py +184 -0
  104. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/search_space.py +97 -0
  105. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/strategies/__init__.py +6 -0
  106. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/strategies/heuristic.py +18 -0
  107. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/strategies/random_search.py +11 -0
  108. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/strategies/successive_halving.py +28 -0
  109. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/strategies/tpe.py +35 -0
  110. adaptive_local-0.5.0a1/src/adaptive_local/optimization/autotune/validation.py +63 -0
  111. adaptive_local-0.5.0a1/src/adaptive_local/resources/__init__.py +51 -0
  112. adaptive_local-0.5.0a1/src/adaptive_local/resources/actions.py +175 -0
  113. adaptive_local-0.5.0a1/src/adaptive_local/resources/admission.py +114 -0
  114. adaptive_local-0.5.0a1/src/adaptive_local/resources/capabilities.py +46 -0
  115. adaptive_local-0.5.0a1/src/adaptive_local/resources/controller.py +272 -0
  116. adaptive_local-0.5.0a1/src/adaptive_local/resources/feedback.py +195 -0
  117. adaptive_local-0.5.0a1/src/adaptive_local/resources/linux_controls.py +534 -0
  118. adaptive_local-0.5.0a1/src/adaptive_local/resources/monitor.py +173 -0
  119. adaptive_local-0.5.0a1/src/adaptive_local/resources/ownership.py +53 -0
  120. adaptive_local-0.5.0a1/src/adaptive_local/resources/schemas.py +150 -0
  121. adaptive_local-0.5.0a1/src/adaptive_local/resources/session.py +816 -0
  122. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/__init__.py +23 -0
  123. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/artifacts.py +138 -0
  124. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/base.py +165 -0
  125. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/cache.py +25 -0
  126. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/catalog.json +30 -0
  127. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/compatibility.py +21 -0
  128. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/errors.py +56 -0
  129. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/installer.py +153 -0
  130. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/lifecycle.py +42 -0
  131. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/llamacpp/__init__.py +3 -0
  132. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/llamacpp/adapter.py +611 -0
  133. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/manager.py +26 -0
  134. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/registry.py +53 -0
  135. adaptive_local-0.5.0a1/src/adaptive_local/runtimes/schemas.py +162 -0
  136. adaptive_local-0.5.0a1/tests/fixtures/lscpu_x86_64.json +7 -0
  137. adaptive_local-0.5.0a1/tests/fixtures/macos_system_profiler.json +9 -0
  138. adaptive_local-0.5.0a1/tests/fixtures/nvidia_smi_multi_gpu.csv +3 -0
  139. adaptive_local-0.5.0a1/tests/fixtures/windows_cim_gpu.json +8 -0
  140. adaptive_local-0.5.0a1/tests/helpers.py +49 -0
  141. adaptive_local-0.5.0a1/tests/test_autotune.py +426 -0
  142. adaptive_local-0.5.0a1/tests/test_benchmark_engine.py +154 -0
  143. adaptive_local-0.5.0a1/tests/test_capabilities.py +49 -0
  144. adaptive_local-0.5.0a1/tests/test_cli.py +311 -0
  145. adaptive_local-0.5.0a1/tests/test_config.py +37 -0
  146. adaptive_local-0.5.0a1/tests/test_feedback.py +198 -0
  147. adaptive_local-0.5.0a1/tests/test_hardware.py +18 -0
  148. adaptive_local-0.5.0a1/tests/test_hardware_benchmarks.py +33 -0
  149. adaptive_local-0.5.0a1/tests/test_hardware_cache.py +34 -0
  150. adaptive_local-0.5.0a1/tests/test_hardware_collectors.py +23 -0
  151. adaptive_local-0.5.0a1/tests/test_hardware_schema.py +76 -0
  152. adaptive_local-0.5.0a1/tests/test_linux_controls.py +244 -0
  153. adaptive_local-0.5.0a1/tests/test_model_hub.py +261 -0
  154. adaptive_local-0.5.0a1/tests/test_models.py +43 -0
  155. adaptive_local-0.5.0a1/tests/test_phase5b_failure_concurrency.py +348 -0
  156. adaptive_local-0.5.0a1/tests/test_phase5c_lifecycle.py +360 -0
  157. adaptive_local-0.5.0a1/tests/test_phase5d_controls.py +187 -0
  158. adaptive_local-0.5.0a1/tests/test_quality_evaluators.py +129 -0
  159. adaptive_local-0.5.0a1/tests/test_resource_session.py +263 -0
  160. adaptive_local-0.5.0a1/tests/test_resources.py +162 -0
  161. adaptive_local-0.5.0a1/tests/test_runtime.py +179 -0
  162. adaptive_local-0.5.0a1/tests/test_runtime_management.py +269 -0
@@ -0,0 +1,23 @@
1
+ name: Benchmark report
2
+ description: Share reproducible, sanitized benchmark evidence.
3
+ title: "[Benchmark]: "
4
+ labels: [benchmark]
5
+ body:
6
+ - type: textarea
7
+ attributes:
8
+ label: Reproducibility metadata
9
+ description: Sanitized hardware fingerprint, model identity/quantization, runtime identity, configuration, workload, and repetitions.
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ attributes:
14
+ label: Measurements and statistical summary
15
+ description: Include raw measurements when safe, uncertainty summary, and limitations.
16
+ validations:
17
+ required: true
18
+ - type: checkboxes
19
+ attributes:
20
+ label: Evidence check
21
+ options:
22
+ - label: This report labels simulated or mocked evidence clearly and contains no secret or private data.
23
+ required: true
@@ -0,0 +1,37 @@
1
+ name: Bug report
2
+ description: Report a reproducible Adaptive problem without private data.
3
+ title: "[Bug]: "
4
+ labels: [bug]
5
+ body:
6
+ - type: input
7
+ attributes:
8
+ label: Adaptive version
9
+ placeholder: 0.3.0a1
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ attributes:
14
+ label: Environment
15
+ description: Include OS, CPU/GPU, Python version, and runtime version. Do not include machine identifiers.
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ attributes:
20
+ label: Expected and actual behavior
21
+ validations:
22
+ required: true
23
+ - type: textarea
24
+ attributes:
25
+ label: Reproduction steps
26
+ validations:
27
+ required: true
28
+ - type: textarea
29
+ attributes:
30
+ label: Sanitized logs
31
+ description: Remove secrets, private prompts, paths, model weights, and personal data.
32
+ - type: checkboxes
33
+ attributes:
34
+ label: Safety check
35
+ options:
36
+ - label: I removed credentials, private data, and machine identifiers.
37
+ required: true
@@ -0,0 +1,22 @@
1
+ name: Feature request
2
+ description: Suggest a roadmap-aligned improvement.
3
+ title: "[Feature]: "
4
+ labels: [enhancement]
5
+ body:
6
+ - type: textarea
7
+ attributes:
8
+ label: Problem
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ attributes:
13
+ label: Proposed solution
14
+ validations:
15
+ required: true
16
+ - type: textarea
17
+ attributes:
18
+ label: Alternatives considered
19
+ - type: input
20
+ attributes:
21
+ label: Relevant roadmap phase
22
+ description: A request does not itself change the approved roadmap.
@@ -0,0 +1,28 @@
1
+ name: Hardware compatibility report
2
+ description: Share sanitized evidence from a real local machine.
3
+ title: "[Hardware]: "
4
+ labels: [hardware]
5
+ body:
6
+ - type: textarea
7
+ attributes:
8
+ label: Hardware and runtime
9
+ description: OS, CPU, GPU, RAM/VRAM, and runtime version. Do not include serial numbers or machine identifiers.
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ attributes:
14
+ label: Capability detection and hardware profile
15
+ description: Paste sanitized output only.
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ attributes:
20
+ label: Verified and failed operations
21
+ validations:
22
+ required: true
23
+ - type: checkboxes
24
+ attributes:
25
+ label: Privacy check
26
+ options:
27
+ - label: I removed secrets, private prompts, paths, and machine identifiers.
28
+ required: true
@@ -0,0 +1,14 @@
1
+ ## Summary
2
+
3
+ Describe the problem, change, and limitations.
4
+
5
+ ## Checklist
6
+
7
+ - [ ] Changes are within the approved scope and roadmap phase.
8
+ - [ ] Tests were added or updated, and existing tests pass.
9
+ - [ ] Documentation was updated where needed.
10
+ - [ ] No secrets, private data, local paths, weights, caches, or runtime binaries are included.
11
+ - [ ] Hardware results are correctly labeled as real, simulated, or fixture-based.
12
+ - [ ] No unsupported performance or compatibility claims are made.
13
+ - [ ] Experimental limitations are documented.
14
+ - [ ] Roadmap compliance was verified.
@@ -0,0 +1,32 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python-version: ["3.11", "3.12"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ cache: pip
24
+ - run: python -m pip install --upgrade pip
25
+ - run: python -m pip install -e '.[dev]'
26
+ - run: ruff check src tests scripts
27
+ - run: ruff format --check src tests scripts
28
+ - run: pytest --cov=adaptive_local --cov-report=term
29
+ - run: python -m build --no-isolation
30
+ - run: python -m venv /tmp/adaptive-wheel-smoke
31
+ - run: /tmp/adaptive-wheel-smoke/bin/python -m pip install dist/*.whl
32
+ - run: /tmp/adaptive-wheel-smoke/bin/adaptive --help
@@ -0,0 +1,27 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .coverage*
7
+ .adaptive/
8
+ data/raw/*
9
+ !data/raw/.gitkeep
10
+ data/interim/*
11
+ !data/interim/.gitkeep
12
+ data/processed/*
13
+ !data/processed/.gitkeep
14
+ data/catalog/
15
+ data/external_cache/
16
+ data/evidence/
17
+ data/models/
18
+ vendor/
19
+ /reports/
20
+ *.log
21
+ .env
22
+ dist/
23
+ build/
24
+ *.egg-info/
25
+ adaptiveai.toml
26
+ adaptive.toml
27
+ reports/phase4_5/matched_outputs.partial.jsonl
@@ -0,0 +1,15 @@
1
+ # Adaptive agent rules
2
+
3
+ 1. `MASTER_ROADMAP.md` is the authoritative requirements source.
4
+ 2. Work only on the current owner-approved phase; do not start the next phase without authorization.
5
+ 3. Do not alter the roadmap, phase order, gates, or acceptance thresholds without owner approval.
6
+ 4. Do not fabricate results, hide negative experiments, or call synthetic tests real hardware tests.
7
+ 5. Do not claim unconfirmed acceleration or apply research-only profiles automatically.
8
+ 6. Do not edit `planning/`.
9
+ 7. Do not commit credentials, private data, restricted artifacts, model weights, caches, or runtime
10
+ binaries.
11
+ 8. Do not use destructive Git operations or force-push.
12
+ 9. Do not publish packages, releases, tags, or remote changes without owner authorization.
13
+ 10. Update `PROGRESS.md` and `DECISIONS.md` after a completed phase; preserve a separate checkpoint.
14
+ 11. Put ideas outside approved scope in `BACKLOG.md`.
15
+ 12. Implement future-phase functionality only after prior gates and explicit authorization.
@@ -0,0 +1,101 @@
1
+ # Adaptive Architecture through Phase 4
2
+
3
+ ## Scope
4
+
5
+ Adaptive remains a small local inference application. The user explicitly supplies a registered
6
+ model ID or GGUF path. Phase 4 can optimize execution parameters for that model; it does not select
7
+ the model itself.
8
+
9
+ ```text
10
+ adaptive CLI
11
+ ├─ config ── strict TOML/Pydantic + legacy local-key migration
12
+ ├─ diagnostics ── doctor
13
+ ├─ hardware
14
+ │ ├─ typed schema and provenance
15
+ │ ├─ read-only Linux collectors
16
+ │ ├─ capability registry and bounded probes
17
+ │ ├─ stable fingerprint + dynamic snapshot
18
+ │ ├─ atomic local profile cache
19
+ │ └─ explicit short microbenchmarks
20
+ ├─ models ── local JSON registry and optional SHA-256 verification
21
+ ├─ runtimes
22
+ ├─ RuntimeAdapter v1 + checked lifecycle
23
+ ├─ artifact catalog, compatibility, isolated cache and installer
24
+ └─ llamacpp ── owned process group + 127.0.0.1 transport
25
+ └─ benchmark
26
+ ├─ versioned workload manifests and prompt hashes
27
+ ├─ randomized execution and deterministic quality checks
28
+ ├─ client timing plus distinct runtime timing
29
+ ├─ bounded resource sampler and desktop sentinels
30
+ │ └─ append-only JSONL, comparisons and report regeneration
31
+ └─ optimization/autotune
32
+ ├─ capability-filtered typed search space and bounded strategies
33
+ ├─ multi-objective scoring and Pareto analysis
34
+ ├─ independent statistical/quality/resource gates
35
+ └─ integrity-checked profiles, explanations and safe fallback
36
+ ```
37
+
38
+ There is no routing layer, cloud provider, pricing layer, public server, Python API client or model
39
+ download service. AutoTune chooses only execution parameters for one explicitly selected model.
40
+
41
+ ## Benchmark evidence flow
42
+
43
+ ```text
44
+ frozen workload + model/runtime/config provenance
45
+ → randomized real RuntimeAdapter requests
46
+ → runs.jsonl + resource_samples.jsonl + quality_results.jsonl
47
+ → compatibility guard + bootstrap summaries
48
+ → summary.json + reproducible report.md
49
+ ```
50
+
51
+ TTFT is the client-observed first non-empty streamed content. llama.cpp prefill/decode rates remain
52
+ separate from client-derived TPOT. Stream chunks can contain several tokens, so chunk intervals are
53
+ not exact token ITL. Periodic RSS is an observed peak, not an exact maximum.
54
+
55
+ ## Runtime contract
56
+
57
+ `RuntimeAdapter` provides the operations needed by the managed llama.cpp integration:
58
+
59
+ - `available()` checks runtime presence;
60
+ - `validate(model)` reports compatibility problems;
61
+ - `load(model)` starts and health-checks the model;
62
+ - `generate(request)` performs bounded non-streaming inference;
63
+ - `stream(request)` yields supported output chunks;
64
+ - `stop()` interrupts execution by stopping the owned runtime;
65
+ - `unload()` releases the model and child process;
66
+ - `metadata()` reports runtime identity, version, capabilities, executable, and loaded model.
67
+
68
+ Runtime installation is a separate consent-gated path: strict manifest → host compatibility →
69
+ verified archive → safe staging extraction → executable hash/probe → atomic activation. Runtime
70
+ binaries remain outside the Python package. Network download mechanics exist but the tested local
71
+ build has no catalog download URL.
72
+
73
+ The runtime contract deliberately omits performance-based engine and model selection. AutoTune is
74
+ a separate controller built over that contract. Phase 1 hardware microbenchmarks remain separate from runtime/model
75
+ benchmarks and run only on explicit request.
76
+
77
+ ## Boundaries and dependencies
78
+
79
+ - Pydantic validates configuration and the versioned hardware schema.
80
+ - psutil, procfs, sysfs and bounded optional system commands supply hardware/resource evidence.
81
+ - HTTPX communicates only with the child llama-server at `127.0.0.1`.
82
+ - llama.cpp and GGUF weights are external and never shipped in the Python artifacts.
83
+ - Process termination escalates from terminate to kill only for the owned child after a timeout.
84
+
85
+ ## Package naming
86
+
87
+ The distribution is `adaptive-local`; Python imports use `adaptive_local` to avoid collision with
88
+ the unrelated public `adaptive` package. The end-user executable remains `adaptive`.
89
+
90
+ ## Hardware data flow
91
+
92
+ ```text
93
+ platform collectors → typed stable profile → canonical fingerprint
94
+ ↘ capability probes
95
+ dynamic collectors → resource snapshot
96
+ explicit request → safe microbenchmarks
97
+ all stable results → integrity-checked atomic local cache
98
+ ```
99
+
100
+ Collector failures are isolated. Unknown remains unknown, and a detected GPU never implies a
101
+ verified compute backend.
@@ -0,0 +1,81 @@
1
+ # Phase 0 Repository Audit
2
+
3
+ Status: IN PROGRESS
4
+ Baseline commit: `72fc27b53430430b14322bcd63469d752691a488`
5
+ Baseline date: 1 December 2026
6
+
7
+ ## Baseline
8
+
9
+ - Working source: public `main` after documentation PR #2; 262 tracked files, about 1.5 MiB of
10
+ tracked content. Untracked owner planning files were present and were not modified.
11
+ - Package: `adaptiveai 0.2.0a1`; Python 3.11+; mandatory HTTPX, Pydantic, and psutil; large ML
12
+ dependencies were optional under `research`.
13
+ - Baseline tests: 126 passed, 3 skipped on Python 3.12.3. Six loopback tests initially failed under
14
+ the filesystem/network sandbox and passed unchanged when local sockets were permitted.
15
+ - Coverage: 3,815/5,659 statements, 67.41%.
16
+ - Ruff: 92 files formatted; lint passed.
17
+ - CLI: `adaptiveai --help`, `--version`, and `hardware inspect` worked. The help exposed cloud,
18
+ routing, public server, research, archive, and benchmark commands.
19
+ - Hardware inspect: AMD Ryzen 5 PRO 6650U, 6 physical/12 logical cores, 14.40 GiB RAM, Linux x86_64,
20
+ AMD DRM device `0x1002:0x1681`, GPU memory unknown, llama.cpp detected.
21
+ - Local runtime: `llama-server` version `1.0.0-dev`, build 1, commit `a300a9c`, Linux x86_64.
22
+ - Local models found: Qwen2.5-0.5B-Instruct Q4_K_M (379.38 MiB) and SmolLM2-1.7B-Instruct Q4_K_M
23
+ (1006.71 MiB). These weights are excluded from Git and packages.
24
+ - Existing stale artifacts: `adaptiveai-0.1.0` wheel 114 KiB and sdist 201 KiB; they do not
25
+ represent the rebooted project and must not be reused.
26
+
27
+ ## Security and private-data review
28
+
29
+ No `.env`, PEM, private-key, or credential file was found in the repository scan. The audit never
30
+ printed environment-variable values. Historical cloud code accepted credentials through environment
31
+ variables and implemented allowlists and budget controls, but all cloud execution is outside the new
32
+ mandatory core. Model weights, raw datasets, caches, `vendor/`, `.venv/`, and planning material are
33
+ excluded from release artifacts.
34
+
35
+ ## Component decisions
36
+
37
+ | Component | Decision | Reason |
38
+ |---|---|---|
39
+ | llama.cpp loopback backend | REFACTOR | Keep real local inference; expose only a small runtime adapter and no public server. |
40
+ | Hardware Inspector | KEEP | It performs real host inspection and preserves unknown GPU memory. Advanced probes remain Phase 1. |
41
+ | Model registry | REFACTOR | Keep local identity/path/hash inspection; remove routing profiles and quality/cost fields. |
42
+ | Lifecycle/process cleanup | REFACTOR | Retain bounded start, timeout, terminate/kill cleanup and single loaded model. Remove router coupling. |
43
+ | TOML/Pydantic config | REFACTOR | New strict `[adaptive]` schema; migrate only safe local legacy keys. |
44
+ | CLI | REFACTOR | Replace `adaptiveai` with `adaptive`; retain only doctor, hardware inspect, models list, and run. |
45
+ | Public HTTP API/server | REMOVE | Explicitly outside mandatory core. Internal llama.cpp loopback transport remains private. |
46
+ | Python client/SDK | REMOVE | It existed to call the removed public HTTP API. |
47
+ | Cloud/BYOK providers | ARCHIVE | Valuable historical security work but outside local-first product scope. |
48
+ | Auto/semantic/TF-IDF/neural routing | ARCHIVE | Scientific results remain reproducible in legacy snapshot; not active product behavior. |
49
+ | Cloud pricing/budget code | ARCHIVE | No cloud operation exists in the new core. |
50
+ | Research datasets and experiments | ARCHIVE | Preserve provenance and negative results; exclude from distribution. |
51
+ | Benchmark research infrastructure | ARCHIVE | It was routing-specific. A new benchmark engine belongs to Phase 2. |
52
+ | Old tests and reports | ARCHIVE | Preserve historical verification while active CI tests only the new product. |
53
+ | CI and Hatch packaging | REFACTOR | Reuse Python 3.11/3.12 matrix with the smaller dependency/package surface. |
54
+ | Apache-2.0 LICENSE | KEEP | Existing owner-approved license; no relicensing performed. |
55
+ | Third-party notices | REFACTOR | Remove optional research dependencies from active runtime inventory and retain legacy warning. |
56
+
57
+ ## Name audit
58
+
59
+ - Product and CLI: `Adaptive` / `adaptive`.
60
+ - Distribution: `adaptive-local`; the official PyPI JSON endpoint returned 404 on 1 December 2026,
61
+ which indicates no current project at that normalized name but does not reserve future rights.
62
+ - Import: `adaptive_local`. The preferred `adaptive` import conflicts with the active PyPI project
63
+ `adaptive`, so using it would create unsafe environment ambiguity.
64
+
65
+ ## Dependency audit
66
+
67
+ The active mandatory dependencies are HTTPX (BSD-3-Clause), Pydantic (MIT), and psutil
68
+ (BSD-3-Clause). HTTPX is retained only for the internal llama.cpp loopback protocol. PyTorch,
69
+ sentence-transformers, NumPy, pandas, SciPy, scikit-learn, Matplotlib, and PyArrow are no longer
70
+ declared by the active package. Runtime binaries and model weights are external.
71
+
72
+ ## Legacy recovery
73
+
74
+ Local branch `legacy/adaptiveai-router` points to the exact baseline commit. Historical source,
75
+ tests, reports, examples, and scientific documentation are also grouped under
76
+ `research/legacy_adaptiveai/` and excluded from builds. No branch was deleted or rewritten.
77
+
78
+ ## Open checks
79
+
80
+ Final active tests, real GGUF inference, clean wheel installation, artifact-content scanning, and
81
+ license/release gates are recorded in the Phase 0 report when complete.
@@ -0,0 +1,52 @@
1
+ # AutoTune Protocol v1
2
+
3
+ ## Purpose
4
+
5
+ AutoTune measures execution configurations for one already-selected local model. It does not choose
6
+ or download a model. It is research-only. A candidate may be cached only after an independent
7
+ validation run, but is used by `adaptive run` only when the user explicitly requests `--profile`;
8
+ otherwise Adaptive keeps its default configuration.
9
+
10
+ ## Pipeline
11
+
12
+ 1. Capture the stable hardware fingerprint and a fresh resource snapshot.
13
+ 2. Hash the model and runtime and record runtime/driver evidence.
14
+ 3. Generate only configurations supported by verified capabilities and the requested context.
15
+ 4. Reject incompatible or conservatively memory-inadmissible candidates before execution.
16
+ 5. Measure the Adaptive default, then run a bounded search on development workloads.
17
+ 6. Select a candidate without consulting holdout results.
18
+ 7. Re-measure baseline and candidate on independent workloads with randomized blocks.
19
+ 8. Apply quality, error-rate, memory, TTFT, practical-effect and uncertainty gates.
20
+ 9. Cache an integrity-protected profile only if every gate passes.
21
+
22
+ The Phase 4 frozen criterion requires at least 5% median decode improvement and a bootstrap 95%
23
+ speedup interval whose lower bound exceeds 1.05. Quality may not decrease, observed peak RAM may
24
+ not rise by more than 10%, TTFT may not regress by more than 20%, and validation errors reject the
25
+ candidate. Criteria are frozen before results are inspected.
26
+
27
+ ## Budgets and safety
28
+
29
+ Quick, Standard and Deep modes bound search trials, validation repetitions and intended wall time.
30
+ Trials are sequential; the engine never keeps multiple model copies resident. Runtime workload
31
+ timeouts, conservative memory admission, process ownership and loopback-only transport are reused
32
+ from Phases 2 and 3. A missing metric is not treated as proof: in particular, absent quality evidence
33
+ fails profile activation.
34
+
35
+ The time budget is checked between bounded benchmark units. It is not a hard real-time process
36
+ deadline, so one already-started workload can finish at its own timeout. Cancellation terminates the
37
+ owned llama-server using the Phase 3 lifecycle contract.
38
+
39
+ ## Reproducibility
40
+
41
+ Every experiment stores immutable workload/configuration manifests, hashes, seeds, environment,
42
+ append-only runs, raw responses, quality records and resource samples. Search and independent
43
+ validation are separate experiment directories. Interrupted directories remain evidence and are
44
+ never silently resumed as if complete.
45
+
46
+ ## Limits
47
+
48
+ Phase 4 was validated only on Linux x86_64 CPU with llama.cpp and two local GGUF models. GPU,
49
+ Windows, macOS, affinity, NUMA policies, reduced KV precision and energy optimization remain
50
+ unverified. Statistical acceptance applies only to the recorded model/runtime/hardware/workload key.
51
+ The tested Phase 4 candidates did not establish acceleration: the confirmatory gate accepted 0/4
52
+ hypotheses. No automatic application or production acceleration claim is permitted from this phase.
@@ -0,0 +1,59 @@
1
+ # Backlog
2
+
3
+ Items here are not authorized Phase 0 work:
4
+
5
+ - improve Markdown-native formatting of the mechanically preserved roadmap without changing text;
6
+ - decide whether the public repository should be renamed from AdaptiveAI to Adaptive;
7
+ - add platform-specific packaging only after real platform testing;
8
+ - investigate direct llama.cpp bindings only if loopback transport becomes a measured limitation;
9
+ - validate Windows and macOS collectors on real hardware before support claims;
10
+ - add optional real compute-context probes for CUDA, ROCm, Vulkan, Metal, SYCL and OpenVINO when
11
+ suitable backend bindings are already installed;
12
+ - add GPU memory/transfer microbenchmarks only after those probes pass;
13
+ - investigate a tiny compiled memory benchmark helper if libc diagnostics prove insufficient;
14
+ - validate benchmark behavior on Windows, macOS and verified GPU backends;
15
+ - calibrate prompt generators against actual tokenizer counts;
16
+ - add exact token-level ITL only when a runtime provides unambiguous per-token events;
17
+ - validate official upstream runtime binary artifacts and additional platforms before adding URLs;
18
+ - improve stale install-lock recovery without risking concurrent installation corruption;
19
+ - parse GGUF architecture/tokenizer/template metadata in a future authorized phase;
20
+ - add additional inference engines only in their roadmap phase;
21
+ - revisit the Python import namespace only if ownership or coexistence conditions change.
22
+ - validate AutoTune on real Windows, macOS, GPU and multi-NUMA systems before expanding support;
23
+ - add a verified physical-core sibling topology probe before enabling affinity search;
24
+ - add real energy telemetry and measurement before enabling Energy profile selection;
25
+ - investigate workload-conditional profiles: Phase 4 observed opposite effects on long and short
26
+ workloads, but did not establish a safe classifier or activation policy;
27
+ - strengthen hard wall-clock interruption inside an already-started benchmark unit without risking
28
+ corrupt evidence or orphan runtime processes;
29
+ - expand strict quality workloads for sub-billion-parameter models without changing the frozen
30
+ Phase 4 results.
31
+ - reassess AutoTune scientifically when Phase 7 adds verified multi-runtime choices;
32
+ - reassess its search space when Phase 8 adds heterogeneous compute backends;
33
+ - reassess topology and placement when Phase 9 adds multi-GPU optimization;
34
+ - reassess decoding parameters when Phase 10 adds advanced decoding;
35
+ - reassess memory parameters when Phase 11 adds the advanced memory engine;
36
+ - reassess quantization-aware tuning when Phase 12 adds the quantization toolkit;
37
+ - reassess kernel-sensitive parameters when Phase 13 adds adaptive kernels;
38
+ - reassess workload-conditional tuning when Phase 15 adds workload-aware acceleration.
39
+
40
+ These reassessments do not modify the roadmap or authorize any future phase.
41
+
42
+ ## Phase 5R — Resource Management Experimental Validation
43
+
44
+ This deferred research milestone is mandatory before Adaptive can claim validated Resource Manager
45
+ performance or promote unverified OS controls to production defaults. It preserves, rather than
46
+ changes, the original Phase 5 experimental gate.
47
+
48
+ - provide a runnable production A/B/C benchmark harness which applies controls only to a verified
49
+ Adaptive-owned runtime, reads back effective state, and verifies restoration;
50
+ - use a dedicated delegated cgroup-v2 environment with exclusive ownership, no foreign members or
51
+ populated descendants, and verified `cpu`, `memory`, and `io` controls;
52
+ - validate real kernel control application and rollback without changing unrelated processes;
53
+ - run the frozen randomized independent-block protocol with identical model, prompts, generation
54
+ settings, workloads, and resource budgets across default/static, fixed-cgroup, and adaptive arms;
55
+ - require Desktop Sentinel p95 improvement of at least 20% versus baseline while decode and
56
+ end-to-end throughput degrade by no more than 25%; report uncertainty and distinguish Sentinel
57
+ results from actual GUI latency;
58
+ - verify quality, recovery, manual disable, restoration, zero silent request losses, zero orphan
59
+ runtimes, and zero unauthorized process changes.
@@ -0,0 +1,41 @@
1
+ # Adaptive Benchmark Protocol 1.1
2
+
3
+ Version 1.1 requires numeric evaluators to accept exactly one complete numeric response instead of
4
+ extracting the first number from arbitrary text. Historical Phase 2–4 records remain immutable;
5
+ reports identify which protocol produced each result.
6
+ Multiple-choice evaluators likewise require exactly one complete choice token rather than accepting
7
+ arbitrary text beginning with the expected letter.
8
+
9
+ ## Scope
10
+
11
+ Phase 2 compares explicitly supplied local GGUF configurations. It does not rank unrelated models,
12
+ recommend a model, tune the runtime, execute generated code, or use a cloud judge. Development
13
+ workloads and holdout workloads are distinct; holdout results are not used to select parameters.
14
+
15
+ ## Reproducibility
16
+
17
+ Every experiment records the workload checksum, prompt hashes, model SHA-256, runtime identity,
18
+ configuration, platform, randomization seed and protocol notes. The main comparison uses two
19
+ warmups followed by ten measured repetitions per workload/configuration in randomized blocks.
20
+ Process-cold measurements reload the model five times per configuration. Failures and invalid
21
+ responses remain in JSONL and are never silently removed.
22
+
23
+ ## Metrics
24
+
25
+ - TTFT is client time to the first non-empty streamed content chunk.
26
+ - TPOT/client decode rate is derived after TTFT when at least two generated tokens exist.
27
+ - Runtime prefill/decode metrics come from llama.cpp and remain separate.
28
+ - Chunk intervals are observable HTTP content intervals, not exact token ITL.
29
+ - Memory is periodically observed process-tree RSS/PSS and system availability.
30
+ - Quality uses frozen deterministic evaluators; open text is marked unevaluated.
31
+ - Desktop impact uses an independent spawned CPU sentinel and bounded temporary-directory probes.
32
+
33
+ Median, mean, standard deviation, coefficient of variation, bootstrap 95% confidence intervals and
34
+ exploratory percentiles are reported. P95/P99 from small samples are explicitly limited or omitted.
35
+
36
+ ## Storage and comparison
37
+
38
+ Manifests are atomic JSON. Runs, samples and quality records are append-only schema-versioned JSONL
39
+ with fsync after every record. Reports can be regenerated from saved data. A direct speedup is
40
+ refused when configuration workload sets differ. Cross-machine, cross-model and cross-runtime
41
+ results require manual provenance review.
@@ -0,0 +1,29 @@
1
+ # Capability Registry v1
2
+
3
+ The registry distinguishes hardware presence, software presence and a successful computation. A
4
+ driver, command or device name alone never proves a backend works.
5
+
6
+ | State | Meaning |
7
+ |---|---|
8
+ | `verified` | A bounded compute probe produced the expected result. |
9
+ | `unverified` | Relevant hardware/software may exist, but no adequate compute probe ran. |
10
+ | `unavailable` | Required hardware or optional probe software is absent, or a probe failed. |
11
+ | `not_applicable` | The backend does not apply to this platform/device configuration. |
12
+ | `unknown` | Evidence was insufficient or collection failed. |
13
+
14
+ Each `CapabilityRecord` includes capability/device IDs, hardware/software tri-state values, probe
15
+ and availability states, backend version if known, evidence, failure reason and UTC measurement
16
+ time.
17
+
18
+ ## Phase 1 probes
19
+
20
+ - CPU: isolated Python subprocess, five-second timeout, SHA-256 known-answer computation. This is
21
+ a real local computation and is validated on Linux/CPU.
22
+ - CUDA, ROCm/HIP, Vulkan, SYCL and OpenVINO: hardware and optional software detection is present.
23
+ Without a safe installed backend binding capable of context creation, allocation and result
24
+ checking, the capability is not marked verified.
25
+ - Metal: `not_applicable` off Apple platforms; unverified on an Apple-shaped fixture because no
26
+ real Apple host was available.
27
+
28
+ A failed or timed-out probe is recorded and does not abort inspection or doctor. Phase 1 does not
29
+ install drivers or heavy backend libraries.
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ ## 0.5.0a1 — Developer Alpha
4
+
5
+ - Added explicit Hugging Face metadata discovery, heuristic GGUF recommendations, reviewed immutable
6
+ acquisition, checksum verification, isolated cache locations, and registry persistence.
7
+ - Added `adaptive setup`, `search`, `recommend`, `pull`, and local GGUF import workflows.
8
+ - Verified one bounded public GGUF acquisition and offline registered-model inference on Linux CPU.
9
+ - AutoTune remains research-only; Resource Manager remains explicit opt-in and its Phase 5R hardware
10
+ validation remains deferred. This alpha makes no universal speed or quality claim.
@@ -0,0 +1,9 @@
1
+ cff-version: 1.2.0
2
+ title: Adaptive
3
+ message: "If you use this experimental local software, cite the exact version or commit."
4
+ type: software
5
+ version: 0.3.0a1
6
+ license: Apache-2.0
7
+ authors:
8
+ - family-names: Leshchenko
9
+ given-names: Nazar
@@ -0,0 +1,24 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We pledge to make participation in Adaptive welcoming and respectful for everyone, regardless of
6
+ experience level, identity, background, or hardware access.
7
+
8
+ ## Expected behavior
9
+
10
+ Use welcoming language, respect different viewpoints, give and accept constructive feedback, focus
11
+ on what is best for the community, and help keep discussion safe and professional.
12
+
13
+ ## Unacceptable behavior
14
+
15
+ Harassment, discriminatory language, threats, personal attacks, publishing private information,
16
+ or other conduct that could reasonably make participation unsafe or hostile is not acceptable.
17
+
18
+ ## Enforcement
19
+
20
+ Project maintainers may clarify expectations, remove inappropriate contributions, or take other
21
+ fair and proportionate action. Report concerns privately to the repository owner; do not publish
22
+ private evidence in an issue.
23
+
24
+ This policy is adapted from the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).