fix stuff

This commit is contained in:
2026-09-05 10:33:25 +02:00
parent 16b7a69d52
commit 444c98a761
5 changed files with 51 additions and 26 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import {exec} from "child_process";
import {execFile} from "child_process";
class ModelServiceError extends Error {
constructor(code, message, status = 500) {
@@ -29,7 +29,7 @@ export function createModelService(config, overrides = {}) {
if (state.timer) clearTimeout(state.timer);
state.timer = setTimeout(() => {
if (state.activeRequests > 0) return;
exec(`ollama stop ${model}`, () => {
execFile("ollama", ["stop", model], () => {
modelState.delete(model);
});
}, config.modelUnloadAfterMs);