@simplexai/localmodels-linux-x64 0.1.0-dev.37 → 0.1.0-dev.39

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. package/bootstrap.identity +1 -1
  2. package/bootstrap.sha256 +85 -78
  3. package/modules/localmodels/__init__.py +1 -1
  4. package/modules/localmodels/__main__.py +4 -0
  5. package/modules/localmodels/bifrost_checks.py +9 -6
  6. package/modules/localmodels/bifrost_config.py +35 -1
  7. package/modules/localmodels/bifrost_datasheet.py +12 -2
  8. package/modules/localmodels/catalog.json +155 -8
  9. package/modules/localmodels/catalog.py +19 -1
  10. package/modules/localmodels/catalog_recipes.py +33 -2
  11. package/modules/localmodels/cli_parser.py +26 -3
  12. package/modules/localmodels/deploy.py +37 -9
  13. package/modules/localmodels/deploy_steps.py +6 -3
  14. package/modules/localmodels/download-mirrors.json +52 -4
  15. package/modules/localmodels/engines-b11583.json +20 -4
  16. package/modules/localmodels/engines-b12167.json +5 -1
  17. package/modules/localmodels/engines-strata-0.1.47.json +5 -1
  18. package/modules/localmodels/engines-strata-0.1.49.2.json +5 -1
  19. package/modules/localmodels/engines-strata-0.1.59.1.json +5 -1
  20. package/modules/localmodels/engines-strata-poly-0.1.45-poly.9.json +5 -1
  21. package/modules/localmodels/engines-whisper-b5454.json +5 -1
  22. package/modules/localmodels/engines.json +55 -11
  23. package/modules/localmodels/frontend.py +5 -2
  24. package/modules/localmodels/gateway_bifrost.py +11 -9
  25. package/modules/localmodels/gateway_cli.py +4 -2
  26. package/modules/localmodels/guard.py +15 -6
  27. package/modules/localmodels/harness.py +65 -33
  28. package/modules/localmodels/harness_gateway.py +9 -3
  29. package/modules/localmodels/hf_repo.py +15 -8
  30. package/modules/localmodels/library_gateway.py +26 -13
  31. package/modules/localmodels/library_jobs.py +51 -3
  32. package/modules/localmodels/library_model.py +10 -0
  33. package/modules/localmodels/library_pricing.py +29 -22
  34. package/modules/localmodels/library_serve.py +5 -0
  35. package/modules/localmodels/library_state.py +9 -1
  36. package/modules/localmodels/library_status.py +30 -0
  37. package/modules/localmodels/llm_rank.py +83 -30
  38. package/modules/localmodels/metal_probe.py +16 -6
  39. package/modules/localmodels/npm_signatures.py +131 -0
  40. package/modules/localmodels/npm_transport.py +26 -10
  41. package/modules/localmodels/process_identity.py +32 -5
  42. package/modules/localmodels/recommend.py +5 -2
  43. package/modules/localmodels/region.py +244 -0
  44. package/modules/localmodels/remote_ops.py +69 -13
  45. package/modules/localmodels/remote_ops_download.py +210 -10
  46. package/modules/localmodels/remote_ops_prepare.py +61 -8
  47. package/modules/localmodels/runtime-lock.json +13 -13
  48. package/modules/localmodels/runtime_args.py +4 -2
  49. package/modules/localmodels/runtime_cli.py +19 -37
  50. package/modules/localmodels/runtime_discovery.py +30 -0
  51. package/modules/localmodels/runtime_install.py +81 -6
  52. package/modules/localmodels/runtime_io.py +61 -5
  53. package/modules/localmodels/runtime_pi.py +79 -0
  54. package/modules/localmodels/runtime_process.py +99 -15
  55. package/modules/localmodels/runtime_releases.py +51 -71
  56. package/modules/localmodels/search_server.py +5 -1
  57. package/modules/localmodels/service_probe.py +62 -4
  58. package/modules/localmodels/setup_inspection.py +21 -4
  59. package/modules/localmodels/setup_text.py +6 -0
  60. package/modules/localmodels/source_byok.py +484 -0
  61. package/modules/localmodels/source_byok_probe.py +275 -0
  62. package/modules/localmodels/source_cli.py +426 -0
  63. package/modules/localmodels/stack.py +31 -14
  64. package/modules/localmodels/stack_args.py +8 -4
  65. package/modules/localmodels/stack_binding.py +47 -4
  66. package/modules/localmodels/stack_cli.py +2 -0
  67. package/modules/localmodels/stack_compose.py +5 -5
  68. package/modules/localmodels/stack_events.py +3 -0
  69. package/modules/localmodels/stack_hardware.py +21 -6
  70. package/modules/localmodels/stack_llm_ram.py +16 -6
  71. package/modules/localmodels/stack_picks.py +4 -4
  72. package/modules/localmodels/stack_progress.py +9 -1
  73. package/modules/localmodels/stack_run.py +29 -0
  74. package/modules/localmodels/stack_suite.py +10 -3
  75. package/modules/localmodels/stack_warm.py +45 -4
  76. package/modules/localmodels/tools.json +1396 -32
  77. package/modules/localmodels/transport.py +40 -13
  78. package/modules/localmodels/windows_job.py +69 -0
  79. package/modules/{simplex_localmodels-0.1.0.dev37.dist-info → simplex_localmodels-0.1.0.dev39.dist-info}/METADATA +1 -1
  80. package/modules/{simplex_localmodels-0.1.0.dev37.dist-info → simplex_localmodels-0.1.0.dev39.dist-info}/RECORD +82 -75
  81. package/package.json +1 -1
  82. package/tool.json +1 -1
  83. /package/modules/{simplex_localmodels-0.1.0.dev37.dist-info → simplex_localmodels-0.1.0.dev39.dist-info}/WHEEL +0 -0
  84. /package/modules/{simplex_localmodels-0.1.0.dev37.dist-info → simplex_localmodels-0.1.0.dev39.dist-info}/entry_points.txt +0 -0
  85. /package/modules/{simplex_localmodels-0.1.0.dev37.dist-info → simplex_localmodels-0.1.0.dev39.dist-info}/licenses/NOTICE +0 -0
  86. /package/modules/{simplex_localmodels-0.1.0.dev37.dist-info → simplex_localmodels-0.1.0.dev39.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
@@ -1,13 +1,14 @@
1
1
  """The parameters each remote_ops step takes for a deployment plan: the files to fetch, the
2
- service to install, start or stop, and the readiness request to send. Pure: the API key travels
3
- only in the returned parameters, and nothing here touches a host (deploy.execute runs them)."""
2
+ service to install, start or stop, and the readiness request to send. The API key travels only in
3
+ the returned parameters, and nothing here touches a host (deploy.execute runs them); the engine
4
+ and download steps carry the download region (region.py), resolved the first time one is built."""
4
5
 
5
6
  from __future__ import annotations
6
7
 
7
8
  from typing import TYPE_CHECKING, Literal
8
9
 
9
10
  from localmodels import catalog as cat
10
- from localmodels import vision
11
+ from localmodels import region, vision
11
12
  from localmodels.contracts import decode
12
13
  from localmodels.records import Plan, ReusableFile
13
14
  from localmodels.remote_ops import (
@@ -70,6 +71,7 @@ def _engine_params(plan: Plan, _api_key: str) -> EngineParams:
70
71
  params: EngineParams = {"dir": engine["dir"], "assets": engine.get("assets", [])}
71
72
  if engine.get("binary_name"):
72
73
  params["binary"] = engine["binary_name"]
74
+ params["region"] = region.current_region()
73
75
  return params
74
76
 
75
77
 
@@ -77,6 +79,7 @@ def _download_params(plan: Plan, _api_key: str) -> DownloadParams:
77
79
  params: DownloadParams = {"files": [_download_spec(f) for f in plan["files"]]}
78
80
  if preparation := plan["launch"].get("preparation"):
79
81
  params["preparation"] = decode(preparation, StrataPreparation)
82
+ params["region"] = region.current_region()
80
83
  return params
81
84
 
82
85
 
@@ -38,6 +38,10 @@
38
38
  "repo": "XHToken/Spark-X2.6-1.7B-GGUF",
39
39
  "path": "Spark-X2.6-1.7B-Q8_0.gguf"
40
40
  },
41
+ "91cb2811aebb47ac916aa619d27d4cdd7f4143106b7917accb8ead4cd7f5cbd9": {
42
+ "repo": "XHToken/Spark-X2.6-4B-GGUF",
43
+ "path": "Spark-X2.6-4B-Q4_K_M.gguf"
44
+ },
41
45
  "145c2aa606820663f26ad530b8fc141ed885e2e9ca29f9be7c3bfe8931d58b81": {
42
46
  "repo": "XHToken/Spark-X2.6-4B-GGUF",
43
47
  "path": "Spark-X2.6-4B-Q8_0.gguf"
@@ -114,6 +118,30 @@
114
118
  "repo": "ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF",
115
119
  "path": "mmproj-Swift-Qwen3.8-Flash-Next-BF16.gguf"
116
120
  },
121
+ "d13ce8f90855547bdaebe7312f531a1f2c4f822178d3103951f27fe884395cfa": {
122
+ "repo": "unsloth/DeepSeek-V4-Flash-0731-GGUF",
123
+ "path": "UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00001-of-00005.gguf"
124
+ },
125
+ "d5b61668950f4743aacd677675d7fcf7507dbe1db6d304e8ff97ed1f00827bee": {
126
+ "repo": "unsloth/DeepSeek-V4-Flash-0731-GGUF",
127
+ "path": "UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00002-of-00005.gguf"
128
+ },
129
+ "9705db7e589f360685ca7bd48100b270d78d228d4f5aa980508f3b2778af5494": {
130
+ "repo": "unsloth/DeepSeek-V4-Flash-0731-GGUF",
131
+ "path": "UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00003-of-00005.gguf"
132
+ },
133
+ "7f13a68e3ca64208454c4ba32cc2757c0cbe78e3e5576c3142bf7007ca97da42": {
134
+ "repo": "unsloth/DeepSeek-V4-Flash-0731-GGUF",
135
+ "path": "UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00004-of-00005.gguf"
136
+ },
137
+ "ed0d93164d3784968d6ce40d6d201ba98337f16e7db1b31fe495b2b0f334cc09": {
138
+ "repo": "unsloth/DeepSeek-V4-Flash-0731-GGUF",
139
+ "path": "UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00005-of-00005.gguf"
140
+ },
141
+ "2c7ac54b0b64a99df1f139a9f1371a00198265e1d6a614b77597d20a655a4249": {
142
+ "repo": "unsloth/DeepSeek-V4-Flash-0731-GGUF",
143
+ "path": "dspark-DeepSeek-V4-Flash-0731-Q8_0.gguf"
144
+ },
117
145
  "0f2cbdc4f578b5a53f521bcb1a5f5297cd54ea72ebf6c8ce80b570cc5645bac1": {
118
146
  "repo": "unsloth/Nemotron-3-Nano-30B-A3B-GGUF",
119
147
  "path": "Nemotron-3-Nano-30B-A3B-IQ4_XS.gguf"
@@ -146,6 +174,10 @@
146
174
  "repo": "unsloth/Qwen3.6-35B-A3B-MTP-GGUF",
147
175
  "path": "Qwen3.6-35B-A3B-UD-IQ4_XS.gguf"
148
176
  },
177
+ "8966dd0cd8c543c4228490a2a8b0e0814fc4f1e6a8e199ceed4de6754ae7b8e1": {
178
+ "repo": "unsloth/Qwen3.6-35B-A3B-MTP-GGUF",
179
+ "path": "Qwen3.6-35B-A3B-UD-Q3_K_M.gguf"
180
+ },
149
181
  "0b21525e972670ed59e1812e170b27c26355381f0656ecc4e25617ece7dac58b": {
150
182
  "repo": "unsloth/Qwen3.6-35B-A3B-MTP-GGUF",
151
183
  "path": "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf"
@@ -162,13 +194,29 @@
162
194
  "repo": "unsloth/Qwen3.8-27B-GGUF",
163
195
  "path": "Qwen3.8-27B-UD-IQ3_S.gguf"
164
196
  },
165
- "322e194ff79741c7baa497c240f677f54b201b0efab44ca8e50f122b39123482": {
166
- "repo": "unsloth/Qwen3.8-27B-GGUF",
167
- "path": "Qwen3.8-27B-UD-Q4_K_M.gguf"
168
- },
169
197
  "83ee4f4f205fa514161778c41df1ea14144faa0f713510893b63c2395f5c2d53": {
170
198
  "repo": "unsloth/Qwen3.8-27B-GGUF",
171
199
  "path": "mmproj-BF16.gguf"
200
+ },
201
+ "9d5644b371ffac921427c8021cc7242dab8e3ba37d7b48d1e79fe3770fbf9915": {
202
+ "repo": "unsloth/Qwen3.8-Flash-Next-GGUF",
203
+ "path": "UD-IQ3_XXS/Qwen3.8-Flash-Next-UD-IQ3_XXS-00001-of-00004.gguf"
204
+ },
205
+ "aacaff3bdb9032c2c3be428167930809735f65d3cfb204eba07d85e421e7ddf4": {
206
+ "repo": "unsloth/Qwen3.8-Flash-Next-GGUF",
207
+ "path": "UD-IQ3_XXS/Qwen3.8-Flash-Next-UD-IQ3_XXS-00002-of-00004.gguf"
208
+ },
209
+ "ef8f14e790ab471b363f146d5e8664eefbaf03e5776f317a1fb96a2bc7707b07": {
210
+ "repo": "unsloth/Qwen3.8-Flash-Next-GGUF",
211
+ "path": "UD-IQ3_XXS/Qwen3.8-Flash-Next-UD-IQ3_XXS-00003-of-00004.gguf"
212
+ },
213
+ "5de8b5dbf89409acc39468decafd4a4a95b13c29d88a14b0356107897829ec36": {
214
+ "repo": "unsloth/Qwen3.8-Flash-Next-GGUF",
215
+ "path": "UD-IQ3_XXS/Qwen3.8-Flash-Next-UD-IQ3_XXS-00004-of-00004.gguf"
216
+ },
217
+ "2e788f8c511d8093c7b43cb87b2fd7e14228340318057f8fb20c86df2efe2355": {
218
+ "repo": "unsloth/Qwen3.8-Flash-Next-GGUF",
219
+ "path": "mmproj-BF16.gguf"
172
220
  }
173
221
  }
174
222
  }
@@ -17,7 +17,11 @@
17
17
  "name": "llama-b11583-bin-ubuntu-x64.tar.gz",
18
18
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11583/llama-b11583-bin-ubuntu-x64.tar.gz",
19
19
  "sha256": "a4a681375770db521d15c66bd28339617b833ffc3bcc0a01ff93a883bac80438",
20
- "size_bytes": 17724487
20
+ "size_bytes": 17724487,
21
+ "npm_copy": {
22
+ "package": "@simplexai/engine-llama-b11583-bin-ubuntu-x64",
23
+ "version": "0.0.0-sha256-a4a681375770db52"
24
+ }
21
25
  }
22
26
  ],
23
27
  "min_glibc": "2.34"
@@ -34,7 +38,11 @@
34
38
  "name": "llama-b11583-bin-ubuntu-arm64.tar.gz",
35
39
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11583/llama-b11583-bin-ubuntu-arm64.tar.gz",
36
40
  "sha256": "fc84ae8a184996ba515824fcc6f8da0fb0c26ec404a07bf1f1b407bf9528c3e2",
37
- "size_bytes": 13839236
41
+ "size_bytes": 13839236,
42
+ "npm_copy": {
43
+ "package": "@simplexai/engine-llama-b11583-bin-ubuntu-arm64",
44
+ "version": "0.0.0-sha256-fc84ae8a184996ba"
45
+ }
38
46
  }
39
47
  ]
40
48
  },
@@ -52,7 +60,11 @@
52
60
  "name": "llama-b11583-bin-ubuntu-cuda-12.8-x64.tar.gz",
53
61
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11583/llama-b11583-bin-ubuntu-cuda-12.8-x64.tar.gz",
54
62
  "sha256": "62296a3706f02f657afbe39b8770aafdd7bb84165ab607a5cb463de5e0cecaa4",
55
- "size_bytes": 171591976
63
+ "size_bytes": 171591976,
64
+ "npm_copy": {
65
+ "package": "@simplexai/engine-llama-b11583-bin-ubuntu-cuda-12.8-x64",
66
+ "version": "0.0.0-sha256-62296a3706f02f65"
67
+ }
56
68
  },
57
69
  {
58
70
  "name": "cudart-llama-b11583-bin-ubuntu-cuda-12.8-x64.tar.gz",
@@ -94,7 +106,11 @@
94
106
  "name": "llama-b11583-bin-macos-arm64.tar.gz",
95
107
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11583/llama-b11583-bin-macos-arm64.tar.gz",
96
108
  "sha256": "d23832f4b847a722a64c9bf57e518c3df81dfab325942182ff17792d5d33351f",
97
- "size_bytes": 12112217
109
+ "size_bytes": 12112217,
110
+ "npm_copy": {
111
+ "package": "@simplexai/engine-llama-b11583-bin-macos-arm64",
112
+ "version": "0.0.0-sha256-d23832f4b847a722"
113
+ }
98
114
  }
99
115
  ]
100
116
  }
@@ -14,7 +14,11 @@
14
14
  "name": "llama-b12167-bin-macos-arm64.tar.gz",
15
15
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b12167/llama-b12167-bin-macos-arm64.tar.gz",
16
16
  "sha256": "2b7324ea05035e2cd7ba4ca54b695575c65752e2cef15291a4531b8a1fafbe12",
17
- "size_bytes": 16674382
17
+ "size_bytes": 16674382,
18
+ "npm_copy": {
19
+ "package": "@simplexai/engine-llama-b12167-bin-macos-arm64",
20
+ "version": "0.0.0-sha256-2b7324ea05035e2c"
21
+ }
18
22
  }
19
23
  ]
20
24
  }
@@ -17,7 +17,11 @@
17
17
  "name": "strata-control-0.1.47-linux-x86_64.tar.gz",
18
18
  "url": "https://github.com/Niko1221/Strata/releases/download/v0.2.2/strata-control-0.1.47-linux-x86_64.tar.gz",
19
19
  "sha256": "7ac52e3d4ef8f50466fa0cc662be218975373309214519aa0b68fafd39e66fe8",
20
- "size_bytes": 98643722
20
+ "size_bytes": 98643722,
21
+ "npm_copy": {
22
+ "package": "@simplexai/engine-strata-control-0.1.47-linux-x86_64",
23
+ "version": "0.0.0-sha256-7ac52e3d4ef8f504"
24
+ }
21
25
  },
22
26
  {
23
27
  "name": "strata-engine-0.1.47-linux-x86_64-cuda-cuda13.tar.gz",
@@ -17,7 +17,11 @@
17
17
  "name": "strata-control-0.1.49.2-linux-x86_64.tar.gz",
18
18
  "url": "https://github.com/Niko1221/Strata/releases/download/v0.2.4/strata-control-0.1.49.2-linux-x86_64.tar.gz",
19
19
  "sha256": "2f905fe9e7f0c0f7e1d055a414acc0b3dae6db2d42e7f6a97e57e8ff7d3cf9c6",
20
- "size_bytes": 98918561
20
+ "size_bytes": 98918561,
21
+ "npm_copy": {
22
+ "package": "@simplexai/engine-strata-control-0.1.49.2-linux-x86_64",
23
+ "version": "0.0.0-sha256-2f905fe9e7f0c0f7"
24
+ }
21
25
  },
22
26
  {
23
27
  "name": "strata-engine-0.1.48-control-0.1.49.2-linux-x86_64-cuda-cuda13.tar.gz",
@@ -17,7 +17,11 @@
17
17
  "name": "strata-control-0.1.59.1-linux-x86_64.tar.gz",
18
18
  "url": "https://github.com/Niko1221/Strata/releases/download/v0.2.13/strata-control-0.1.59.1-linux-x86_64.tar.gz",
19
19
  "sha256": "73fb612848cf00fa1072623029b35405bbbb63e3f4c688fe6f38c78e3fc022ac",
20
- "size_bytes": 100087576
20
+ "size_bytes": 100087576,
21
+ "npm_copy": {
22
+ "package": "@simplexai/engine-strata-control-0.1.59.1-linux-x86_64",
23
+ "version": "0.0.0-sha256-73fb612848cf00fa"
24
+ }
21
25
  },
22
26
  {
23
27
  "name": "strata-engine-0.1.59-control-0.1.59.1-linux-x86_64-cuda-cuda13.tar.gz",
@@ -17,7 +17,11 @@
17
17
  "name": "strata-poly-0.1.45-poly.9-linux-x64-cuda13.tar.gz",
18
18
  "url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/strata-poly/0.1.45-poly.9/strata-poly-0.1.45-poly.9-linux-x64-cuda13.tar.gz",
19
19
  "sha256": "d670d71cb3ecef513b7d54875aa5253a9949dd2e871a0adf0e4f642418e9302b",
20
- "size_bytes": 77879738
20
+ "size_bytes": 77879738,
21
+ "npm_copy": {
22
+ "package": "@simplexai/engine-strata-poly-0.1.45-poly.9-linux-x64-cuda13",
23
+ "version": "0.0.0-sha256-d670d71cb3ecef51"
24
+ }
21
25
  },
22
26
  {
23
27
  "name": "cudart-strata-poly-linux-x64-cuda13.0.3.tar.gz",
@@ -19,7 +19,11 @@
19
19
  "name": "whisper-bin-ubuntu-x64.tar.gz",
20
20
  "url": "https://github.com/ggml-org/whisper.cpp/releases/download/b5454/whisper-bin-ubuntu-x64.tar.gz",
21
21
  "sha256": "a72becf15d7917f990f6313867a52638b82b7f9ef237fb0c980dac56a135781c",
22
- "size_bytes": 10364195
22
+ "size_bytes": 10364195,
23
+ "npm_copy": {
24
+ "package": "@simplexai/engine-whisper-bin-ubuntu-x64",
25
+ "version": "0.0.0-sha256-a72becf15d7917f9"
26
+ }
23
27
  }
24
28
  ]
25
29
  }
@@ -18,7 +18,11 @@
18
18
  "name": "llama-b11370-bin-ubuntu-cuda-12.8-x64.tar.gz",
19
19
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-ubuntu-cuda-12.8-x64.tar.gz",
20
20
  "sha256": "047089347a554f06ada3d8036be8c74cba0e77add5188f31fd502303de5d272c",
21
- "size_bytes": 171364601
21
+ "size_bytes": 171364601,
22
+ "npm_copy": {
23
+ "package": "@simplexai/engine-llama-b11370-bin-ubuntu-cuda-12.8-x64",
24
+ "version": "0.0.0-sha256-047089347a554f06"
25
+ }
22
26
  },
23
27
  {
24
28
  "name": "cudart-llama-b11370-bin-ubuntu-cuda-12.8-x64.tar.gz",
@@ -65,7 +69,11 @@
65
69
  "name": "llama-b11370-bin-ubuntu-cuda-13.4-x64.tar.gz",
66
70
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-ubuntu-cuda-13.4-x64.tar.gz",
67
71
  "sha256": "81ced34431758b1d1932cf7eb99852598c76bec1885009f4519ad4f54bb0159b",
68
- "size_bytes": 152247644
72
+ "size_bytes": 152247644,
73
+ "npm_copy": {
74
+ "package": "@simplexai/engine-llama-b11370-bin-ubuntu-cuda-13.4-x64",
75
+ "version": "0.0.0-sha256-81ced34431758b1d"
76
+ }
69
77
  },
70
78
  {
71
79
  "name": "cudart-llama-b11370-bin-ubuntu-cuda-13.4-x64.tar.gz",
@@ -89,7 +97,11 @@
89
97
  "name": "llama-b11370-bin-ubuntu-cuda-13.4-arm64.tar.gz",
90
98
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-ubuntu-cuda-13.4-arm64.tar.gz",
91
99
  "sha256": "d417ce88799fb5bca9a51b53c36585fec9d7a8e7415873424919af0cb64d33e2",
92
- "size_bytes": 147493813
100
+ "size_bytes": 147493813,
101
+ "npm_copy": {
102
+ "package": "@simplexai/engine-llama-b11370-bin-ubuntu-cuda-13.4-arm64",
103
+ "version": "0.0.0-sha256-d417ce88799fb5bc"
104
+ }
93
105
  },
94
106
  {
95
107
  "name": "cudart-llama-b11370-bin-ubuntu-cuda-13.4-arm64.tar.gz",
@@ -111,7 +123,11 @@
111
123
  "name": "llama-b11370-bin-ubuntu-vulkan-x64.tar.gz",
112
124
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-ubuntu-vulkan-x64.tar.gz",
113
125
  "sha256": "46bb8add9cf46dee199692cf7852927758d7b2ad663949d81c8c80974032a398",
114
- "size_bytes": 31577653
126
+ "size_bytes": 31577653,
127
+ "npm_copy": {
128
+ "package": "@simplexai/engine-llama-b11370-bin-ubuntu-vulkan-x64",
129
+ "version": "0.0.0-sha256-46bb8add9cf46dee"
130
+ }
115
131
  }
116
132
  ]
117
133
  },
@@ -127,7 +143,11 @@
127
143
  "name": "llama-b11370-bin-ubuntu-vulkan-arm64.tar.gz",
128
144
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-ubuntu-vulkan-arm64.tar.gz",
129
145
  "sha256": "cb8ab033dd9565e0d82aa3b6c407527966661d8a1736ae083c417338025d4e9d",
130
- "size_bytes": 24820336
146
+ "size_bytes": 24820336,
147
+ "npm_copy": {
148
+ "package": "@simplexai/engine-llama-b11370-bin-ubuntu-vulkan-arm64",
149
+ "version": "0.0.0-sha256-cb8ab033dd9565e0"
150
+ }
131
151
  }
132
152
  ]
133
153
  },
@@ -159,7 +179,11 @@
159
179
  "name": "llama-b11370-bin-ubuntu-x64.tar.gz",
160
180
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-ubuntu-x64.tar.gz",
161
181
  "sha256": "1c86f91cb0e2bbf5bce7eae7c0ce6beb95137e41251b1dbb19839175d624d0cf",
162
- "size_bytes": 17634362
182
+ "size_bytes": 17634362,
183
+ "npm_copy": {
184
+ "package": "@simplexai/engine-llama-b11370-bin-ubuntu-x64",
185
+ "version": "0.0.0-sha256-1c86f91cb0e2bbf5"
186
+ }
163
187
  }
164
188
  ],
165
189
  "min_glibc": "2.34"
@@ -176,7 +200,11 @@
176
200
  "name": "llama-b11370-bin-ubuntu-arm64.tar.gz",
177
201
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-ubuntu-arm64.tar.gz",
178
202
  "sha256": "2589668b61f4b2a2baa1a860c45e3dbd75af89e3620340589929632d981d28f2",
179
- "size_bytes": 13661001
203
+ "size_bytes": 13661001,
204
+ "npm_copy": {
205
+ "package": "@simplexai/engine-llama-b11370-bin-ubuntu-arm64",
206
+ "version": "0.0.0-sha256-2589668b61f4b2a2"
207
+ }
180
208
  }
181
209
  ]
182
210
  },
@@ -189,7 +217,11 @@
189
217
  "name": "llama-b11370-bin-macos-arm64.tar.gz",
190
218
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-macos-arm64.tar.gz",
191
219
  "sha256": "9d7d074ca8db0c2233af760ca2ad89182a52c909abdcbfa3b94e27fb78de9355",
192
- "size_bytes": 11894187
220
+ "size_bytes": 11894187,
221
+ "npm_copy": {
222
+ "package": "@simplexai/engine-llama-b11370-bin-macos-arm64",
223
+ "version": "0.0.0-sha256-9d7d074ca8db0c22"
224
+ }
193
225
  }
194
226
  ]
195
227
  },
@@ -202,7 +234,11 @@
202
234
  "name": "llama-b11370-bin-macos-x64.tar.gz",
203
235
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-macos-x64.tar.gz",
204
236
  "sha256": "2bdcdc8936621840fc246198da8a7d4e87d2db58ae232c6126ee54b594be3746",
205
- "size_bytes": 11445204
237
+ "size_bytes": 11445204,
238
+ "npm_copy": {
239
+ "package": "@simplexai/engine-llama-b11370-bin-macos-x64",
240
+ "version": "0.0.0-sha256-2bdcdc8936621840"
241
+ }
206
242
  }
207
243
  ]
208
244
  },
@@ -238,7 +274,11 @@
238
274
  "name": "llama-b11370-bin-win-cuda-13.4-x64.zip",
239
275
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-win-cuda-13.4-x64.zip",
240
276
  "sha256": "05a1e951d7eb3fb32a8159b6f6dc06f5e8f681154b57369d585ae4100bae4999",
241
- "size_bytes": 152876036
277
+ "size_bytes": 152876036,
278
+ "npm_copy": {
279
+ "package": "@simplexai/engine-llama-b11370-bin-win-cuda-13.4-x64",
280
+ "version": "0.0.0-sha256-05a1e951d7eb3fb3"
281
+ }
242
282
  },
243
283
  {
244
284
  "name": "cudart-llama-bin-win-cuda-13.4-x64.zip",
@@ -258,7 +298,11 @@
258
298
  "name": "llama-b11370-bin-win-cpu-x64.zip",
259
299
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/llama-b11370-bin-win-cpu-x64.zip",
260
300
  "sha256": "e433a6b1592af1deedf001dcc1abc933e990be8dc94e5d28104c3c4406a1d35f",
261
- "size_bytes": 19333283
301
+ "size_bytes": 19333283,
302
+ "npm_copy": {
303
+ "package": "@simplexai/engine-llama-b11370-bin-win-cpu-x64",
304
+ "version": "0.0.0-sha256-e433a6b1592af1de"
305
+ }
262
306
  }
263
307
  ]
264
308
  }
@@ -18,7 +18,7 @@ import sys
18
18
  from collections.abc import Callable
19
19
  from pathlib import Path
20
20
 
21
- from localmodels import hosts
21
+ from localmodels import hosts, region
22
22
  from localmodels.component import front_venv, venv_python
23
23
  from localmodels.records import Plan
24
24
 
@@ -105,8 +105,11 @@ def install(
105
105
  [interpreter or sys.executable, "-m", "venv", "--without-pip", str(venv)],
106
106
  _installer(python, source),
107
107
  ]
108
+ env = region.pip_environment() # hash-locked; in cn a China index unless pip has its own
108
109
  for command in steps:
109
- result = subprocess.run(command, capture_output=True, text=True, timeout=1200, check=False)
110
+ result = subprocess.run(
111
+ command, capture_output=True, text=True, timeout=1200, check=False, env=env
112
+ )
110
113
  if result.returncode:
111
114
  raise FrontendError(
112
115
  f"{' '.join(command[:4])} failed: {(result.stderr or result.stdout).strip()[-400:]}"
@@ -81,7 +81,8 @@ def plan_tools(
81
81
  raise HarnessError("the tool lock has no Bifrost")
82
82
  build = harness.tool_build(lock["bifrost"]["builds"], platform, arch, "Bifrost")
83
83
  version = lock["bifrost"]["version"]
84
- binary = f"{tools_dir}/bifrost-{version}/bifrost-http"
84
+ # Windows starts only a file named .exe; the npm package and the CDN name it bifrost-http.
85
+ binary = f"{tools_dir}/bifrost-{version}/bifrost-http" + (".exe" if platform == "win32" else "")
85
86
  found = os.path.expanduser(binary)
86
87
  if os.path.lexists(found) and harness.digest(found) != build["sha256"]:
87
88
  raise HarnessError(f"{binary} is not the pinned Bifrost {version}; deal with it first")
@@ -95,7 +96,7 @@ def plan_tools(
95
96
  addr = state.get("bifrost_addr") or harness.bifrost_addr()
96
97
  listeners = set(state.get("bifrost_listeners", []))
97
98
  ours = hosts.load_owned(tools_dir)["gateway"].get("bifrost")
98
- if listeners - {os.getuid()}:
99
+ if listeners - {process_identity.current_uid()}:
99
100
  raise HarnessError(
100
101
  f"Bifrost address {addr} is held by another user's program; ask them to free it, or "
101
102
  "set LOCALMODELS_BIFROST_ADDR=127.0.0.1:<free port> in this terminal and plan again"
@@ -260,7 +261,7 @@ def owned_listener(record: hosts.OwnedBifrost) -> bool:
260
261
  ]
261
262
  return bool(
262
263
  before
263
- and before["uid"] == os.getuid()
264
+ and before["uid"] == process_identity.current_uid()
264
265
  and remote_ops_service.command_matches(pid, argv)
265
266
  and remote_ops_service.listener_problem(harness_gateway.address_port(addr), [pid])
266
267
  is None
@@ -371,17 +372,18 @@ def _start(record: hosts.OwnedBifrost, restart: bool) -> None:
371
372
  _stop_serve(app) # ours: restarted, or an earlier instance that stopped answering
372
373
  host, _, port = addr.rpartition(":")
373
374
  env = {**os.environ, "NO_PROXY": "127.0.0.1,localhost", "no_proxy": "127.0.0.1,localhost"}
375
+ options: dict[str, Any] = {"cwd": app, "env": env, "stdin": subprocess.DEVNULL}
376
+ if os.name != "nt":
377
+ options["umask"] = 0o077 # its SQLite stores and log stay private
374
378
  with (app / "bifrost.log").open("ab") as log:
375
- proc = subprocess.Popen( # noqa: S603 - the pinned binary at its owned path
379
+ # Its own session; on Windows also no console, out of the starting job (a scheduled
380
+ # task ends its job's processes), at normal priority, as every service this tool runs.
381
+ proc = process_identity.spawn_detached(
376
382
  [record["binary"], "-app-dir", str(app), "-host", host, "-port", port]
377
383
  + ["-log-style", "json", "-log-level", "warn"],
378
- cwd=app,
379
- env=env,
380
- stdin=subprocess.DEVNULL,
381
384
  stdout=log,
382
385
  stderr=log,
383
- start_new_session=True,
384
- umask=0o077, # its SQLite stores and log stay private
386
+ **options,
385
387
  )
386
388
  try:
387
389
  process_identity.save(app / "bifrost.pid", proc.pid)
@@ -86,8 +86,10 @@ def choose_kind(
86
86
  if choice == "magpie":
87
87
  return choice
88
88
  platform, arch = runtime_cli._platform().split("-", 1)
89
- available = any(
90
- b["platform"] == ("windows" if platform == "win32" else platform) and b["arch"] == arch
89
+ # Windows keeps Magpie (decisions 32 and 48): its Bifrost build (since localmodels.6) serves
90
+ # the model library, whose own gateway is a different instance; this one is not verified there.
91
+ available = platform != "win32" and any(
92
+ b["platform"] == platform and b["arch"] == arch
91
93
  for b in harness.load_lock()["bifrost"]["builds"]
92
94
  )
93
95
  if choice == "auto" and (not available or runtime is None):
@@ -15,7 +15,7 @@ import sys
15
15
  from pathlib import Path
16
16
  from typing import Literal, TypedDict
17
17
 
18
- from localmodels import cli_help, http_local, probe
18
+ from localmodels import cli_help, http_local, probe, region
19
19
  from localmodels.catalog import ComponentRecipe, component_recipe
20
20
  from localmodels.contracts import decode
21
21
  from localmodels.privacy import PrivacyError, PrivacySession, Span, parse_spans, strict_json
@@ -148,7 +148,9 @@ def _check_tree(directory: Path) -> None:
148
148
 
149
149
 
150
150
  def _run(command: list[str], *, timeout: int) -> None:
151
- result = subprocess.run(command, capture_output=True, timeout=timeout, check=False)
151
+ result = subprocess.run(
152
+ command, capture_output=True, timeout=timeout, check=False, env=region.pip_environment()
153
+ )
152
154
  if result.returncode:
153
155
  raise PrivacyError("CPU runtime setup failed; rerun the same approved plan")
154
156
 
@@ -231,14 +233,19 @@ def _download(directory: Path, recipe: ComponentRecipe) -> None:
231
233
  or _sha(target) != item["sha256"]
232
234
  ):
233
235
  marker.unlink()
234
- fetch(
235
- f"https://huggingface.co/{recipe['repo']}/resolve/{recipe['revision']}/{path}",
236
+ switch = fetch(
237
+ f"{region.HF_API}/{recipe['repo']}/resolve/{recipe['revision']}/{path}",
236
238
  str(target),
237
239
  str(item["sha256"]),
238
240
  int(str(item["size_bytes"])),
239
241
  path,
242
+ None,
243
+ where,
240
244
  )
245
+ if switch:
246
+ region.fallback_to(switch)
241
247
 
248
+ where = region.current_region()
242
249
  with concurrent.futures.ThreadPoolExecutor(max_workers=6) as pool:
243
250
  list(pool.map(download, [dict(item) for item in recipe["files"]]))
244
251
 
@@ -346,8 +353,10 @@ def _prepare_parsers(commands: argparse._SubParsersAction[argparse.ArgumentParse
346
353
  cli_help.document(
347
354
  command,
348
355
  "Prepare the plan's directory: copy the worker and its runtime lock, download the pinned "
349
- "model files from huggingface.co with size and SHA256 checks, create a venv with this "
350
- "Python and pip install the hash-locked CPU wheels, then verify every file. Refuses "
356
+ "model files from huggingface.co (hf-mirror.com first in region cn) with size and SHA256 "
357
+ "checks, create a venv with this Python and pip install the hash-locked CPU wheels (from "
358
+ "a China PyPI mirror in region cn unless pip has an index of its own), then verify every "
359
+ "file. Refuses "
351
360
  "unless --approve equals the plan's plan_id and a plan built now (same Python, same "
352
361
  "package) is identical, the directory is empty or marked as this recipe's, and free disk "
353
362
  "and available RAM leave headroom. Prints a short JSON result; after an interruption "