Instructions to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="renhehuang/functiongemma-270m-it-coffee-robot-mcp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("renhehuang/functiongemma-270m-it-coffee-robot-mcp") model = AutoModelForCausalLM.from_pretrained("renhehuang/functiongemma-270m-it-coffee-robot-mcp") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="renhehuang/functiongemma-270m-it-coffee-robot-mcp", filename="coffee-robot-functiongemma.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf renhehuang/functiongemma-270m-it-coffee-robot-mcp # Run inference directly in the terminal: llama-cli -hf renhehuang/functiongemma-270m-it-coffee-robot-mcp
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf renhehuang/functiongemma-270m-it-coffee-robot-mcp # Run inference directly in the terminal: llama-cli -hf renhehuang/functiongemma-270m-it-coffee-robot-mcp
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 renhehuang/functiongemma-270m-it-coffee-robot-mcp # Run inference directly in the terminal: ./llama-cli -hf renhehuang/functiongemma-270m-it-coffee-robot-mcp
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 renhehuang/functiongemma-270m-it-coffee-robot-mcp # Run inference directly in the terminal: ./build/bin/llama-cli -hf renhehuang/functiongemma-270m-it-coffee-robot-mcp
Use Docker
docker model run hf.co/renhehuang/functiongemma-270m-it-coffee-robot-mcp
- LM Studio
- Jan
- vLLM
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "renhehuang/functiongemma-270m-it-coffee-robot-mcp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "renhehuang/functiongemma-270m-it-coffee-robot-mcp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/renhehuang/functiongemma-270m-it-coffee-robot-mcp
- SGLang
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "renhehuang/functiongemma-270m-it-coffee-robot-mcp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "renhehuang/functiongemma-270m-it-coffee-robot-mcp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "renhehuang/functiongemma-270m-it-coffee-robot-mcp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "renhehuang/functiongemma-270m-it-coffee-robot-mcp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with Ollama:
ollama run hf.co/renhehuang/functiongemma-270m-it-coffee-robot-mcp
- Unsloth Studio new
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for renhehuang/functiongemma-270m-it-coffee-robot-mcp to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for renhehuang/functiongemma-270m-it-coffee-robot-mcp to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for renhehuang/functiongemma-270m-it-coffee-robot-mcp to start chatting
- Pi new
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf renhehuang/functiongemma-270m-it-coffee-robot-mcp
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "renhehuang/functiongemma-270m-it-coffee-robot-mcp" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf renhehuang/functiongemma-270m-it-coffee-robot-mcp
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 renhehuang/functiongemma-270m-it-coffee-robot-mcp
Run Hermes
hermes
- Docker Model Runner
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with Docker Model Runner:
docker model run hf.co/renhehuang/functiongemma-270m-it-coffee-robot-mcp
- Lemonade
How to use renhehuang/functiongemma-270m-it-coffee-robot-mcp with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull renhehuang/functiongemma-270m-it-coffee-robot-mcp
Run and chat with the model
lemonade run user.functiongemma-270m-it-coffee-robot-mcp-{{QUANT_TAG}}List all available models
lemonade list
☕ Coffee Robot MCP - FunctionGemma 270M
基於 google/functiongemma-270m-it 微調的咖啡機器人外送任務 Function Calling 模型。(此為企業內部點餐 api 整合測試模型)
📋 模型描述
此模型專門針對咖啡機器人外送場景進行微調,能夠將自然語言指令轉換為結構化的 Function Call,適用於 MCP (Model Context Protocol) 整合。
主要特點
- 🎯 專注於咖啡外送任務的 Function Calling
- 🇹🇼 支援繁體中文自然語言輸入
- ⚡ 輕量化模型(270M 參數),適合邊緣部署
- 🔧 相容 MCP 協議格式
🛠️ 支援功能
Function: send_coffee
| 參數 | 類型 | 說明 | 可選值 |
|---|---|---|---|
baseDrink |
string | 飲品種類 | americano, latte, oat_latte, milk |
floor |
integer | 配送樓層 | 1-11 |
temperature |
string | 飲品溫度 | hot, iced |
addons |
array | 加購選項 | extra_espresso, paper_cup |
quantity |
integer | 數量 | 1-10 |
📊 模型效能
| 指標 | 基礎模型 | 微調後模型 |
|---|---|---|
| Function Calling 準確率 | 95.95% | 100.00% |
| 提升幅度 | - | +4.05% |
訓練配置
- 訓練輪數: 3
- 學習率: 1e-05
- 有效批次大小: 16
- 訓練樣本數: 625
- 驗證樣本數: 74
💻 使用方式
基本使用
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
model_id = "renhehuang/functiongemma-270m-it-coffee-robot-mcp"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
tools = [
{
"type": "function",
"function": {
"name": "send_coffee",
"description": "送咖啡到指定樓層",
"parameters": {
"type": "object",
"properties": {
"baseDrink": {"type": "string", "enum": ["americano", "latte", "oat_latte", "milk"]},
"floor": {"type": "integer", "minimum": 1, "maximum": 11},
"temperature": {"type": "string", "enum": ["hot", "iced"]},
"addons": {"type": "array", "items": {"type": "string", "enum": ["extra_espresso", "paper_cup"]}},
"quantity": {"type": "integer", "minimum": 1, "maximum": 10},
},
"required": ["baseDrink", "floor", "temperature", "quantity"],
},
},
}
]
messages = [{"role": "user", "content": "幫我送一杯熱美式到五樓"}]
prompt = tokenizer.apply_chat_template(
messages,
tools=tools,
tokenize=False,
add_generation_prompt=True,
)
out = pipe(prompt, max_new_tokens=256, do_sample=False)
print(out[0]["generated_text"][len(prompt):])
輸出範例
輸入: "幫我送一杯熱美式到五樓"
輸出:
<start_function_call>call: send_coffee{baseDrink:<escape>americano<escape>, floor:<escape>5<escape>, temperature:<escape>hot<escape>, quantity:<escape>1<escape>}<end_function_call>
🔗 MCP 整合
此模型可與 MCP Server 整合,實現自動化咖啡外送流程:
# 解析 Function Call
import re
def parse_function_call(output):
pattern = r"<start_function_call>(.*?)<end_function_call>"
matches = re.findall(pattern, output, re.DOTALL)
# 解析並回傳結構化資料
return matches
⚠️ 限制與注意事項
- 領域限制: 此模型專為咖啡外送場景設計,不適用於其他 Function Calling 任務
- 語言支援: 主要支援繁體中文,其他語言效果可能不佳
- 樓層範圍: 僅支援 1-11 樓
- 飲品種類: 僅支援 4 種飲品類型
📝 引用
@misc{coffee-robot-mcp-2025,
title={Coffee Robot MCP - FunctionGemma Fine-tuned Model},
author={renhehuang},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/renhehuang/functiongemma-270m-it-coffee-robot-mcp}
}
📄 授權
本模型基於 Gemma License 授權。使用前請確認已接受 Google Gemma 的使用條款。
🙏 致謝
- Google - 提供 FunctionGemma 基礎模型
- Hugging Face - 提供模型託管與訓練工具
- Downloads last month
- 94
Model tree for renhehuang/functiongemma-270m-it-coffee-robot-mcp
Base model
google/functiongemma-270m-itEvaluation results
- Accuracy on Coffee Robot MCP Datasetself-reported1.000