SM Coder 1.5B β MLC (WebLLM)
A fine-tuned coding assistant for SuperMongo (SM) macro development, quantized to q4f16_1 for browser inference via WebLLM.
Use it for free here!
Usage with WebLLM
This repo contains only the quantized weights and 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.
import { CreateMLCEngine, prebuiltAppConfig } from "@mlc-ai/web-llm";
const engine = await CreateMLCEngine("xpol555/sm-coder-mlc", {
appConfig: {
...prebuiltAppConfig,
model_list: [
...prebuiltAppConfig.model_list,
{
model: "https://huggingface.co/xpol555/sm-coder-mlc/resolve/main/weights/",
model_id: "xpol555/sm-coder-mlc",
model_lib:
prebuiltAppConfig.model_list.find(
(m) => m.model_id === "Qwen2.5-1.5B-Instruct-q4f16_1-MLC"
)!.model_lib,
},
],
},
});
const reply = await engine.chat.completions.create({
messages: [{ role: "user", content: "Write an SM macro to draw error bars" }],
});
console.log(reply.choices[0].message.content);
Base Model
Qwen/Qwen2.5-Coder-1.5B-Instruct, fine-tuned on a curated dataset of SM macros and related examples collected over ~20 years of real scientific usage.
What Is SuperMongo
SuperMongo is a plotting and data-analysis environment widely used in astronomy and scientific workflows.
Reference: https://www.astro.princeton.edu/~rhl/sm/
Intended Use
- Writing and refactoring SuperMongo macros.
- Translating plotting requests into SM macro skeletons.
- Helping document and modernize legacy macro collections.
Limitations
- Not a general-purpose chatbot.
- Not an authoritative source on non-SM domains.
- Always validate generated macros against your SM version and local macro library before use.
Example Output
The model produces macros in standard SM syntax (positional $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 _cy
quickplot 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
Other Formats
- GGUF (Ollama / llama.cpp): https://huggingface.co/xpol555/sm-coder-gguf
- Downloads last month
- -
Model tree for xpol555/sm-coder-mlc
Base model
Qwen/Qwen2.5-1.5B