Instructions to use lensetek/lensetek-iot-coder-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lensetek/lensetek-iot-coder-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lensetek/lensetek-iot-coder-3b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lensetek/lensetek-iot-coder-3b") model = AutoModelForCausalLM.from_pretrained("lensetek/lensetek-iot-coder-3b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lensetek/lensetek-iot-coder-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lensetek/lensetek-iot-coder-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lensetek/lensetek-iot-coder-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lensetek/lensetek-iot-coder-3b
- SGLang
How to use lensetek/lensetek-iot-coder-3b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "lensetek/lensetek-iot-coder-3b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lensetek/lensetek-iot-coder-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "lensetek/lensetek-iot-coder-3b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lensetek/lensetek-iot-coder-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lensetek/lensetek-iot-coder-3b with Docker Model Runner:
docker model run hf.co/lensetek/lensetek-iot-coder-3b
๐ฌ Lensetek-IoT-Coder-3B (16-Bit BF16 Safetensors)
Full-Precision 16-Bit Open-Weights 3B Small Language Model (SLM) for Full-Stack IoT Coding, Embedded Firmware & Circuit Diagram Export
๐ Language Navigation / Navigasi Bahasa: English โข Bahasa Indonesia
๐ Official Lensetek Model Ecosystem / Ekosistem Model Lensetek
| Repository | Role & Specialization | Format & Target Hardware | Direct Link |
|---|---|---|---|
โก lensetek-iot-coder-3b-GGUF |
IoT Coder 4-Bit GGUF (Ready-to-Run) Ready for Ollama, llama.cpp, and local CPUs (< 2.5 GB RAM). |
4-Bit Q4_K_M GGUF (1.80 GB)Runs on CPU / Mini PC / Laptop |
โฌ๏ธ Download GGUF โข Repo |
๐ฌ lensetek-iot-coder-3b (Current Repo) |
IoT Coder Base 16-Bit (Safetensors) Full-precision BF16 weights for vLLM, Transformers, MLX conversion & LoRA fine-tuning. |
16-Bit BF16 Safetensors (5.76 GB) GPU Inference / Cloud Fine-Tuning |
Inspect Files |
๐ง lensetek-edge-loop-3b-GGUF |
Companion: Edge Agentic Loop (GGUF) Air-gapped industrial agent with System-2 compute loop, multi-turn error recovery & zero-hallucination RAG. |
4-Bit Q4_K_M GGUF (~1.93 GB)Runs on Mini PC / SBC / CPU (< 2.5 GB RAM) |
Explore GGUF |
๐งฌ lensetek-edge-loop-3b |
Companion: Edge-Loop Base 16-Bit Full-precision base weights of the Lensetek-Edge-Loop-3B agentic model. |
16-Bit BF16 Safetensors GPU / Research / Fine-Tuning |
Inspect Repo |
๐ ๏ธ lensetek-edge-ai-agent |
Application Hub & Edge Studio Air-gapped local AI workspace with Web UI, SQLite RAG, and edge agent harnesses. |
Full Application Suite Local PC / Edge Node |
Explore Code Hub |
Looking for the lightweight 1.80 GB version for Ollama,
llama.cpp, or CPU-only laptops?
Download the quantized build here:lensetek/lensetek-iot-coder-3b-GGUF.
๐ฌ๐ง English
๐ 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
.netKiCad netlists. - Mermaid โ System architecture & telemetry flow diagrams.
- Wokwi (
- Hardware-Safe Engineering Defaults: Avoids ESP32 input-only pin traps (
GPIO 34, 35, 36, 39asOUTPUT), notes 3.3V vs 5V logic levels, and enforces zero hardcoded secrets in client-side code.
โ๏ธ Comparison with Other Models
| 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 |
๐ฏ Use Cases
- High-Throughput IoT Dev Assistant API via
vLLMfor 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.
๐ Quickstart (transformers & vLLM)
1. Hugging Face transformers
import torch
from 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
| Target Format | Command / Link |
|---|---|
| Ready-to-Run 4-Bit GGUF | Download from lensetek/lensetek-iot-coder-3b-GGUF |
Apple Silicon (MLX 4-bit) |
mlx_lm.convert --hf-path lensetek/lensetek-iot-coder-3b -q |
Custom GGUF (Q2_KโQ8_0) |
ggml-org/gguf-my-repo |
๐ฎ๐ฉ 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 repolensetek/lensetek-iot-coder-3b-GGUF(1.80 GB, formatQ4_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,bf16pada GPU L4) dengantrain_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 ESP32GPIO 34โ39, anti-short-circuit Wokwi, WireViz, Mermaid, mobile-first HTML, dan anti-kebocoran kredensial), beserta 300 sampel evaluasi held-out.
- Downloads last month
- -