Views
No views yet
mlc-chat-config.json.
Because the model uses the standard Qwen2 architecture with q4f16_1
quantization, the pre-built wasm library shipped by @mlc-ai/web-llm works
out of the box — no custom compile step is needed.1import { CreateMLCEngine, prebuiltAppConfig } from "@mlc-ai/web-llm";
2
3const engine = await CreateMLCEngine("xpol555/sm-coder-mlc", {
4 appConfig: {
5 ...prebuiltAppConfig,
6 model_list: [
7 ...prebuiltAppConfig.model_list,
8 {
9 model: "https://huggingface.co/xpol555/sm-coder-mlc/resolve/main/weights/",
10 model_id: "xpol555/sm-coder-mlc",
11 model_lib:
12 prebuiltAppConfig.model_list.find(
13 (m) => m.model_id === "Qwen2.5-1.5B-Instruct-q4f16_1-MLC"
14 )!.model_lib,
15 },
16 ],
17 },
18});
19
20const reply = await engine.chat.completions.create({
21 messages: [{ role: "user", content: "Write an SM macro to draw error bars" }],
22});
23console.log(reply.choices[0].message.content);$1 $2 …
parameters, set for vectors, define for scalars):draw_circle 4 ## draw a circle centred at ($1,$2) radius $3 with $4 points
set _th = 2*PI*indgen($4)/$4
set _cx = $1 + $3*COS(_th)
set _cy = $2 + $3*SIN(_th)
connect _cx _cyquickplot 1 ## read two-column file $1, auto-scale, and plot
data $1
read {x 1 y 2}
limits x y
erase
box
connect x y
xlabel Column 1
ylabel Column 2