TitleOS commited on
Commit
02ab232
·
verified ·
1 Parent(s): d489d70

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +47 -41
README.md CHANGED
@@ -1,59 +1,65 @@
1
  ---
2
- base_model: microsoft/Phi-4-mini-reasoning
3
  library_name: transformers
4
- model_name: HomePhi4_4B
5
  tags:
6
- - generated_from_trainer
7
- - sft
8
- - hf_jobs
9
- - trl
10
- licence: license
 
 
 
 
 
 
 
11
  ---
12
 
13
- # Model Card for HomePhi4_4B
14
 
15
- This model is a fine-tuned version of [microsoft/Phi-4-mini-reasoning](https://huggingface.co/microsoft/Phi-4-mini-reasoning).
16
- It has been trained using [TRL](https://github.com/huggingface/trl).
17
 
18
- ## Quick start
19
 
20
- ```python
21
- from transformers import pipeline
22
 
23
- question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
24
- generator = pipeline("text-generation", model="TitleOS/HomePhi4_4B", device="cuda")
25
- output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
26
- print(output["generated_text"])
27
- ```
28
 
29
- ## Training procedure
 
 
 
 
 
30
 
31
-
32
 
 
33
 
34
- This model was trained with SFT.
35
 
36
- ### Framework versions
37
 
38
- - TRL: 0.25.1
39
- - Transformers: 4.57.3
40
- - Pytorch: 2.9.1
41
- - Datasets: 4.4.1
42
- - Tokenizers: 0.22.1
43
 
44
- ## Citations
 
 
45
 
 
46
 
47
-
48
- Cite TRL as:
49
-
50
- ```bibtex
51
- @misc{vonwerra2022trl,
52
- title = {{TRL: Transformer Reinforcement Learning}},
53
- author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
54
- year = 2020,
55
- journal = {GitHub repository},
56
- publisher = {GitHub},
57
- howpublished = {\url{https://github.com/huggingface/trl}}
58
- }
59
- ```
 
 
1
  ---
2
+ license: mpl-2.0
3
  library_name: transformers
 
4
  tags:
5
+ - home-assistant
6
+ - phi-4
7
+ - iot
8
+ - function-calling
9
+ - smart-home
10
+ - conversational
11
+ base_model: microsoft/Phi-4-mini-reasoning
12
+ datasets:
13
+ - acon96/Home-Assistant-Requests
14
+ language:
15
+ - en
16
+ pipeline_tag: text-generation
17
  ---
18
 
19
+ # TitleOS/HomePhi4_4B
20
 
21
+ ![Model Icon](https://img.shields.io/badge/Home%20Assistant-Compatible-41BDF5) ![Phi-4](https://img.shields.io/badge/Base-Phi%204%20Mini-blue)
 
22
 
23
+ **HomePhi4_4B** is a fine-tuned version of Microsoft's [Phi-4 Mini](https://huggingface.co/microsoft/Phi-4-mini-instruct) (3.8B parameters), specifically optimized for controlling **Home Assistant** instances via natural language.
24
 
25
+ It has been fine-tuned on the [acon96/Home-Assistant-Requests](https://huggingface.co/datasets/acon96/Home-Assistant-Requests) dataset to excel at interpreting user intent and generating accurate JSON function calls to control smart home devices (lights, fans, switches, etc.). This model is designed to be small enough to run locally on edge hardware (like an N100 or Raspberry Pi 5 with 8GB RAM) while maintaining high reasoning capabilities.
 
26
 
27
+ ## Model Details
 
 
 
 
28
 
29
+ - **Model Architecture:** Phi-4 Mini (Dense Decoder-only Transformer)
30
+ - **Parameters:** ~3.8 Billion
31
+ - **Context Length:** 128k tokens (Effective fine-tuning context: ~4096)
32
+ - **Base Model:** `microsoft/Phi-4-mini-instruct`
33
+ - **Fine-tuning Dataset:** `acon96/Home-Assistant-Requests`
34
+ - **License:** MPL-2.0
35
 
36
+ ## Intended Use
37
 
38
+ This model is strictly intended for **local smart home control**. It acts as a natural language interface for Home Assistant, translating requests like "Turn off the kitchen lights" into structured JSON commands that Home Assistant integrations (like `llama_conversation` or `Extended OpenAI Conversation`) can execute.
39
 
40
+ It is **not** a general-purpose assistant and may hallucinate if asked about history, math, or coding outside the scope of home automation.
41
 
42
+ ## Prompt Format
43
 
44
+ To get the best performance, you must adhere to the prompt format used during training. The model expects a system prompt that defines its persona and lists the available devices and tools.
 
 
 
 
45
 
46
+ **System Prompt Template:**
47
+ ```text
48
+ I want you to act as smart home expert manager of Home Assistant.
49
 
50
+ Current Time: {{now()}}
51
 
52
+ Available Devices:
53
+ ```csv
54
+ entity_id,name,state,aliases
55
+ {% for entity in exposed_entities -%}
56
+ {{ entity.entity_id }},{{ entity.name }},{{ entity.state }},{{entity.aliases | join('/')}}
57
+ {% endfor -%}
58
+ ```
59
+ You have access to the internet and other tools.
60
+ The current state of devices is provided in available devices.
61
+ Use execute_services function only for requested action, not for current states.
62
+ Do not execute service without user's confirmation.
63
+ Do not restate or appreciate what user says, rather make a quick inquiry.
64
+ In addition, answer questions about the world, news, and general knowledge when requested. If requested by the user your name is AI.
65
+ If a request appears to be an accident or otherwise doesn't make sense, reply with "Canceled".