Skip to content

Commit 48ec3b4

Browse files
Adds support to Docker Model Runner (#1555)
Adds support to run models in GGUF format via [Docker Model Runner](https://docs.docker.com/ai/model-runner/) --------- Co-authored-by: vb <[email protected]>
1 parent 351580f commit 48ec3b4

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

packages/tasks/src/local-apps.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,16 @@ curl -X POST "http://localhost:8000/v1/chat/completions" \\
113113
]
114114
}'`);
115115
});
116+
117+
it("docker model runner", async () => {
118+
const { snippet: snippetFunc } = LOCAL_APPS["docker-model-runner"];
119+
const model: ModelData = {
120+
id: "bartowski/Llama-3.2-3B-Instruct-GGUF",
121+
tags: ["conversational"],
122+
inference: "",
123+
};
124+
const snippet = snippetFunc(model);
125+
126+
expect(snippet).toEqual(`docker model run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`);
127+
});
116128
});

packages/tasks/src/local-apps.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ const snippetMlxLm = (model: ModelData): LocalAppSnippet[] => {
297297
];
298298
};
299299

300+
const snippetDockerModelRunner = (model: ModelData, filepath?: string): string => {
301+
return `docker model run hf.co/${model.id}${getQuantTag(filepath)}`;
302+
};
303+
300304
/**
301305
* Add your new local app here.
302306
*
@@ -467,6 +471,13 @@ export const LOCAL_APPS = {
467471
displayOnModelPage: isLlamaCppGgufModel,
468472
snippet: snippetOllama,
469473
},
474+
"docker-model-runner": {
475+
prettyLabel: "Docker Model Runner",
476+
docsUrl: "https://docs.docker.com/ai/model-runner/",
477+
mainTask: "text-generation",
478+
displayOnModelPage: isLlamaCppGgufModel,
479+
snippet: snippetDockerModelRunner,
480+
},
470481
} satisfies Record<string, LocalApp>;
471482

472483
export type LocalAppKey = keyof typeof LOCAL_APPS;

0 commit comments

Comments
 (0)