Instructions to use nlouis/functiongemma-pocket-q4_k_m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use nlouis/functiongemma-pocket-q4_k_m with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="nlouis/functiongemma-pocket-q4_k_m", filename="functiongemma-pocket-q4_k_m.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use nlouis/functiongemma-pocket-q4_k_m with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf nlouis/functiongemma-pocket-q4_k_m:Q4_K_M # Run inference directly in the terminal: llama-cli -hf nlouis/functiongemma-pocket-q4_k_m:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf nlouis/functiongemma-pocket-q4_k_m:Q4_K_M # Run inference directly in the terminal: llama-cli -hf nlouis/functiongemma-pocket-q4_k_m: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 nlouis/functiongemma-pocket-q4_k_m:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf nlouis/functiongemma-pocket-q4_k_m: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 nlouis/functiongemma-pocket-q4_k_m:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf nlouis/functiongemma-pocket-q4_k_m:Q4_K_M
Use Docker
docker model run hf.co/nlouis/functiongemma-pocket-q4_k_m:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use nlouis/functiongemma-pocket-q4_k_m with Ollama:
ollama run hf.co/nlouis/functiongemma-pocket-q4_k_m:Q4_K_M
- Unsloth Studio new
How to use nlouis/functiongemma-pocket-q4_k_m 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 nlouis/functiongemma-pocket-q4_k_m 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 nlouis/functiongemma-pocket-q4_k_m to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for nlouis/functiongemma-pocket-q4_k_m to start chatting
- Pi new
How to use nlouis/functiongemma-pocket-q4_k_m with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf nlouis/functiongemma-pocket-q4_k_m:Q4_K_M
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": "nlouis/functiongemma-pocket-q4_k_m:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use nlouis/functiongemma-pocket-q4_k_m with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf nlouis/functiongemma-pocket-q4_k_m: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 nlouis/functiongemma-pocket-q4_k_m:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use nlouis/functiongemma-pocket-q4_k_m with Docker Model Runner:
docker model run hf.co/nlouis/functiongemma-pocket-q4_k_m:Q4_K_M
- Lemonade
How to use nlouis/functiongemma-pocket-q4_k_m with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull nlouis/functiongemma-pocket-q4_k_m:Q4_K_M
Run and chat with the model
lemonade run user.functiongemma-pocket-q4_k_m-Q4_K_M
List all available models
lemonade list
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
FunctionGemma Pocket (Q4_K_M)
A 4-bit quantized GGUF model for function/tool calling, based on FunctionGemma and fine-tuned for a small set of tools (weather, security, web search, network scan, stock price). Optimized for edge and resource-constrained devices (e.g. Raspberry Pi) via llama.cpp.
Model description
- Format: GGUF (Q4_K_M quantization)
- Base: FunctionGemma (Gemma-based model for function calling)
- Purpose: Map natural-language user queries to structured tool/function calls
- Context length: 2048 tokens (recommended)
- Chat roles:
developer,user,assistant; assistant replies with tool calls in the form<start_function_call>{"name": "...", "arguments": {...}}<end_function_call>
Fine-tuning was done on ~1000 examples generated from a fixed tool schema so the model learns to select the right function and fill arguments from natural language.
Intended use
- In scope: Choosing one of the supported tools and producing a single, well-formed function call (name + arguments) from a short user message.
- Out of scope: General chat, long-form generation, or tools not present in the training schema. Not intended for high-stakes or safety-critical decisions without human oversight.
Supported tools (training schema)
| Tool | Description |
|---|---|
get_weather |
Weather or forecast for a location (location: string) |
activate_security_mode |
Toggle Raspberry Pi security, cameras, PIR sensors (no args) |
web_search |
Web search for current info (query: string) |
network_scan |
Scan LAN for devices and open ports (no args) |
get_stock_price |
Current stock price and basic market data (symbol: string, e.g. AAPL, TSLA) |
Usage
Download and load with llama-cpp-python
from huggingface_hub import hf_hub_download
from llama_cpp import Llama
# Replace with your repo id, e.g. "your-username/functiongemma-pocket-q4_k_m"
REPO_ID = "YOUR_USERNAME/functiongemma-pocket-q4_k_m"
FILENAME = "functiongemma-pocket-q4_k_m.gguf"
path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
llm = Llama(
model_path=path,
n_ctx=2048,
n_threads=4,
n_gpu_layers=-1, # use GPU if available; 0 for CPU-only
use_mmap=True,
verbose=False,
)
Function-calling example
import json
tools = [
{"type": "function", "function": {"name": "get_weather", "description": "Weather for a location.", "parameters": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}},
# ... add other tools in the same format
]
messages = [
{"role": "developer", "content": "You are a model that can do function calling with the provided functions."},
{"role": "user", "content": "What's the weather in Tokyo?"}
]
out = llm.create_chat_completion(
messages=messages,
tools=tools,
max_tokens=128,
temperature=0.1,
stop=["<end_function_call>", "<eos>"],
)
# Parse assistant message for tool name and arguments
content = out["choices"][0]["message"].get("content", "")
# content may contain <start_function_call>{"name": "get_weather", "arguments": {"location": "Tokyo"}}<end_function_call>
Training details
- Data: ~1000 synthetic examples (user query → single tool call) derived from the tool schema above.
- Roles: System-style instruction in
developer, user query inuser, target tool call inassistantwithtool_calls. - Quantization: Q4_K_M (4-bit) GGUF for smaller size and faster inference on CPU/edge.
Limitations
- Trained only on the five tools listed; performance on other tools or schemas is undefined.
- Small model; may occasionally misselect the tool or omit/alter arguments.
- Not evaluated for safety or alignment beyond the described use case.
License
Apache 2.0 (align with the base model’s license when distributing).
- Downloads last month
- 18
4-bit