Instructions to use katanemo/Arch-Function-Chat-3B.gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use katanemo/Arch-Function-Chat-3B.gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="katanemo/Arch-Function-Chat-3B.gguf") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("katanemo/Arch-Function-Chat-3B.gguf", dtype="auto") - llama-cpp-python
How to use katanemo/Arch-Function-Chat-3B.gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="katanemo/Arch-Function-Chat-3B.gguf", filename="Arch-Function-Chat-3B-Q2_K.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 katanemo/Arch-Function-Chat-3B.gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf katanemo/Arch-Function-Chat-3B.gguf: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 katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf katanemo/Arch-Function-Chat-3B.gguf: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 katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M
Use Docker
docker model run hf.co/katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use katanemo/Arch-Function-Chat-3B.gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "katanemo/Arch-Function-Chat-3B.gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "katanemo/Arch-Function-Chat-3B.gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M
- SGLang
How to use katanemo/Arch-Function-Chat-3B.gguf 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 "katanemo/Arch-Function-Chat-3B.gguf" \ --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": "katanemo/Arch-Function-Chat-3B.gguf", "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 "katanemo/Arch-Function-Chat-3B.gguf" \ --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": "katanemo/Arch-Function-Chat-3B.gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use katanemo/Arch-Function-Chat-3B.gguf with Ollama:
ollama run hf.co/katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M
- Unsloth Studio new
How to use katanemo/Arch-Function-Chat-3B.gguf 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 katanemo/Arch-Function-Chat-3B.gguf 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 katanemo/Arch-Function-Chat-3B.gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for katanemo/Arch-Function-Chat-3B.gguf to start chatting
- Pi new
How to use katanemo/Arch-Function-Chat-3B.gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf katanemo/Arch-Function-Chat-3B.gguf: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": "katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use katanemo/Arch-Function-Chat-3B.gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf katanemo/Arch-Function-Chat-3B.gguf: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 katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use katanemo/Arch-Function-Chat-3B.gguf with Docker Model Runner:
docker model run hf.co/katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M
- Lemonade
How to use katanemo/Arch-Function-Chat-3B.gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull katanemo/Arch-Function-Chat-3B.gguf:Q4_K_M
Run and chat with the model
lemonade run user.Arch-Function-Chat-3B.gguf-Q4_K_M
List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf katanemo/Arch-Function-Chat-3B.gguf:# Run inference directly in the terminal:
llama-cli -hf katanemo/Arch-Function-Chat-3B.gguf: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 katanemo/Arch-Function-Chat-3B.gguf:# Run inference directly in the terminal:
./llama-cli -hf katanemo/Arch-Function-Chat-3B.gguf: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 katanemo/Arch-Function-Chat-3B.gguf:# Run inference directly in the terminal:
./build/bin/llama-cli -hf katanemo/Arch-Function-Chat-3B.gguf:Use Docker
docker model run hf.co/katanemo/Arch-Function-Chat-3B.gguf:katanemo/Arch-Function-Chat-3B
Overview
The Arch-Function-Chat collection builds upon the Katanemo's Arch-Function collection by extending its capabilities beyond function calling. This new collection maintains the state-of-the-art(SOTA) function calling performance of the original collection while adding powerful new features that make it even more versatile in real-world applications.
In addition to function calling capabilities, this collection now offers:
- Clarify & refine: Generates natural follow-up questions to collect missing information for function calling
- Interpret & respond: Provides human-friendly responses based on function execution results
- Context management: Mantains context in complex multi-turn interactions
Note: Arch-Function-Chat is now the primarly LLM used in then open source Arch Gateway - An AI-native proxy for agents. For more details about the project, check out the Github README.
Requirements
The code of Arch-Function-Chat-3B has been in the Hugging Face transformers library and we advise you to install latest version:
pip install transformers>=4.37.0
How to use
We use the following example to illustrate how to use our model to perform function calling tasks. Please note that, our model works best with our provided prompt format. It allows us to extract JSON output that is similar to the OpenAI's function calling.
Quickstart
import json
from typing import Any, Dict, List
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "katanemo/Arch-Function-Chat-3B"
model = AutoModelForCausalLM.from_pretrained(
model_name, device_map="auto", torch_dtype="auto", trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Please use our provided prompt for best performance
TASK_PROMPT = (
"You are a helpful assistant designed to assist with the user query by making one or more function calls if needed."
"\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>\n{tools}\n</tools>"
"\n\nYour task is to decide which functions are needed and collect missing parameters if necessary."
)
FORMAT_PROMPT = (
"\n\nBased on your analysis, provide your response in one of the following JSON formats:"
'\n1. If no functions are needed:\n```json\n{"response": "Your response text here"}\n```'
'\n2. If functions are needed but some required parameters are missing:\n```json\n{"required_functions": ["func_name1", "func_name2", ...], "clarification": "Text asking for missing parameters"}\n```'
'\n3. If functions are needed and all required parameters are available:\n```json\n{"tool_calls": [{"name": "func_name1", "arguments": {"argument1": "value1", "argument2": "value2"}},... (more tool calls as required)]}\n```'
)
# Define available tools
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "str",
"description": "The city and state, e.g. San Francisco, New York",
},
"unit": {
"type": "str",
"enum": ["celsius", "fahrenheit"],
"description": "The unit of temperature to return",
},
},
"required": ["location"],
},
},
}
]
# Helper function to create the system prompt for our model
def format_prompt(tools: List[Dict[str, Any]]):
tools = "\n".join(
[json.dumps(tool["function"], ensure_ascii=False) for tool in tools]
)
return TASK_PROMPT.format(tools=tools) + FORMAT_PROMPT
system_prompt = format_prompt(tools)
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": "What is the weather in Seattle?"},
]
model_inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)
generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
generated_ids = [
output_ids[len(input_ids) :]
for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
License
Katanemo Arch-Function collection is distributed under the Katanemo license.
- Downloads last month
- 164
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf katanemo/Arch-Function-Chat-3B.gguf:# Run inference directly in the terminal: llama-cli -hf katanemo/Arch-Function-Chat-3B.gguf: