EmbeddieCoder AI (1.5B)

Universal Embedded Systems Engineering Small Language Model

License GitHub Base Model

EmbeddieCoder AI is an offline-first, domain-specialized Small Language Model (SLM) for embedded systems engineering, firmware architecture, real-time operating systems (RTOS), industrial communication protocols, and hardware diagnostic triage.


1. Core Engineering Principle

"Train general engineering capabilities, retrieve detailed technical documentation, and use deterministic tools to verify results."

Rather than hallucinating volatile registers or complex polynomial checksums, EmbeddieCoder AI combines domain-adapted weights with:

  1. Deterministic Protocol Decoders: Modbus RTU/TCP, SAE J1939, OBD-II, and AIS-140 telematics.
  2. Deterministic Sandboxed Verification: Sandboxed GCC 16.2.0 compilation with -Wall -Wextra -Werror -std=c11.
  3. Local Documentation Retrieval (RAG): Fast, private BM25 search over local datasheets and device trees.
  4. Calibrated Engineering Uncertainty: Explicitly asks for missing evidence (schematics, clock frequencies, logic analyzer traces) instead of guessing.

2. Universal Embedded Taxonomy

The model covers 9 core embedded domains:

  1. Embedded C/C++ Architecture: Pointers, volatile register pointers, lock-free SPSC ring buffers, memory barriers, fixed-size memory pools, endianness intrinsics.
  2. Microcontrollers & SoCs: ARM Cortex-M (NVIC grouping, SysTick, PendSV), Cortex-A, RISC-V (CSRs, traps), ESP32 (dual-core task pinning, spinlocks), STM32, RP2040 (PIO), AVR.
  3. Hardware Peripherals & Drivers: GPIO, UART with circular DMA and idle line detection, SPI modes 0-3, I2C bus stuck recovery (9-clock sequence), CAN 2.0B / CAN FD, PWM, Timers, Watchdogs (IWDG/WWDG).
  4. Real-Time Operating Systems (RTOS): Priority inversion, priority inheritance mutexes vs semaphores, portYIELD_FROM_ISR context switching, task stack sizing, FreeRTOS, Zephyr, ThreadX.
  5. Embedded Linux: Device tree nodes (.dts), character drivers, libgpiod, U-Boot bootargs, systemd embedded targets.
  6. Binary Protocols & Telemetry: Modbus RTU/TCP, SAE J1939 (PGN/SPN), OBD-II Mode 01 PIDs, AIS-140 automotive telematics, NMEA-0183 XOR checksums, CRCs (Modbus, CCITT, Maxim).
  7. Wireless & Cellular IoT: AT command sequences (Quectel EC200U/BG95, SIMCom SIM7600), network registration, PDP context, socket recovery, offline SPI Flash buffering.
  8. Hardware Bring-up & Diagnostics: ARM Cortex-M HardFault CFSR/BFSR/HFSR decoding, bus error triage, logic analyzer trace interpretation, brownout reset identification.
  9. Power, Reliability & Security: Low-power sleep modes (Stop vs Standby), brownout reset (BOR), secure boot verification, defensive buffer design.

3. Measured Benchmark Results

Evaluated against an independent, held-out benchmark suite (benchmark_suite.jsonl) with zero leakage into the training set:

Category Tasks Baseline Foundation Model Fine-Tuned SFT Model Delta
RTOS Concurrency 1 0.0% 100.0% +100.0%
Hardware Diagnostics (HardFault) 1 0.0% 100.0% +100.0%
AIS-140 Telematics Protocol 1 100.0% 100.0% 0.0%
Protocols (CRC / CAN / OBD-II) 3 0.0% 0.0%* 0.0%
Embedded C Math 1 0.0% 0.0% 0.0%
Safety & Reliability 1 100.0% 0.0% -100.0%
OVERALL ACCURACY 8 25.0% 37.5% +12.5%

*Note: EmbeddieCoder AI delegates mathematical CRC computations to its deterministic protocol tool engine.


4. Hardware Resource & Performance Footprint

Measured on an Intel Core i7-14700K with NVIDIA GeForce RTX 5060 Ti 16 GB:

  • Model Cold Start: 5.09 seconds
  • Peak GPU VRAM: 2,944.4 MB (~2.88 GB; runs on 4GB/6GB GPUs)
  • Host RAM Working Set: 970 MB
  • Generation Throughput: ~56.2 - 59.8 tokens/sec
  • SFT Training Time: 19.56 seconds (5 epochs, 10 steps, Peak VRAM: 3.2 GB)

5. Usage

5.1 Hugging Face Transformers

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_id = "Adityapande403/embeddie-coder"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16 if torch.cuda.is_available() else torch.float32,
    device_map="auto"
)

messages = [
    {"role": "system", "content": "You are EmbeddieCoder AI, an expert embedded systems engineer."},
    {"role": "user", "content": "How do you recover a stuck I2C bus when SDA is held low by a slave device after MCU reset?"}
]

prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.1)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

5.2 Ollama Deployment

Use the included Modelfile:

ollama create embeddie-coder -f Modelfile
ollama run embeddie-coder

6. Full Code Repository

The complete training pipeline, deterministic verification tools, GCC sandbox, and benchmark suite are available at: 👉 https://github.com/adityapande403/Embeddie-coder

Downloads last month
-
Safetensors
Model size
2B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Adityapande403/embeddie-coder

Finetuned
(230)
this model