3morixd commited on
Commit
4f6669f
ยท
verified ยท
1 Parent(s): 388eb34

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +53 -54
README.md CHANGED
@@ -1,84 +1,83 @@
1
  ---
2
  license: apache-2.0
3
- base_model: HuggingFaceTB/SmolLM2-135M-Instruct
 
 
4
  tags:
5
- - speculative-decoding-draft
6
- - dispatch-ai
7
  - mobile
 
8
  - quantized
9
  - gguf
10
- - phone-farm-tested
11
  pipeline_tag: text-generation
12
- language:
13
- - en
14
  ---
15
 
16
  # SmolLM2-135M-Instruct-mobile
17
 
18
- **Dispatch AI** โ€” Built for mobile. Tested on real phones.
19
-
20
- ## Category
21
-
22
- Text Generation โ€” Ultra-tiny 135M model
23
 
24
- ## Model
25
 
26
- Re-engineered from [HuggingFaceTB/SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct).
27
- Quantized to Q4_K_M GGUF for on-device inference via llama.cpp.
28
- Size: 101 MB.
 
29
 
30
- ## Phone Farm Test Results
31
 
32
- Tested on **Samsung Galaxy S20 FE 5G** (Snapdragon 865, 8GB RAM):
 
 
 
 
33
 
34
- | Phone | Gen t/s | Prompt t/s |
35
- |-------|---------|------------|
36
- | R3CN30WHS2Z | 54.4 | 199.4 |
37
- | R3CN509PLHA | 48.5 | 206.5 |
38
-
39
- - **Average: 51.5 t/s**
40
- - **40-phone aggregate: ~2058 t/s**
41
 
 
 
 
 
 
 
 
 
42
 
43
  ## Usage
44
 
45
- ```bash
46
- ./llama-cli -m model.gguf -p "Hello" -n 100 -t 4 -c 512
47
- ```
48
 
49
- ๐ŸŒ [dispatchAI on HuggingFace](https://huggingface.co/dispatchAI)
 
50
 
 
 
 
 
 
 
 
51
 
52
- ## Speculative Decoding Draft Model
53
 
54
- This model is optimized for use as a **draft model** in speculative decoding setups.
 
 
 
 
55
 
56
- ### What is speculative decoding?
57
- Speculative decoding pairs a small, fast "draft" model with a larger "target" model.
58
- The draft model proposes tokens that the target model verifies in parallel, achieving
59
- 2-3x speedup with zero quality loss.
60
 
61
- ### Why this model?
62
- - **Small and fast**: Sub-1B parameters = minimal draft overhead
63
- - **Mobile-optimized**: Already quantized and pruned for edge deployment
64
- - **Same family**: Pairs naturally with larger models of the same architecture
65
 
66
- ### Usage with vLLM
67
- ```python
68
- from vllm import LLM, SamplingParams
69
 
70
- llm = LLM(
71
- model="target-model-7b",
72
- speculative_model="dispatchAI/SmolLM2-135M-Instruct-mobile",
73
- num_speculative_tokens=5,
74
- )
75
- ```
76
 
77
- ### Usage with transformers
78
- ```python
79
- from transformers import AutoModelForCausalLM, AutoTokenizer
80
 
81
- target = AutoModelForCausalLM.from_pretrained("target-model-7b")
82
- draft = AutoModelForCausalLM.from_pretrained("dispatchAI/SmolLM2-135M-Instruct-mobile")
83
- # See transformers docs for assisted_generation
84
- ```
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: transformers
6
  tags:
 
 
7
  - mobile
8
+ - on-device
9
  - quantized
10
  - gguf
11
+ - dispatchai
12
  pipeline_tag: text-generation
 
 
13
  ---
14
 
15
  # SmolLM2-135M-Instruct-mobile
16
 
17
+ A 135M parameter instruction-tuned model optimized for mobile and edge devices. 101MB GGUF file that runs at 59.7 tokens/sec on CPU.
 
 
 
 
18
 
19
+ ## โœ… Verified
20
 
21
+ This model has been tested and verified working:
22
+ - **Chat format**: `llama-3` (use `chat_format="llama-3"` in llama-cpp-python)
23
+ - **Test date**: June 2026
24
+ - **Verified with**: llama-cpp-python on CPU (112 cores, 128GB RAM)
25
 
26
+ ### Test Results
27
 
28
+ | Prompt | Response | Correct? |
29
+ |--------|----------|----------|
30
+ | "What is the capital of France?" | "The capital of France is Paris." | โœ… |
31
+ | "What is 2+2?" | "2 + 2 = 4" | โœ… |
32
+ | "Write a one-sentence greeting." | "Welcome! I'm an AI assistant..." | โœ… |
33
 
34
+ ## Model Details
 
 
 
 
 
 
35
 
36
+ | Attribute | Value |
37
+ |-----------|-------|
38
+ | **Base Model** | HuggingFaceTB/SmolLM2-135M-Instruct |
39
+ | **Parameters** | 135M |
40
+ | **File Size** | 101 MB |
41
+ | **Format** | GGUF |
42
+ | **Chat Format** | llama-3 |
43
+ | **License** | Apache-2.0 |
44
 
45
  ## Usage
46
 
47
+ ### Python (llama-cpp-python)
 
 
48
 
49
+ ```python
50
+ from llama_cpp import Llama
51
 
52
+ llm = Llama(model_path="model.gguf", chat_format="llama-3", n_ctx=512, n_threads=4)
53
+ response = llm.create_chat_completion(
54
+ messages=[{"role": "user", "content": "What is the capital of France?"}],
55
+ max_tokens=50,
56
+ )
57
+ print(response["choices"][0]["message"]["content"])
58
+ ```
59
 
60
+ ### dispatchAI SDK
61
 
62
+ ```python
63
+ from dispatchai import load_model
64
+ model = load_model("SmolLM2-135M-Instruct-mobile", backend="gguf")
65
+ print(model.chat("What is the capital of France?"))
66
+ ```
67
 
68
+ ### llama.cpp CLI
 
 
 
69
 
70
+ ```bash
71
+ llama-cli -m model.gguf -p "What is the capital of France?" -n 50 --chat-format llama-3
72
+ ```
 
73
 
74
+ ## Limitations
 
 
75
 
76
+ - 135M parameters โ€” best for simple tasks (QA, classification, short summaries)
77
+ - Not suitable for complex reasoning or long-form generation
78
+ - May repeat itself on some prompts
79
+ - English-only
 
 
80
 
81
+ ## About dispatchAI
 
 
82
 
83
+ [dispatchAI](https://huggingface.co/dispatchAI) โ€” Small. Mobile. Free. UAE-built.