asiai-inference-server 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 (86) hide show
  1. asiai_inference_server-0.1.0/.github/workflows/ci.yml +68 -0
  2. asiai_inference_server-0.1.0/.github/workflows/release.yml +39 -0
  3. asiai_inference_server-0.1.0/.gitignore +54 -0
  4. asiai_inference_server-0.1.0/LICENSE +201 -0
  5. asiai_inference_server-0.1.0/PKG-INFO +102 -0
  6. asiai_inference_server-0.1.0/README.md +71 -0
  7. asiai_inference_server-0.1.0/contrib/mlx-lm/wrapper-start.sh.tpl +72 -0
  8. asiai_inference_server-0.1.0/contrib/rapid-mlx/wrapper-start.sh.tpl +60 -0
  9. asiai_inference_server-0.1.0/contrib/turboquant/README.md +61 -0
  10. asiai_inference_server-0.1.0/contrib/turboquant/configs/llama-70b-turbo3.conf +29 -0
  11. asiai_inference_server-0.1.0/contrib/turboquant/configs/qwen35-turbo3.conf +27 -0
  12. asiai_inference_server-0.1.0/contrib/turboquant/engine.conf +53 -0
  13. asiai_inference_server-0.1.0/contrib/turboquant/setup.sh +209 -0
  14. asiai_inference_server-0.1.0/contrib/turboquant/uninstall.sh +21 -0
  15. asiai_inference_server-0.1.0/contrib/turboquant/wrapper-start.sh.tpl +60 -0
  16. asiai_inference_server-0.1.0/data/engine_manifests/.gitkeep +0 -0
  17. asiai_inference_server-0.1.0/data/engine_manifests/llamacpp-aux-1.toml +70 -0
  18. asiai_inference_server-0.1.0/data/engine_manifests/llamacpp-aux-2.toml +51 -0
  19. asiai_inference_server-0.1.0/data/engine_manifests/llamacpp-aux-3.toml +51 -0
  20. asiai_inference_server-0.1.0/data/engine_manifests/llamacpp-aux-4.toml +57 -0
  21. asiai_inference_server-0.1.0/data/engine_manifests/llamacpp-aux-5.toml +59 -0
  22. asiai_inference_server-0.1.0/data/engine_manifests/llamacpp.toml +71 -0
  23. asiai_inference_server-0.1.0/data/engine_manifests/lmstudio.toml +48 -0
  24. asiai_inference_server-0.1.0/data/engine_manifests/mlx-lm.toml +79 -0
  25. asiai_inference_server-0.1.0/data/engine_manifests/ollama.toml +53 -0
  26. asiai_inference_server-0.1.0/data/engine_manifests/omlx.toml +44 -0
  27. asiai_inference_server-0.1.0/data/engine_manifests/presets/README.md +86 -0
  28. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen2.5-vl-7b-instruct-hermes-aux-4.toml +104 -0
  29. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen3-0.6b-instruct-hermes-aux-3.toml +98 -0
  30. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen3-1.7b-instruct-hermes-aux-2.toml +99 -0
  31. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen3-4b-instruct-hermes-aux-1.toml +121 -0
  32. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen3-4b-instruct-hermes-aux-5-compression.toml +96 -0
  33. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen3.6-27b-dense-hermes-agent-64gb.toml +103 -0
  34. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen3.6-27b-ud-rapidmlx-hermes.toml +94 -0
  35. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen3.6-35b-a3b-hermes-agent-64gb.toml +89 -0
  36. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen3.6-35b-a3b-hermes-fallback-mlx-lm.toml +101 -0
  37. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwen3.6-35b-a3b-rapidmlx-hermes.toml +59 -0
  38. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwopus-27b-v2-rapidmlx-hermes.toml +68 -0
  39. asiai_inference_server-0.1.0/data/engine_manifests/presets/qwopus-35b-a3b-rapidmlx-hermes.toml +67 -0
  40. asiai_inference_server-0.1.0/data/engine_manifests/rapidmlx.toml +98 -0
  41. asiai_inference_server-0.1.0/data/engine_manifests/turboquant.toml +49 -0
  42. asiai_inference_server-0.1.0/data/engine_manifests/vmlx.toml +47 -0
  43. asiai_inference_server-0.1.0/pyproject.toml +76 -0
  44. asiai_inference_server-0.1.0/src/ais_cli/__init__.py +7 -0
  45. asiai_inference_server-0.1.0/src/ais_cli/__main__.py +184 -0
  46. asiai_inference_server-0.1.0/src/ais_cli/as_subcmd.py +300 -0
  47. asiai_inference_server-0.1.0/src/ais_cli/commands.py +454 -0
  48. asiai_inference_server-0.1.0/src/ais_cli/fleet.py +361 -0
  49. asiai_inference_server-0.1.0/src/ais_cli/install_service.py +356 -0
  50. asiai_inference_server-0.1.0/src/ais_cli/serve.py +396 -0
  51. asiai_inference_server-0.1.0/src/ais_core/__init__.py +8 -0
  52. asiai_inference_server-0.1.0/src/ais_core/firewall.py +208 -0
  53. asiai_inference_server-0.1.0/src/ais_core/io.py +50 -0
  54. asiai_inference_server-0.1.0/src/ais_core/lifecycle.py +313 -0
  55. asiai_inference_server-0.1.0/src/ais_core/manifest.py +460 -0
  56. asiai_inference_server-0.1.0/src/ais_core/memory.py +365 -0
  57. asiai_inference_server-0.1.0/src/ais_core/plist.py +203 -0
  58. asiai_inference_server-0.1.0/src/ais_core/sudoers.py +189 -0
  59. asiai_inference_server-0.1.0/src/ais_engines/__init__.py +6 -0
  60. asiai_inference_server-0.1.0/src/ais_engines/base.py +197 -0
  61. asiai_inference_server-0.1.0/src/ais_engines/llamacpp.py +27 -0
  62. asiai_inference_server-0.1.0/src/ais_engines/llamacpp_aux.py +70 -0
  63. asiai_inference_server-0.1.0/src/ais_engines/lmstudio.py +22 -0
  64. asiai_inference_server-0.1.0/src/ais_engines/mlx_lm.py +35 -0
  65. asiai_inference_server-0.1.0/src/ais_engines/ollama.py +23 -0
  66. asiai_inference_server-0.1.0/src/ais_engines/omlx.py +24 -0
  67. asiai_inference_server-0.1.0/src/ais_engines/rapidmlx.py +43 -0
  68. asiai_inference_server-0.1.0/src/ais_engines/turboquant.py +23 -0
  69. asiai_inference_server-0.1.0/src/ais_engines/vmlx.py +23 -0
  70. asiai_inference_server-0.1.0/tests/__init__.py +0 -0
  71. asiai_inference_server-0.1.0/tests/test_aisctl_broadcast.py +182 -0
  72. asiai_inference_server-0.1.0/tests/test_aisctl_fleet_push.py +235 -0
  73. asiai_inference_server-0.1.0/tests/test_aisctl_serve.py +260 -0
  74. asiai_inference_server-0.1.0/tests/test_as_subcmd.py +164 -0
  75. asiai_inference_server-0.1.0/tests/test_cli.py +354 -0
  76. asiai_inference_server-0.1.0/tests/test_engines.py +363 -0
  77. asiai_inference_server-0.1.0/tests/test_firewall.py +78 -0
  78. asiai_inference_server-0.1.0/tests/test_io.py +67 -0
  79. asiai_inference_server-0.1.0/tests/test_lifecycle.py +294 -0
  80. asiai_inference_server-0.1.0/tests/test_manifest.py +436 -0
  81. asiai_inference_server-0.1.0/tests/test_manifest_user_config.py +222 -0
  82. asiai_inference_server-0.1.0/tests/test_memory.py +270 -0
  83. asiai_inference_server-0.1.0/tests/test_plist.py +279 -0
  84. asiai_inference_server-0.1.0/tests/test_smoke.py +56 -0
  85. asiai_inference_server-0.1.0/tests/test_sudoers.py +167 -0
  86. asiai_inference_server-0.1.0/uv.lock +959 -0
@@ -0,0 +1,68 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ name: "Python ${{ matrix.python-version }} / macOS ${{ matrix.macos-version }}"
12
+ runs-on: ${{ matrix.macos-version }}
13
+ timeout-minutes: 15
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ # macOS 13 (Ventura) runners no longer available on GH Actions hosted pool
18
+ # as of May 2026 — jobs queue indefinitely and get cancelled at 24h. Only
19
+ # support macOS 14 (Sonoma) and 15 (Sequoia) — covers Apple Silicon current.
20
+ python-version: ["3.11", "3.12", "3.13"]
21
+ macos-version: ["macos-14", "macos-15"]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v5
25
+
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ uses: actions/setup-python@v6
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+
31
+ - name: Install package (editable)
32
+ run: pip install -e ".[dev]"
33
+
34
+ - name: Lint (ruff)
35
+ run: ruff check src/ tests/
36
+
37
+ - name: Tests
38
+ run: pytest tests/ -v --tb=short
39
+
40
+ contract-test:
41
+ name: "Plugin contract test (entry-point + RegistrationContext)"
42
+ runs-on: macos-14
43
+ timeout-minutes: 10
44
+ steps:
45
+ - uses: actions/checkout@v5
46
+
47
+ - uses: actions/setup-python@v6
48
+ with:
49
+ python-version: "3.12"
50
+
51
+ - name: Install both packages
52
+ run: |
53
+ pip install -e ".[dev]"
54
+ # Verify entry-point is discoverable by importlib.metadata
55
+ python -c "
56
+ from importlib.metadata import entry_points
57
+ eps = list(entry_points(group='asiai.subcommands'))
58
+ assert eps, 'No asiai.subcommands entry points found'
59
+ ep = eps[0]
60
+ register = ep.load()
61
+ import argparse
62
+ p = argparse.ArgumentParser()
63
+ sub = p.add_subparsers()
64
+ cmds = {}
65
+ register(sub, cmds)
66
+ assert 'engine' in cmds, f'engine not in commands: {list(cmds)}'
67
+ print(f'Contract test passed — entry point: {ep.name}, commands: {list(cmds)}')
68
+ "
@@ -0,0 +1,39 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ permissions:
9
+ contents: write
10
+ id-token: write
11
+
12
+ jobs:
13
+ release:
14
+ runs-on: ubuntu-latest
15
+ environment: pypi
16
+ steps:
17
+ - uses: actions/checkout@v6
18
+
19
+ - uses: actions/setup-python@v6
20
+ with:
21
+ python-version: "3.13"
22
+
23
+ - name: Install build tools
24
+ run: pip install build
25
+
26
+ - name: Build package
27
+ run: python -m build
28
+
29
+ - name: Publish to PyPI
30
+ uses: pypa/gh-action-pypi-publish@release/v1
31
+
32
+ - name: Create GitHub Release
33
+ env:
34
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35
+ TAG_NAME: ${{ github.ref_name }}
36
+ run: |
37
+ gh release create "$TAG_NAME" dist/* \
38
+ --title "$TAG_NAME" \
39
+ --generate-notes
@@ -0,0 +1,54 @@
1
+ # Build artefacts
2
+ build/
3
+ dist/
4
+ *.egg-info/
5
+ *.egg
6
+ .eggs/
7
+ wheels/
8
+ share/python-wheels/
9
+ MANIFEST
10
+
11
+ # Python
12
+ __pycache__/
13
+ *.py[cod]
14
+ *$py.class
15
+ *.so
16
+ .Python
17
+ .python-version
18
+
19
+ # Virtual environments
20
+ .venv/
21
+ venv/
22
+ ENV/
23
+ env/
24
+
25
+ # Caches
26
+ .pytest_cache/
27
+ .ruff_cache/
28
+ .mypy_cache/
29
+ .tox/
30
+ .coverage
31
+ .coverage.*
32
+ htmlcov/
33
+ coverage.xml
34
+ *.cover
35
+ .hypothesis/
36
+
37
+ # IDEs
38
+ .idea/
39
+ .vscode/
40
+ *.swp
41
+ *.swo
42
+ .DS_Store
43
+
44
+ # Local dev
45
+ *.local
46
+ *.bak
47
+ .env
48
+ .env.*
49
+ !.env.example
50
+
51
+ # asiai-inference-server runtime state (never commit)
52
+ ~/.config/asiai-inference-server/
53
+ agent.token
54
+ profile-current
@@ -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 describing the origin of the Work and
141
+ 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 Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend, and
172
+ hold each Contributor harmless for any liability incurred by, or
173
+ claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
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 Jean-Marc Nahlovsky
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.
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.4
2
+ Name: asiai-inference-server
3
+ Version: 0.1.0
4
+ Summary: Fleet manager for local LLM inference engines on Apple Silicon
5
+ Project-URL: Homepage, https://asiai.dev
6
+ Project-URL: Documentation, https://asiai.dev/inference-server/
7
+ Project-URL: Repository, https://github.com/druide67/asiai-inference-server
8
+ Project-URL: Issues, https://github.com/druide67/asiai-inference-server/issues
9
+ Author-email: Jean-Marc Nahlovsky <druide67@free.fr>
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: apple-silicon,fleet,inference,llm,lmstudio,macos,mcp,mlx,ollama
13
+ Classifier: Development Status :: 2 - Pre-Alpha
14
+ Classifier: Environment :: MacOS X
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Operating System :: MacOS :: MacOS X
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: System :: Systems Administration
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: asiai>=1.8.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
26
+ Requires-Dist: pytest>=8.0; extra == 'dev'
27
+ Requires-Dist: ruff>=0.6; extra == 'dev'
28
+ Provides-Extra: mcp
29
+ Requires-Dist: mcp>=1.12; extra == 'mcp'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # asiai-inference-server
33
+
34
+ Fleet manager for local LLM inference engines on Apple Silicon.
35
+
36
+ > **Status: v0.0.1 pre-alpha — skeleton only.** Not yet functional. See the
37
+ > roadmap below.
38
+
39
+ `asiai-inference-server` is the **control plane** companion to
40
+ [`asiai`](https://asiai.dev) (the observability/benchmark CLI). Where `asiai`
41
+ *observes* what's running on your Mac, this project *manages* it: install,
42
+ start, stop, unload, and orchestrate inference engines (llama.cpp,
43
+ Ollama, LM Studio, oMLX, TurboQuant, mlx-lm, vMLX, …) across one or
44
+ several Apple Silicon machines.
45
+
46
+ It also fixes the long-standing macOS pain point: **engine memory that never
47
+ gets freed** because of the unified-memory compressor. Killing a process
48
+ doesn't release the VRAM. This tool combines per-engine unload APIs, full
49
+ LaunchDaemon restart, and `sudo purge` to reclaim memory deterministically —
50
+ and reports the actual delta measured, not a marketing promise.
51
+
52
+ ## Why
53
+
54
+ After a year of running multi-engine LLM inference on Apple Silicon
55
+ (MacBook M1 Max, Mac Mini M4 Pro, MacBook M5 Max), the operational gap
56
+ became obvious:
57
+
58
+ - **Install/uninstall** an engine should not require chasing brews, plists
59
+ and firewall rules across READMEs.
60
+ - **Switching profiles** ("coding agent on Qwen-Coder 32B" → "70B chat on
61
+ TurboQuant") should be a single command, not five.
62
+ - **Memory unload** should actually free the VRAM, not let the macOS
63
+ compressor sit on it.
64
+ - **A fleet of Macs** should be a single dashboard, not three SSH sessions.
65
+ - **AI agents** (Claude Code, Cursor, Windsurf) should be able to manage
66
+ the fleet via MCP, not just observe it.
67
+
68
+ `asiai-inference-server` ships these one at a time, building on the
69
+ `asiai` observability stack.
70
+
71
+ ## Roadmap
72
+
73
+ | Version | Scope | Status |
74
+ |---------|-------|--------|
75
+ | v0.0 | Repo skeleton + packaging | in progress |
76
+ | v0.1 | Install/uninstall/start/stop + **unload + purge memory** | next |
77
+ | v0.2 | Profile switching (TOML profiles, apply/rollback) | planned |
78
+ | v0.3 | Fleet manager (multi-Mac inventory, SSH dispatch) | planned |
79
+ | v0.4 | Web cockpit + optional HTTP agent | planned |
80
+ | v1.0 | MCP write tools + PyPI/Homebrew release | planned |
81
+
82
+ ## Architecture (high level)
83
+
84
+ - **CLI**: `aisctl <command>` (standalone) or `asiai engine <command>`
85
+ (auto-injected sub-CLI when `asiai-inference-server` is installed
86
+ alongside `asiai`).
87
+ - **Python stdlib only** for the core (cohérent avec asiai). Optional
88
+ extras: `mcp` (for v1.0 write tools).
89
+ - **macOS Apple Silicon only**. We rely on `launchctl`, `vm_stat`,
90
+ `sudo purge`, `pfctl`, `iogpu.wired_limit_mb`.
91
+ - **SSH-first** for fleet operations. Optional HTTP agent in v0.4 for
92
+ agent-to-agent orchestration.
93
+ - **TOML** for human-edited files (engine manifests, profiles, fleet
94
+ inventory). JSON for runtime state.
95
+
96
+ The full design rationale (architecture diagram, sequencing, file map,
97
+ risk mitigations) lives in the validated plan at
98
+ `~/.claude/plans/iterative-wiggling-crystal.md`.
99
+
100
+ ## License
101
+
102
+ Apache-2.0 © 2026 Jean-Marc Nahlovsky
@@ -0,0 +1,71 @@
1
+ # asiai-inference-server
2
+
3
+ Fleet manager for local LLM inference engines on Apple Silicon.
4
+
5
+ > **Status: v0.0.1 pre-alpha — skeleton only.** Not yet functional. See the
6
+ > roadmap below.
7
+
8
+ `asiai-inference-server` is the **control plane** companion to
9
+ [`asiai`](https://asiai.dev) (the observability/benchmark CLI). Where `asiai`
10
+ *observes* what's running on your Mac, this project *manages* it: install,
11
+ start, stop, unload, and orchestrate inference engines (llama.cpp,
12
+ Ollama, LM Studio, oMLX, TurboQuant, mlx-lm, vMLX, …) across one or
13
+ several Apple Silicon machines.
14
+
15
+ It also fixes the long-standing macOS pain point: **engine memory that never
16
+ gets freed** because of the unified-memory compressor. Killing a process
17
+ doesn't release the VRAM. This tool combines per-engine unload APIs, full
18
+ LaunchDaemon restart, and `sudo purge` to reclaim memory deterministically —
19
+ and reports the actual delta measured, not a marketing promise.
20
+
21
+ ## Why
22
+
23
+ After a year of running multi-engine LLM inference on Apple Silicon
24
+ (MacBook M1 Max, Mac Mini M4 Pro, MacBook M5 Max), the operational gap
25
+ became obvious:
26
+
27
+ - **Install/uninstall** an engine should not require chasing brews, plists
28
+ and firewall rules across READMEs.
29
+ - **Switching profiles** ("coding agent on Qwen-Coder 32B" → "70B chat on
30
+ TurboQuant") should be a single command, not five.
31
+ - **Memory unload** should actually free the VRAM, not let the macOS
32
+ compressor sit on it.
33
+ - **A fleet of Macs** should be a single dashboard, not three SSH sessions.
34
+ - **AI agents** (Claude Code, Cursor, Windsurf) should be able to manage
35
+ the fleet via MCP, not just observe it.
36
+
37
+ `asiai-inference-server` ships these one at a time, building on the
38
+ `asiai` observability stack.
39
+
40
+ ## Roadmap
41
+
42
+ | Version | Scope | Status |
43
+ |---------|-------|--------|
44
+ | v0.0 | Repo skeleton + packaging | in progress |
45
+ | v0.1 | Install/uninstall/start/stop + **unload + purge memory** | next |
46
+ | v0.2 | Profile switching (TOML profiles, apply/rollback) | planned |
47
+ | v0.3 | Fleet manager (multi-Mac inventory, SSH dispatch) | planned |
48
+ | v0.4 | Web cockpit + optional HTTP agent | planned |
49
+ | v1.0 | MCP write tools + PyPI/Homebrew release | planned |
50
+
51
+ ## Architecture (high level)
52
+
53
+ - **CLI**: `aisctl <command>` (standalone) or `asiai engine <command>`
54
+ (auto-injected sub-CLI when `asiai-inference-server` is installed
55
+ alongside `asiai`).
56
+ - **Python stdlib only** for the core (cohérent avec asiai). Optional
57
+ extras: `mcp` (for v1.0 write tools).
58
+ - **macOS Apple Silicon only**. We rely on `launchctl`, `vm_stat`,
59
+ `sudo purge`, `pfctl`, `iogpu.wired_limit_mb`.
60
+ - **SSH-first** for fleet operations. Optional HTTP agent in v0.4 for
61
+ agent-to-agent orchestration.
62
+ - **TOML** for human-edited files (engine manifests, profiles, fleet
63
+ inventory). JSON for runtime state.
64
+
65
+ The full design rationale (architecture diagram, sequencing, file map,
66
+ risk mitigations) lives in the validated plan at
67
+ `~/.claude/plans/iterative-wiggling-crystal.md`.
68
+
69
+ ## License
70
+
71
+ Apache-2.0 © 2026 Jean-Marc Nahlovsky
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env bash
2
+ # =============================================================================
3
+ # mlx-lm headless server startup script
4
+ # Installed at /usr/local/bin/mlx-lm-server-start from this template.
5
+ # =============================================================================
6
+ #
7
+ # mlx-lm has no native CLI binary — the OpenAI-compatible server is a
8
+ # Python module (``python -m mlx_lm.server``). This wrapper:
9
+ # 1. Ensures ``~/.cache/huggingface/hub`` exists (mlx-lm crashes on
10
+ # ``scan_cache_dir()`` when it does not).
11
+ # 2. Discovers the venv python (env override > known paths).
12
+ # 3. Execs ``python -m mlx_lm.server`` with the configured args.
13
+ #
14
+ # Override via environment variables (set in the LaunchDaemon plist):
15
+ # MLXLM_PYTHON path to the venv python (skips auto-discovery)
16
+ # MLXLM_MODEL model path or HF repo id passed to ``--model``
17
+ # MLXLM_PORT listening port (default 8000)
18
+ # MLXLM_HOST bind address (default 0.0.0.0)
19
+ #
20
+ # Recommended install: ``uv tool install mlx-lm``
21
+ # =============================================================================
22
+
23
+ set -euo pipefail
24
+
25
+ # HuggingFace cache directory must exist before mlx-lm starts.
26
+ export HF_HUB_CACHE="${HF_HUB_CACHE:-${HOME}/.cache/huggingface/hub}"
27
+ mkdir -p "${HF_HUB_CACHE}"
28
+
29
+ # Resolve the venv python: explicit env override wins, otherwise probe a
30
+ # short list of conventional install layouts.
31
+ PY="${MLXLM_PYTHON:-}"
32
+ if [[ -z "${PY}" ]]; then
33
+ for candidate in \
34
+ "${HOME}/.local/share/uv/tools/mlx-lm/bin/python" \
35
+ "${HOME}/.local/pipx/venvs/mlx-lm/bin/python" \
36
+ "${HOME}/.local/share/pipx/venvs/mlx-lm/bin/python" \
37
+ "${HOME}/.venvs/mlx-lm/bin/python" \
38
+ "/opt/homebrew/bin/python3" \
39
+ "/usr/local/bin/python3"
40
+ do
41
+ if [[ -x "${candidate}" ]]; then
42
+ PY="${candidate}"
43
+ break
44
+ fi
45
+ done
46
+ fi
47
+
48
+ if [[ -z "${PY}" || ! -x "${PY}" ]]; then
49
+ echo "ERROR: no mlx-lm python interpreter found." >&2
50
+ echo "Hint: install via 'uv tool install mlx-lm' or set MLXLM_PYTHON." >&2
51
+ exit 1
52
+ fi
53
+
54
+ # Sanity-check: the chosen interpreter must import mlx_lm.
55
+ if ! "${PY}" -c "import mlx_lm" >/dev/null 2>&1; then
56
+ echo "ERROR: interpreter ${PY} cannot import mlx_lm." >&2
57
+ echo "Hint: ensure mlx-lm is installed in that environment." >&2
58
+ exit 1
59
+ fi
60
+
61
+ MODEL_PATH="${MLXLM_MODEL:-${HOME}/llms/mlx/active}"
62
+ # Expand a leading ~ to $HOME since launchd does not pre-expand env vars
63
+ # and quoted bash parameters skip tilde expansion. mlx-lm receives the
64
+ # argument literally and would fail to find the model directory.
65
+ MODEL_PATH="${MODEL_PATH/#\~/${HOME}}"
66
+ PORT="${MLXLM_PORT:-8000}"
67
+ HOST="${MLXLM_HOST:-0.0.0.0}"
68
+
69
+ exec "${PY}" -m mlx_lm.server \
70
+ --model "${MODEL_PATH}" \
71
+ --host "${HOST}" \
72
+ --port "${PORT}"
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env bash
2
+ # =============================================================================
3
+ # Rapid-MLX headless server startup script
4
+ # Installed at /usr/local/bin/rapid-mlx-server-start from this template.
5
+ # =============================================================================
6
+ #
7
+ # Rapid-MLX (github.com/raullenchai/Rapid-MLX) is a Python entry-point
8
+ # distributed via pip / brew. This wrapper:
9
+ # 1. Ensures ``~/.cache/huggingface/hub`` exists (MLX engines crash on
10
+ # ``scan_cache_dir()`` when it does not).
11
+ # 2. Discovers the ``rapid-mlx`` binary (env override > brew > pip).
12
+ # 3. Execs ``rapid-mlx serve <model> --host H --port P``.
13
+ #
14
+ # Override via environment variables (set in the LaunchDaemon plist):
15
+ # RAPIDMLX_BIN path to the rapid-mlx binary (skips auto-discovery)
16
+ # RAPIDMLX_MODEL model alias or HF repo id passed positionally
17
+ # RAPIDMLX_PORT listening port (default 8004)
18
+ # RAPIDMLX_HOST bind address (default 0.0.0.0)
19
+ #
20
+ # Recommended install: ``brew install raullenchai/rapid-mlx/rapid-mlx``
21
+ # Alternative: ``pip install rapid-mlx`` (then export RAPIDMLX_BIN
22
+ # to the pip-installed entry point if not in PATH)
23
+ # =============================================================================
24
+
25
+ set -euo pipefail
26
+
27
+ # HuggingFace cache directory must exist before MLX engines start.
28
+ export HF_HUB_CACHE="${HF_HUB_CACHE:-${HOME}/.cache/huggingface/hub}"
29
+ mkdir -p "${HF_HUB_CACHE}"
30
+
31
+ # Resolve the rapid-mlx binary: explicit env override wins, otherwise probe
32
+ # a short list of conventional install layouts.
33
+ BIN="${RAPIDMLX_BIN:-}"
34
+ if [[ -z "${BIN}" ]]; then
35
+ for candidate in \
36
+ "/opt/homebrew/bin/rapid-mlx" \
37
+ "/usr/local/bin/rapid-mlx" \
38
+ "${HOME}/.local/bin/rapid-mlx" \
39
+ "${HOME}/.local/share/uv/tools/rapid-mlx/bin/rapid-mlx"
40
+ do
41
+ if [[ -x "${candidate}" ]]; then
42
+ BIN="${candidate}"
43
+ break
44
+ fi
45
+ done
46
+ fi
47
+
48
+ if [[ -z "${BIN}" || ! -x "${BIN}" ]]; then
49
+ echo "ERROR: rapid-mlx binary not found." >&2
50
+ echo "Hint: install via 'brew install raullenchai/rapid-mlx/rapid-mlx' or set RAPIDMLX_BIN." >&2
51
+ exit 1
52
+ fi
53
+
54
+ MODEL="${RAPIDMLX_MODEL:-qwen3.6-27b-ud}"
55
+ PORT="${RAPIDMLX_PORT:-8004}"
56
+ HOST="${RAPIDMLX_HOST:-0.0.0.0}"
57
+
58
+ exec "${BIN}" serve "${MODEL}" \
59
+ --host "${HOST}" \
60
+ --port "${PORT}"