pi-llama-switch 1.0.0 → 1.0.1
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.
- package/README.md +4 -4
- package/package.json +1 -1
- package/src/switcher.ts +4 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
5
|
<!-- Add a cover image: docs/cover.png -->
|
|
6
|
-
Restart local LLM servers with different model configurations. For single-model setups where each model needs different flags
|
|
6
|
+
Restart local LLM servers with different model configurations. For single-model setups where each model needs different flags: context size, vision projector, sampling params, GPU offload. Works with [llama.cpp](https://github.com/ggml-org/llama.cpp) and [vLLM](https://github.com/vllm-project/vllm) (experimental).
|
|
7
7
|
|
|
8
8
|
[](https://www.npmjs.com/package/pi-llama-switch)
|
|
9
9
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -27,9 +27,9 @@ You have a single GPU and multiple local models, but each model needs different
|
|
|
27
27
|
|
|
28
28
|
**Common setups:**
|
|
29
29
|
|
|
30
|
-
- **Coding vs general-purpose:** Qwen3.6 for code (small context, fast) and Gemma 4 for general tasks (vision, larger context) -- each
|
|
31
|
-
- **Fast vs powerful:** A
|
|
32
|
-
- **Text vs multimodal:** A text-only model for coding and a vision model for image analysis --
|
|
30
|
+
- **Coding vs general-purpose:** Qwen3.6 for code (small context, fast) and Gemma 4 for general tasks (vision, larger context) -- each with different `--ctx-size` and `--mmproj` flags.
|
|
31
|
+
- **Fast vs powerful:** A smaller model for quick tasks and a large one for complex reasoning -- small model loads in seconds, large one needs more time and VRAM.
|
|
32
|
+
- **Text vs multimodal:** A text-only model for coding and a vision model for image analysis -- vision model needs `--mmproj`, which adds VRAM overhead.
|
|
33
33
|
|
|
34
34
|
If you only run one model at a time and don't change server flags between models, you don't need this extension.
|
|
35
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-llama-switch",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Restart llama-server with different model configurations. For single-model setups where models need different flags (context size, vision projector, sampling params).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi",
|
package/src/switcher.ts
CHANGED
|
@@ -207,6 +207,10 @@ export async function switchModel(
|
|
|
207
207
|
progress?.onStatusUpdate?.(`Starting ${model.name}...`);
|
|
208
208
|
const logPath = getLogPath();
|
|
209
209
|
const logStream = createWriteStream(logPath, { flags: "w" });
|
|
210
|
+
await new Promise<void>((resolve, reject) => {
|
|
211
|
+
logStream.on("open", () => resolve());
|
|
212
|
+
logStream.on("error", reject);
|
|
213
|
+
});
|
|
210
214
|
child = spawn(model.command[0], model.command.slice(1), {
|
|
211
215
|
detached: true,
|
|
212
216
|
stdio: ["ignore", "ignore", logStream],
|