suyash94/slm-function-calling
0
SLM Function Calling - Car Control Demo
Convert natural language commands into structured function calls using a fine-tuned GPT-2 model with LoRA.
Demo
Try commands like:
- "Set the temperature to 22 degrees for the driver"
- "Turn up the heat"
- "Navigate to Central Park"
- "Play jazz music at volume 7"
- "Lock all the doors"
Model Details
Function Categories
The model supports 18 functions across these categories:
- Climate Control: settemperature, adjusttemperature, setfanspeed, adjustfanspeed
- Comfort: adjustseat, controlwindow
- Wipers & Defroster: setwiperspeed, adjustwiperspeed, activate_defroster
- Engine & Security: startengine, lockdoors
- Entertainment: play_music
- Navigation: setnavigationdestination
- Lighting: toggleheadlights, controlambient_lighting
- Driving: setcruisecontrol, togglesportmode
- Maintenance: checkbatteryhealth
Output Format
The model generates function calls in this format:
<functioncall> {"name": "function_name", "arguments": "{'param': value}"} <|im_end|>Training
The model was trained using:
- ChatML format with system/user/assistant messages
- Label masking (loss computed only on assistant response)
- LoRA adapters targeting attention layers (cattn, cproj)
Limitations
- Only trained on car control domain
- May produce incorrect outputs for ambiguous or out-of-domain queries
- Best results with clear, specific commands
