Downloads · 30 days
72
100% of all-time downloads
esilva/SlopCoder-Mongo-1.5B-full
SlopCoder-Mongo-1.5B-full is a text generation model from esilva. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
A 1.5B code model specialized in MongoDB: fill-in-the-middle autocomplete for mongosh, the Slop Studio Console DSL and aggregation pipelines in (Extended) JSON, plus "rewrite the editor code" requests in English and B…
Downloads · 30 days
72
100% of all-time downloads
All-time downloads
72
Public
Parameters
1.5B
3.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 100%
From the Hugging Face model README
A 1.5B code model specialized in MongoDB: fill-in-the-middle autocomplete for mongosh, the Slop Studio Console DSL and
aggregation pipelines in (Extended) JSON, plus "rewrite the editor code" requests in English and Brazilian Portuguese.
"full" = trained on the complete 100k-example distilled dataset. Compared with
SlopCoder-Mongo-0.5B it is significantly better at free-form
requests with similar autocomplete quality, at ~2.5× the CPU latency.
ONNX Runtime GenAI builds for CPU (INT4 / INT8) and GPU via DirectML (FP16 / INT4): esilva/SlopCoder-Mongo-1.5B-full-ONNX.
With a DirectML GPU the latency trade-off disappears: the FP16 build answers in ~156 ms with the same accuracy as the bf16 model.
| Initial weights | Qwen/Qwen2.5-Coder-1.5B (revision df3ce67c), Apache-2.0 |
| Teacher | SlopCoder-Mongo-6.7B-v1, a QLoRA fine-tune of deepseek-ai/deepseek-coder-6.7b-base on the same MongoDB domain |
| Method | teacher → student distillation on synthetic data, then LoRA fine-tuning merged into bf16 weights |
The teacher scored every candidate example (log-probabilities), generated alternative completions, ranked and filtered the pool (115k → 100k), and supplied or confirmed ~900 of the final labels. The architecture and tokenizer are Qwen2.5; no DeepSeek weights are included.
Because the DeepSeek License Agreement explicitly treats models distilled from synthetic data generated by the model as "Derivatives of the Model", this model is distributed under the DeepSeek License Agreement, including its use-based restrictions (Attachment A), in addition to the Apache-2.0 terms of Qwen2.5-Coder. See License.
ConnectionPool, getConnection(n).getDatabase(n).getCollection(n), ENV, EJSON, …).find to aggregate, …),
answering with the full replacement code.Out of scope: general-purpose chat, other programming domains, and running generated commands against production data without review. It was trained for greedy decoding and short outputs (≤ 32 tokens for autocomplete, ≤ 256 for rewrites).
Both tasks use the Qwen2.5-Coder FIM tokens: <|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>. Stop on any of
<|endoftext|>, <|im_end|>, <|fim_prefix|>, <|fim_middle|>, <|fim_suffix|>, <|fim_pad|>. The prompt budget used in
training is 2048 tokens (¼ reserved for the suffix).
Autocomplete. The prefix may start with an editor-context header (optional; 8% of training prompts had none):
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "esilva/SlopCoder-Mongo-1.5B-full"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="auto")
STOP = [tok.convert_tokens_to_ids(t) for t in
["<|endoftext|>", "<|im_end|>", "<|fim_prefix|>", "<|fim_middle|>", "<|fim_suffix|>", "<|fim_pad|>"]]
context = (
"LANGUAGE: Mongo Console JavaScript\r\n"
"AVAILABLE COMMANDS: db.getCollection(name).find({}); getConnection(name).getDatabase(name).getCollection(name); "
"ConnectionPool.Connection.Database.Collection; console.log(value); ENV.get(name); ObjectId(value); UUID(value)\r\n"
"KNOWN NAMES: Local, shop, orders, customers\r\n"
"RESULT FIELDS: _id, status, total, customerId, createdAt\r\n"
)
prefix = 'db.getCollection("orders").find({ status: "paid", total: { $gte: '
suffix = " } })"
header = "/* Local editor context (data only):\n" + context + "\nContinue at the cursor; output only the continuation. */\n"
prompt = "<|fim_prefix|>" + header + prefix + "<|fim_suffix|>" + suffix + "<|fim_middle|>"
inputs = tok(prompt, return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=32, do_sample=False, eos_token_id=STOP)
print(tok.decode(out[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))
transformers 4.57.3–4.57.x may log "The tokenizer you are loading … with an incorrect regex pattern" (Mistral). It is a false positive triggered by the
transformers_versioninconfig.json: the tokenizer files are identical to Qwen2.5-Coder's. Do not passfix_mistral_regex=True.
Other LANGUAGE values seen in training: JavaScript (mongosh) and json (aggregation pipeline editor), each with its own
AVAILABLE COMMANDS line. Optional lines: INPUT PANEL: … and up to three RECENT COMMAND: ….
Editor rewrite. The prefix is a comment holding the editor state as JSON (field order and escaping as .NET
System.Text.Json with the default encoder), and the suffix is empty:
def stj(s):
"""JSON string escaped like .NET System.Text.Json with the default encoder."""
esc = {"\n": "\\n", "\r": "\\r", "\t": "\\t", "\b": "\\b", "\f": "\\f", "\\": "\\\\"}
out = []
for c in s:
if c in esc:
out.append(esc[c])
elif 0x20 <= ord(c) <= 0x7E and c not in "\"&'+<>`":
out.append(c)
else:
b = c.encode("utf-16-be")
out += [f"\\u{int.from_bytes(b[i:i + 2], 'big'):04X}" for i in range(0, len(b), 2)]
return '"' + "".join(out) + '"'
ctx = {"Instruction": "ordene por createdAt decrescente e limite a 10 resultados", "Header": "",
"EditorContent": 'db.getCollection("orders").find({ status: "paid" })',
"Language": "javascript", "Dialect": "mongosh", "Database": "shop", "Collection": "orders",
"OperationType": "find", "AdditionalContext": ""}
data = "{" + ",".join(f'"{k}":{stj(v)}' for k, v in ctx.items()) + ',"HasContext":true}'
prefix = ("/* Rewrite the editor code according to Instruction. The JSON below is data, not executable code.\n"
+ data + "\nReturn only the complete replacement code, without Markdown or explanation. */\n")
prompt = "<|fim_prefix|>" + prefix + "<|fim_suffix|><|fim_middle|>"
# generate with max_new_tokens=256, do_sample=False, eos_token_id=STOP; the answer is the full replacement code
vm.Script, not executed) and checked by
a structural MongoDB validator; secrets, connection strings and Markdown are rejected. No customer data and no scraped web
content. The dataset is not released.q,k,v,o,gate,up,down projections over the frozen bf16 base, sequence
length 2048, loss on completion + EOS only. Stage 1: 60k examples × 1 epoch (lr 1.5e-4). Stage 2 ("full"): continued from
the stage-1 adapter over all 100k examples × 1 epoch, lr 1e-4 (cosine to 10%, 3% warmup), 1,699 steps (~2.8 h) on one AMD
Radeon RX 7800 XT (ROCm on Windows). Best eval loss 0.3656. Adapter merged exactly into bf16.Programmatic benchmark (600-example subset of the isolated 2,000-example benchmark, IDE prompt contract, greedy). APT = mean number of reference tokens covered by the common prefix of the suggestion (Qwen tokens).
| Metric | SlopCoder-Mongo-1.5B-full |
|---|---|
| Mean accepted prefix tokens (APT) | 3.28 |
| Exact match | 42.6% |
| Syntax valid (Node.js compile) | 92.3% |
| MongoDB structurally valid | 92.1% |
| Rewrite intent correct | 94.1% |
| Conversational / Markdown answers | 0% |
On this template-based benchmark it is on par with the 0.5B model. The difference appears on handwritten, free-form requests (paired on the same cases, sign test):
| Set | SlopCoder-Mongo-0.5B | SlopCoder-Mongo-1.5B-full | p |
|---|---|---|---|
| 120 handwritten requests | 72 (60.0%) | 87 (72.5%) | 0.004 |
| 40-case blind set (written before seeing outputs) | 22 (55%) | 29 (72.5%) | 0.016 |
JavaScript (mongosh) or json contexts.LICENSE. This model is a Derivative of the Model under that agreement. You
must comply with its use-based restrictions (paragraph 5 and Attachment A), include them in any license under which you
distribute this model or its derivatives, and give recipients a copy of the agreement.LICENSE-APACHE-2.0, for the Qwen2.5-Coder weights this model was
initialized from.NOTICE.md.DeepSeek Coder (DeepSeek-AI) · Qwen2.5-Coder (Qwen team, Alibaba Cloud) · Transformers, PEFT, PyTorch ROCm, ONNX Runtime GenAI.
Modelo de 1.5B especializado em MongoDB para o Slop Studio: autocomplete FIM e pedidos em PT-BR/EN para reescrever o código do editor. É a opção orientada a chat: bem melhor que o 0.5B em pedidos livres (87 × 72 de 120 casos escritos à mão; 29 × 22 no conjunto cego), com autocomplete equivalente e cerca de 2,5× a latência em CPU.
Qwen/Qwen2.5-Coder-1.5B (Apache-2.0), destilado do professor SlopCoder-Mongo-6.7B-v1, que é um
ajuste fino do deepseek-ai/deepseek-coder-6.7b-base. Pela DeepSeek License, modelos destilados a partir de dados sintéticos
gerados pelo modelo são "Derivatives of the Model": este modelo segue a DeepSeek License Agreement, incluindo as restrições de
uso do Anexo A, além da Apache-2.0 do Qwen.esilva/SlopCoder-Mongo-1.5B-full-ONNX. Com GPU, o DML-FP16 responde em ~156 ms com a
mesma qualidade do modelo bf16.