Instructions to use xpol555/sm-coder-mlc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLC-LLM
How to use xpol555/sm-coder-mlc with MLC-LLM:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
| language: | |
| - en | |
| license: apache-2.0 | |
| base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct | |
| base_model_relation: quantized | |
| tags: | |
| - supermongo | |
| - astronomy | |
| - code-generation | |
| - scientific-plotting | |
| - webllm | |
| pipeline_tag: text-generation | |
| library_name: mlc-llm | |
| # 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](https://github.com/mlc-ai/web-llm). | |
| Use it for free [here](https://huggingface.co/spaces/xpol555/supermongo-ai-webllm)! | |
| ## 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. | |
| ```ts | |
| 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](https://huggingface.co/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> | |