Text Generation
PEFT
Safetensors
GGUF
English
lora
qwen
edge-ai
edge-impulse
documentation
code-generation
conversational
Instructions to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-0.5B-Instruct") model = PeftModel.from_pretrained(base_model, "eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M # Run inference directly in the terminal: llama cli -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M # Run inference directly in the terminal: llama cli -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
Use Docker
docker model run hf.co/eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
- Ollama
How to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with Ollama:
ollama run hf.co/eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
- Unsloth Desktop
- Pi
How to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with Docker Model Runner:
docker model run hf.co/eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
- Lemonade
How to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
Run and chat with the model
lemonade run user.edgeai-docs-qwen2.5-coder-0.5b-lora-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Remove generated documentation block
Browse files
README.md
CHANGED
|
@@ -1,210 +1,187 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
base_model: Qwen/Qwen1.5-0.5B
|
| 4 |
-
library_name: peft
|
| 5 |
-
language:
|
| 6 |
-
- en
|
| 7 |
-
tags:
|
| 8 |
-
- lora
|
| 9 |
-
- peft
|
| 10 |
-
- qwen
|
| 11 |
-
- edge-ai
|
| 12 |
-
- edge-impulse
|
| 13 |
-
- documentation
|
| 14 |
-
- code-generation
|
| 15 |
-
- conversational
|
| 16 |
-
pipeline_tag: text-generation
|
| 17 |
-
widget:
|
| 18 |
-
- text: "How can I deploy an Edge Impulse model to an Arduino device?"
|
| 19 |
-
example_title: "Edge AI deployment"
|
| 20 |
-
space: eoinedge/edgeai-docs-embedding-qwen1.5-0.5b-instruct-space
|
| 21 |
-
---
|
| 22 |
-
|
| 23 |
-
# edgeai-docs-embedding-qwen1.5-0.5b-instruct
|
| 24 |
-
|
| 25 |
-
A lightweight LoRA adapter fine-tuned on **1,794 Edge Impulse / Edge AI MDX documentation files** from the [Edge Impulse documentation](https://docs.edgeimpulse.com), built on top of [`Qwen/Qwen1.5-0.5B`](https://huggingface.co/Qwen/Qwen1.5-0.5B).
|
| 26 |
-
|
| 27 |
-
Optimized for:
|
| 28 |
-
- answering developer questions about Edge Impulse Studio, SDKs, APIs, and tooling
|
| 29 |
-
- summarizing technical documentation and tutorials
|
| 30 |
-
- generating code snippets for edge ML workflows
|
| 31 |
-
- lightweight local/edge deployment with PEFT adapters
|
| 32 |
-
|
| 33 |
-
> **Larger variants in training:** [1.5B](https://huggingface.co/eoinedge/edgeai-qwen2.5coder-1.5b-lora) Β· [7B](https://huggingface.co/eoinedge/edgeai-qwen2.5coder-7b-lora) (Qwen2.5-Coder base)
|
| 34 |
-
|
| 35 |
-
---
|
| 36 |
-
|
| 37 |
-
## Model Summary
|
| 38 |
-
|
| 39 |
-
`edgeai-docs-embedding-qwen1.5-0.5b-instruct` is a PEFT LoRA adapter trained for documentation-focused text generation and conversational support over Edge Impulse / Edge AI knowledge.
|
| 40 |
-
|
| 41 |
-
### Use cases
|
| 42 |
-
- Documentation Q&A for Edge Impulse developers
|
| 43 |
-
- Technical explanation of Studio workflows, SDK usage, and hardware deployment
|
| 44 |
-
- Generating sample code for API, CLI, and Python SDK integrations
|
| 45 |
-
- Retrieval-augmented generation (RAG) over Edge AI docs
|
| 46 |
-
|
| 47 |
-
---
|
| 48 |
-
|
| 49 |
-
## Model Details
|
| 50 |
-
|
| 51 |
-
| Property | Value |
|
| 52 |
-
|---|---|
|
| 53 |
-
| Base model | `Qwen/Qwen1.5-0.5B` |
|
| 54 |
-
| Adapter type | LoRA (PEFT) |
|
| 55 |
-
| LoRA rank (`r`) | 8 |
|
| 56 |
-
| LoRA alpha | 32 |
|
| 57 |
-
| Target modules | `q_proj`, `v_proj` |
|
| 58 |
-
| Task type | CAUSAL_LM |
|
| 59 |
-
| Trainable parameters | ~786K (0.17% of base) |
|
| 60 |
-
| Training epochs | 3 |
|
| 61 |
-
| Batch size | 4 (Γ grad accum 2 = effective 8) |
|
| 62 |
-
| Learning rate | 3e-4 |
|
| 63 |
-
| Max sequence length | 512 tokens |
|
| 64 |
-
| Training hardware | Apple M1 Pro (MPS, fp16) |
|
| 65 |
-
| Precision | float16 |
|
| 66 |
-
|
| 67 |
-
---
|
| 68 |
-
|
| 69 |
-
## Training Data
|
| 70 |
-
|
| 71 |
-
| Stat | Value |
|
| 72 |
-
|---|---|
|
| 73 |
-
| Source | [Edge Impulse documentation](https://docs.edgeimpulse.com) |
|
| 74 |
-
| File format | MDX (Markdown + JSX components) |
|
| 75 |
-
| Total files | 1,794 `.mdx` files |
|
| 76 |
-
| Preprocessing | Stripped frontmatter, imports, JSX tags; unwrapped code fences; flattened links |
|
| 77 |
-
| Chunk size | 512 tokens |
|
| 78 |
-
|
| 79 |
-
Topics covered: Studio projects, datasets, data ingestion, DSP and transformation blocks, learning and processing blocks, model deployment, Python SDK, REST API, CLI tools, and edge inference.
|
| 80 |
-
|
| 81 |
-
---
|
| 82 |
-
|
| 83 |
-
## Evaluation
|
| 84 |
-
|
| 85 |
-
### QA evaluation
|
| 86 |
-
- Dataset: 5 fixed developer-style prompts
|
| 87 |
-
- Base avg keyword count: **8.2**
|
| 88 |
-
- Adapter avg keyword count: **6.8**
|
| 89 |
-
- Code snippet presence: **5/5** for both base and adapter
|
| 90 |
-
|
| 91 |
-
### Perplexity on Edge AI samples
|
| 92 |
-
- Test corpus: 30 sample Edge AI documentation files
|
| 93 |
-
- Base mean perplexity: **11.53**
|
| 94 |
-
- Adapter mean perplexity: **12.02**
|
| 95 |
-
- Adapter wins: **4 / 30 documents**
|
| 96 |
-
|
| 97 |
-
> These metrics are from small validation samples and should be interpreted as a lightweight benchmark rather than a full production evaluation.
|
| 98 |
-
|
| 99 |
-
---
|
| 100 |
-
|
| 101 |
-
## Tutorials
|
| 102 |
-
|
| 103 |
-
- [Offline SLMs for Edge AI Development β Part 1: Qwen LoRA Adapter Fine-Tuned on Edge Impulse Docs](https://docs.edgeimpulse.com/projects/expert-network/integrating-slms-on-linux)
|
| 104 |
-
- [Offline SLMs for Edge AI Development β Part 2: RAG as an Enhancement for Fine-Tuned Models with FAISS](https://docs.edgeimpulse.com/projects/expert-network/rag-docs-assistant-faiss-qwen)
|
| 105 |
-
- [Offline SLMs for Edge AI Development β Part 3: Agentic Coding with an Arduino Fine-Tuned Adapter via llama.cpp and OpenCode](https://docs.edgeimpulse.com/projects/expert-network/opencode-offline-coding-assistant)
|
| 106 |
-
|
| 107 |
-
---
|
| 108 |
-
|
| 109 |
-
## Usage
|
| 110 |
-
|
| 111 |
-
### Load with PEFT
|
| 112 |
-
|
| 113 |
-
```python
|
| 114 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 115 |
-
from peft import PeftModel
|
| 116 |
-
import torch
|
| 117 |
-
|
| 118 |
-
BASE_MODEL = "Qwen/Qwen1.5-0.5B"
|
| 119 |
-
ADAPTER = "eoinedge/edgeai-docs-embedding-qwen1.5-0.5b-instruct"
|
| 120 |
-
|
| 121 |
-
device = "cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else "cpu")
|
| 122 |
-
|
| 123 |
-
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
|
| 124 |
-
base_model = AutoModelForCausalLM.from_pretrained(
|
| 125 |
-
BASE_MODEL,
|
| 126 |
-
torch_dtype=torch.float16 if device != "cpu" else torch.float32,
|
| 127 |
-
device_map=device,
|
| 128 |
-
)
|
| 129 |
-
model = PeftModel.from_pretrained(base_model, ADAPTER)
|
| 130 |
-
model.eval()
|
| 131 |
-
```
|
| 132 |
-
|
| 133 |
-
### Text generation pipeline
|
| 134 |
-
|
| 135 |
-
```python
|
| 136 |
-
from transformers import pipeline
|
| 137 |
-
|
| 138 |
-
pipe = pipeline("text-generation", model="eoinedge/edgeai-docs-embedding-qwen1.5-0.5b-instruct")
|
| 139 |
-
print(pipe([{"role": "user", "content": "How do I use the Edge Impulse Python SDK to upload data?"}]))
|
| 140 |
-
```
|
| 141 |
-
|
| 142 |
-
---
|
| 143 |
-
|
| 144 |
-
## Example prompts
|
| 145 |
-
|
| 146 |
-
| Task | Prompt |
|
| 147 |
-
|---|---|
|
| 148 |
-
| Concept explanation | `What is a DSP block in Edge Impulse?` |
|
| 149 |
-
| API usage | `How do I use the Edge Impulse Python SDK to upload data?` |
|
| 150 |
-
| Deployment | `How do I deploy a model to an Arduino Nano 33 BLE Sense?` |
|
| 151 |
-
| Code generation | `Write Python code to collect IMU data and upload it to Edge Impulse.` |
|
| 152 |
-
| Troubleshooting | `Why is my Edge Impulse model showing high latency?` |
|
| 153 |
-
|
| 154 |
-
---
|
| 155 |
-
|
| 156 |
-
## Limitations
|
| 157 |
-
|
| 158 |
-
- Based on a 0.5B base model β may struggle with long multi-step reasoning
|
| 159 |
-
- Training data covers Edge Impulse docs as of mid-2026; newer features may be missing
|
| 160 |
-
- May hallucinate or fabricate undocumented APIs or block behavior
|
| 161 |
-
- Not validated for safety-critical or production use
|
| 162 |
-
- Validate generated code before deploying on hardware
|
| 163 |
-
|
| 164 |
-
---
|
| 165 |
-
|
| 166 |
-
## Related models
|
| 167 |
-
|
| 168 |
-
| Model | Base | Status |
|
| 169 |
-
|---|---|---|
|
| 170 |
-
| This model | Qwen/Qwen1.5-0.5B | β
Available |
|
| 171 |
-
| [eoinedge/edgeai-qwen2.5coder-1.5b-lora](https://huggingface.co/eoinedge/edgeai-qwen2.5coder-1.5b-lora) | Qwen2.5-Coder-1.5B-Instruct | π Training |
|
| 172 |
-
| [eoinedge/edgeai-qwen2.5coder-7b-lora](https://huggingface.co/eoinedge/edgeai-qwen2.5coder-7b-lora) | Qwen2.5-Coder-7B-Instruct | π Training |
|
| 173 |
-
| [eoinedge/arduino-qwen0.5-lora](https://huggingface.co/eoinedge/arduino-qwen0.5-lora) | Qwen/Qwen1.5-0.5B | β
Available |
|
| 174 |
-
|
| 175 |
-
---
|
| 176 |
-
|
| 177 |
-
## Citation
|
| 178 |
-
|
| 179 |
-
```bibtex
|
| 180 |
-
@misc{edgeai-docs-embedding-qwen1.5-0.5b-instruct,
|
| 181 |
-
author = {Jordan, Eoin},
|
| 182 |
-
title = {edgeai-docs-embedding-qwen1.5-0.5b-instruct},
|
| 183 |
-
year = {2026},
|
| 184 |
-
publisher = {Hugging Face},
|
| 185 |
-
howpublished = {\url{https://huggingface.co/eoinedge/edgeai-docs-embedding-qwen1.5-0.5b-instruct}}
|
| 186 |
-
}
|
| 187 |
-
```
|
| 188 |
-
|
| 189 |
-
<!-- portfolio-card-standard:v1 -->
|
| 190 |
-
## Provenance and maintenance
|
| 191 |
-
|
| 192 |
-
This standardized block is maintained from a versioned local snapshot. It separates declared evidence from gaps that still require source documentation.
|
| 193 |
-
|
| 194 |
-
| Field | Recorded value |
|
| 195 |
-
| --- | --- |
|
| 196 |
-
| Hugging Face asset | [eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora](https://huggingface.co/eoinedge/edgeai-docs-qwen2.5-coder-0.5b-lora) (model) |
|
| 197 |
-
| Snapshot revision | `5d5d65a115937999aed51e771913721ed1aaab03` |
|
| 198 |
-
| Snapshot location | `backups/huggingface/20260624T153725Z/models/eoinedge--edgeai-docs-qwen2.5-coder-0.5b-lora/` |
|
| 199 |
-
| Last remote modification captured | `2026-05-16 17:21:57+00:00` |
|
| 200 |
-
| Declared license | apache-2.0 |
|
| 201 |
-
| Prior-card references | <https://docs.edgeimpulse.com>, <https://huggingface.co/Qwen/Qwen1.5-0.5B>, <https://huggingface.co/eoinedge/edgeai-qwen2.5coder-1.5b-lora>, <https://huggingface.co/eoinedge/edgeai-qwen2.5coder-7b-lora>, <https://docs.edgeimpulse.com/projects/expert-network/integrating-slms-on-linux>, <https://docs.edgeimpulse.com/projects/expert-network/rag-docs-assistant-faiss-qwen>, <https://docs.edgeimpulse.com/projects/expert-network/opencode-offline-coding-assistant>, <https://huggingface.co/eoinedge/arduino-qwen0.5-lora>, <https://huggingface.co/eoinedge/edgeai-docs-embedding-qwen1.5-0.5b-instruct}}> |
|
| 202 |
-
|
| 203 |
-
### Model lineage
|
| 204 |
-
|
| 205 |
-
| Field | Recorded value |
|
| 206 |
-
| --- | --- |
|
| 207 |
-
| Base model | Qwen/Qwen2.5-Coder-0.5B-Instruct |
|
| 208 |
-
| Training data | Not declared in a machine-readable source β add exact dataset revision(s), split(s), and license(s). |
|
| 209 |
-
| Training method and code | Not declared in a machine-readable source β add recipe, hyperparameters, hardware, and source commit. |
|
| 210 |
-
| Evaluation | Not declared in a machine-readable source β add metrics, evaluation data, and limitations. |
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen1.5-0.5B
|
| 4 |
+
library_name: peft
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
tags:
|
| 8 |
+
- lora
|
| 9 |
+
- peft
|
| 10 |
+
- qwen
|
| 11 |
+
- edge-ai
|
| 12 |
+
- edge-impulse
|
| 13 |
+
- documentation
|
| 14 |
+
- code-generation
|
| 15 |
+
- conversational
|
| 16 |
+
pipeline_tag: text-generation
|
| 17 |
+
widget:
|
| 18 |
+
- text: "How can I deploy an Edge Impulse model to an Arduino device?"
|
| 19 |
+
example_title: "Edge AI deployment"
|
| 20 |
+
space: eoinedge/edgeai-docs-embedding-qwen1.5-0.5b-instruct-space
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# edgeai-docs-embedding-qwen1.5-0.5b-instruct
|
| 24 |
+
|
| 25 |
+
A lightweight LoRA adapter fine-tuned on **1,794 Edge Impulse / Edge AI MDX documentation files** from the [Edge Impulse documentation](https://docs.edgeimpulse.com), built on top of [`Qwen/Qwen1.5-0.5B`](https://huggingface.co/Qwen/Qwen1.5-0.5B).
|
| 26 |
+
|
| 27 |
+
Optimized for:
|
| 28 |
+
- answering developer questions about Edge Impulse Studio, SDKs, APIs, and tooling
|
| 29 |
+
- summarizing technical documentation and tutorials
|
| 30 |
+
- generating code snippets for edge ML workflows
|
| 31 |
+
- lightweight local/edge deployment with PEFT adapters
|
| 32 |
+
|
| 33 |
+
> **Larger variants in training:** [1.5B](https://huggingface.co/eoinedge/edgeai-qwen2.5coder-1.5b-lora) Β· [7B](https://huggingface.co/eoinedge/edgeai-qwen2.5coder-7b-lora) (Qwen2.5-Coder base)
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## Model Summary
|
| 38 |
+
|
| 39 |
+
`edgeai-docs-embedding-qwen1.5-0.5b-instruct` is a PEFT LoRA adapter trained for documentation-focused text generation and conversational support over Edge Impulse / Edge AI knowledge.
|
| 40 |
+
|
| 41 |
+
### Use cases
|
| 42 |
+
- Documentation Q&A for Edge Impulse developers
|
| 43 |
+
- Technical explanation of Studio workflows, SDK usage, and hardware deployment
|
| 44 |
+
- Generating sample code for API, CLI, and Python SDK integrations
|
| 45 |
+
- Retrieval-augmented generation (RAG) over Edge AI docs
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## Model Details
|
| 50 |
+
|
| 51 |
+
| Property | Value |
|
| 52 |
+
|---|---|
|
| 53 |
+
| Base model | `Qwen/Qwen1.5-0.5B` |
|
| 54 |
+
| Adapter type | LoRA (PEFT) |
|
| 55 |
+
| LoRA rank (`r`) | 8 |
|
| 56 |
+
| LoRA alpha | 32 |
|
| 57 |
+
| Target modules | `q_proj`, `v_proj` |
|
| 58 |
+
| Task type | CAUSAL_LM |
|
| 59 |
+
| Trainable parameters | ~786K (0.17% of base) |
|
| 60 |
+
| Training epochs | 3 |
|
| 61 |
+
| Batch size | 4 (Γ grad accum 2 = effective 8) |
|
| 62 |
+
| Learning rate | 3e-4 |
|
| 63 |
+
| Max sequence length | 512 tokens |
|
| 64 |
+
| Training hardware | Apple M1 Pro (MPS, fp16) |
|
| 65 |
+
| Precision | float16 |
|
| 66 |
+
|
| 67 |
+
---
|
| 68 |
+
|
| 69 |
+
## Training Data
|
| 70 |
+
|
| 71 |
+
| Stat | Value |
|
| 72 |
+
|---|---|
|
| 73 |
+
| Source | [Edge Impulse documentation](https://docs.edgeimpulse.com) |
|
| 74 |
+
| File format | MDX (Markdown + JSX components) |
|
| 75 |
+
| Total files | 1,794 `.mdx` files |
|
| 76 |
+
| Preprocessing | Stripped frontmatter, imports, JSX tags; unwrapped code fences; flattened links |
|
| 77 |
+
| Chunk size | 512 tokens |
|
| 78 |
+
|
| 79 |
+
Topics covered: Studio projects, datasets, data ingestion, DSP and transformation blocks, learning and processing blocks, model deployment, Python SDK, REST API, CLI tools, and edge inference.
|
| 80 |
+
|
| 81 |
+
---
|
| 82 |
+
|
| 83 |
+
## Evaluation
|
| 84 |
+
|
| 85 |
+
### QA evaluation
|
| 86 |
+
- Dataset: 5 fixed developer-style prompts
|
| 87 |
+
- Base avg keyword count: **8.2**
|
| 88 |
+
- Adapter avg keyword count: **6.8**
|
| 89 |
+
- Code snippet presence: **5/5** for both base and adapter
|
| 90 |
+
|
| 91 |
+
### Perplexity on Edge AI samples
|
| 92 |
+
- Test corpus: 30 sample Edge AI documentation files
|
| 93 |
+
- Base mean perplexity: **11.53**
|
| 94 |
+
- Adapter mean perplexity: **12.02**
|
| 95 |
+
- Adapter wins: **4 / 30 documents**
|
| 96 |
+
|
| 97 |
+
> These metrics are from small validation samples and should be interpreted as a lightweight benchmark rather than a full production evaluation.
|
| 98 |
+
|
| 99 |
+
---
|
| 100 |
+
|
| 101 |
+
## Tutorials
|
| 102 |
+
|
| 103 |
+
- [Offline SLMs for Edge AI Development β Part 1: Qwen LoRA Adapter Fine-Tuned on Edge Impulse Docs](https://docs.edgeimpulse.com/projects/expert-network/integrating-slms-on-linux)
|
| 104 |
+
- [Offline SLMs for Edge AI Development β Part 2: RAG as an Enhancement for Fine-Tuned Models with FAISS](https://docs.edgeimpulse.com/projects/expert-network/rag-docs-assistant-faiss-qwen)
|
| 105 |
+
- [Offline SLMs for Edge AI Development β Part 3: Agentic Coding with an Arduino Fine-Tuned Adapter via llama.cpp and OpenCode](https://docs.edgeimpulse.com/projects/expert-network/opencode-offline-coding-assistant)
|
| 106 |
+
|
| 107 |
+
---
|
| 108 |
+
|
| 109 |
+
## Usage
|
| 110 |
+
|
| 111 |
+
### Load with PEFT
|
| 112 |
+
|
| 113 |
+
```python
|
| 114 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 115 |
+
from peft import PeftModel
|
| 116 |
+
import torch
|
| 117 |
+
|
| 118 |
+
BASE_MODEL = "Qwen/Qwen1.5-0.5B"
|
| 119 |
+
ADAPTER = "eoinedge/edgeai-docs-embedding-qwen1.5-0.5b-instruct"
|
| 120 |
+
|
| 121 |
+
device = "cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else "cpu")
|
| 122 |
+
|
| 123 |
+
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
|
| 124 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 125 |
+
BASE_MODEL,
|
| 126 |
+
torch_dtype=torch.float16 if device != "cpu" else torch.float32,
|
| 127 |
+
device_map=device,
|
| 128 |
+
)
|
| 129 |
+
model = PeftModel.from_pretrained(base_model, ADAPTER)
|
| 130 |
+
model.eval()
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
### Text generation pipeline
|
| 134 |
+
|
| 135 |
+
```python
|
| 136 |
+
from transformers import pipeline
|
| 137 |
+
|
| 138 |
+
pipe = pipeline("text-generation", model="eoinedge/edgeai-docs-embedding-qwen1.5-0.5b-instruct")
|
| 139 |
+
print(pipe([{"role": "user", "content": "How do I use the Edge Impulse Python SDK to upload data?"}]))
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
---
|
| 143 |
+
|
| 144 |
+
## Example prompts
|
| 145 |
+
|
| 146 |
+
| Task | Prompt |
|
| 147 |
+
|---|---|
|
| 148 |
+
| Concept explanation | `What is a DSP block in Edge Impulse?` |
|
| 149 |
+
| API usage | `How do I use the Edge Impulse Python SDK to upload data?` |
|
| 150 |
+
| Deployment | `How do I deploy a model to an Arduino Nano 33 BLE Sense?` |
|
| 151 |
+
| Code generation | `Write Python code to collect IMU data and upload it to Edge Impulse.` |
|
| 152 |
+
| Troubleshooting | `Why is my Edge Impulse model showing high latency?` |
|
| 153 |
+
|
| 154 |
+
---
|
| 155 |
+
|
| 156 |
+
## Limitations
|
| 157 |
+
|
| 158 |
+
- Based on a 0.5B base model β may struggle with long multi-step reasoning
|
| 159 |
+
- Training data covers Edge Impulse docs as of mid-2026; newer features may be missing
|
| 160 |
+
- May hallucinate or fabricate undocumented APIs or block behavior
|
| 161 |
+
- Not validated for safety-critical or production use
|
| 162 |
+
- Validate generated code before deploying on hardware
|
| 163 |
+
|
| 164 |
+
---
|
| 165 |
+
|
| 166 |
+
## Related models
|
| 167 |
+
|
| 168 |
+
| Model | Base | Status |
|
| 169 |
+
|---|---|---|
|
| 170 |
+
| This model | Qwen/Qwen1.5-0.5B | β
Available |
|
| 171 |
+
| [eoinedge/edgeai-qwen2.5coder-1.5b-lora](https://huggingface.co/eoinedge/edgeai-qwen2.5coder-1.5b-lora) | Qwen2.5-Coder-1.5B-Instruct | π Training |
|
| 172 |
+
| [eoinedge/edgeai-qwen2.5coder-7b-lora](https://huggingface.co/eoinedge/edgeai-qwen2.5coder-7b-lora) | Qwen2.5-Coder-7B-Instruct | π Training |
|
| 173 |
+
| [eoinedge/arduino-qwen0.5-lora](https://huggingface.co/eoinedge/arduino-qwen0.5-lora) | Qwen/Qwen1.5-0.5B | β
Available |
|
| 174 |
+
|
| 175 |
+
---
|
| 176 |
+
|
| 177 |
+
## Citation
|
| 178 |
+
|
| 179 |
+
```bibtex
|
| 180 |
+
@misc{edgeai-docs-embedding-qwen1.5-0.5b-instruct,
|
| 181 |
+
author = {Jordan, Eoin},
|
| 182 |
+
title = {edgeai-docs-embedding-qwen1.5-0.5b-instruct},
|
| 183 |
+
year = {2026},
|
| 184 |
+
publisher = {Hugging Face},
|
| 185 |
+
howpublished = {\url{https://huggingface.co/eoinedge/edgeai-docs-embedding-qwen1.5-0.5b-instruct}}
|
| 186 |
+
}
|
| 187 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|