🌟 Model Overview
Lensetek-IoT-Coder-3B is the canonical 16-bit BF16 (Safetensors) repository of Lensetek's specialized 3B IoT engineering model, fine-tuned from Qwen/Qwen2.5-Coder-3B-Instruct.
This 5.76 GB full-precision release is built for GPU serving (vLLM, transformers, SGLang), Apple Silicon MLX conversion, custom quantization (Q2_K–Q8_0), or downstream LoRA/GRPO adaptation on proprietary hardware & sensor libraries.
✨ Key Capabilities & Advantages
- 8 Full-Stack IoT Domains: Arduino/ESP32/ESP8266/Pi Pico firmware (
millis() non-blocking), sensor filtering & calibration, pyserial / MQTT LWT / Modbus RS-485 protocols, hysteresis & failsafe actuator control, FastAPI + SQLite + WebSocket backends, mobile-view first interactive dashboards, hardware pinout debugging, and credential safety (secrets.h + .env).
- 4-Format Circuit & System Diagram Export:
- Wokwi (
diagram.json) — Validated against VCC–GND short circuits.
- WireViz (
.yml) — Pin-to-pin wiring harnesses with wire colors & connector specs.
- Schemdraw & SKiDL → KiCad (Python) — Vector schematics and
.net KiCad netlists.
- Mermaid — System architecture & telemetry flow diagrams.
- Hardware-Safe Engineering Defaults: Avoids ESP32 input-only pin traps (
GPIO 34, 35, 36, 39 as OUTPUT), notes 3.3V vs 5V logic levels, and enforces zero hardcoded secrets in client-side code.
⚖️ Comparison with Other Models
Table with columns: Dimension, Lensetek-IoT-Coder-3B (BF16), Stock Qwen2.5-Coder-3B-Instruct, Lensetek-Edge-Loop-3B (Companion), Larger Local Models (7B–14B), Cloud Frontier LLMs| Dimension | Lensetek-IoT-Coder-3B (BF16) | Stock Qwen2.5-Coder-3B-Instruct | Lensetek-Edge-Loop-3B (Companion) | Larger Local Models (7B–14B) | Cloud Frontier LLMs |
|---|
| Precision & Size | 5.76 GB BF16 (or 1.80 GB Q4_K_M) | ~6 GB BF16 | ~6 GB BF16 | 14–28 GB BF16 | Cloud-only |
| Core Focus | IoT firmware, serial/MQTT, mobile UI & 4 diagram formats | General coding | Air-gapped industrial RAG & tool loops | General coding & reasoning | General frontier tasks |
| IoT Diagram & Pin Safety | Explicitly trained & verified | Generic / occasional pin errors | Focused on operational tool JSON | Needs careful prompting | Strong, requires internet |
| Bilingual ID + EN IoT Support | Native technical Indonesian + English | Mostly English | Native Indonesian industrial SOP | Mostly English | Excellent, paid API |
📊 Live Benchmark (v1 vs Stock Qwen2.5-Coder-3B-Instruct on 16 Held-Out Scenarios)
Table with columns: Metric, Stock Qwen2.5-Coder-3B-Instruct (Q4_K_M), Lensetek-IoT-Coder-3B v1 (Q4_K_M), Delta| Metric | Stock Qwen2.5-Coder-3B-Instruct (Q4_K_M) | Lensetek-IoT-Coder-3B v1 (Q4_K_M) | Delta |
|---|
| Overall Pass Rate (n=16) | 43.75% | 81.25% | +37.50% |
| Python AST Validity (n=10) | 66.67% | 100.0% | +33.33% |
| Arduino & ESP32 Pin Safety (n=8) | 37.5% | 87.5% | +50.00% |
| Diagram Export Validity (n=4) | 33.33% | 50.0% | +16.67% |
| Credential Safety (n=16) | 100.0% | 100.0% | — |
| 16-Sample CPU Runtime | ~26 min | ~5.3 min | ~5× faster |
v2 Roadmap: Expand WireViz YAML & multi-diagram training via open-weights teacher distillation, eliminate remaining C++ brace mismatches, enable post-SFT GRPO RLVR, and run full 300-sample GPU evaluation.
🎯 Use Cases
- High-Throughput IoT Dev Assistant API via
vLLM for engineering teams and university labs.
- Custom Quantization & Edge Deployment to GGUF (
Q4_K_M / Q8_0), AWQ, or Apple Silicon MLX.
- Domain Continual Fine-Tuning (LoRA / GRPO) for proprietary PLCs, custom PCB pinouts, or company-specific sensor SDKs.
- Automated Hardware Prototyping Pipelines pairing firmware generation with Wokwi simulation & WireViz/KiCad export.
import torchfrom transformers import AutoModelForCausalLM, AutoTokenizer model_id = "lensetek/lensetek-iot-coder-3b" tokenizer = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained( model_id, torch_dtype=torch.bfloat16, device_map="auto",) messages = [ { "role": "user", "content": ( "Buatkan skrip Python pyserial auto-detect port dan dashboard HTML " "mobile-view first untuk menampilkan suhu sensor real-time." ), }] inputs = tokenizer.apply_chat_template( messages, return_tensors="pt", add_generation_prompt=True).to(model.device) outputs = model.generate(inputs, max_new_tokens=1024, temperature=0.2)print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
2. High-Throughput Serving (vLLM)
vllm serve lensetek/lensetek-iot-coder-3b --dtype bfloat16 --max-model-len 4096
3. Self-Conversion Options
🇮🇩 Bahasa Indonesia
🌟 Ringkasan Model
Lensetek-IoT-Coder-3B adalah repositori bobot 16-bit BF16 (Safetensors, 5.76 GB) dari model spesialis IoT & Embedded Systems 3B milik Lensetek berbasis Qwen/Qwen2.5-Coder-3B-Instruct.
Versi 16-bit ini ditujukan untuk deployment GPU (vLLM, transformers), konversi ke Apple Silicon MLX / kuantisasi kustom, maupun fine-tuning LoRA/GRPO lanjutan untuk modul sensor atau board khusus perusahaan/kampus Anda.
Butuh versi ringan siap jalan di laptop CPU atau Ollama?
Gunakan repo lensetek/lensetek-iot-coder-3b-GGUF (1.80 GB, format Q4_K_M).
🛠️ Detail Pelatihan
- Base Model:
Qwen/Qwen2.5-Coder-3B-Instruct
- Metode: Unsloth 4-bit QLoRA (
r=32, alpha=32, max_seq_length=4096, lr=8e-5, 2 epoch, bf16 pada GPU L4) dengan train_on_responses_only.
- Dataset: 1.399 sampel terverifikasi (
iot_coder_train.jsonl) gabungan dataset publik Hugging Face (freertos_esp32, kicad-netlist-sft-dataset, arduino-docs, OpenCodeInstruct, mascarade-platformio-dataset, mascarade-iot-dataset) dan skenario IoT terstruktur, yang semuanya lolos filter deterministik (AST Python, keamanan pin ESP32 GPIO 34–39, anti-short-circuit Wokwi, WireViz, Mermaid, mobile-first HTML, dan anti-kebocoran kredensial), beserta 300 sampel evaluasi held-out.