Instructions to use katanemo/Arch-Function-Chat-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use katanemo/Arch-Function-Chat-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="katanemo/Arch-Function-Chat-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("katanemo/Arch-Function-Chat-7B") model = AutoModelForCausalLM.from_pretrained("katanemo/Arch-Function-Chat-7B") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use katanemo/Arch-Function-Chat-7B 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-7B" # 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-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/katanemo/Arch-Function-Chat-7B
- SGLang
How to use katanemo/Arch-Function-Chat-7B 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-7B" \ --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-7B", "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-7B" \ --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-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use katanemo/Arch-Function-Chat-7B with Docker Model Runner:
docker model run hf.co/katanemo/Arch-Function-Chat-7B
Using Arch-Function-Chat with Llama.cpp
Hi,
Could you please tell me what is the proper way of using this model with llama.cpp?
The chat template defined in the tokenizer_config.json is the default qwen-2.5 chat template and this is the chat template that is used with the GGUF files loaded by llama.cpp. However in the example in the model card, it seems the system prompt is formatted differently from what is standard to qwen-2.5. So, should I use the default chat template generated by llama.cpp (based on the qwen-2.5 chat template) or I have to use the format in the model card? Since if I pass the tool descriptions to the chat completion api of llama.cpp, it would format them using the chat template which is different from what is used in the model card.
Also could you please tell me how multi-turn conversations should be constructed? I want to use the model in a conversation scenario where the tool responses should be sent back to the model to generate proper responses. As I see in the qwen chat template, there is a role called tool which we have to use to specify the tool responses, is it also the way the this model works?
For llama.cpp, you don't have to change anything, simply use the same chat template. If you want to use this model for function calling, make sure you include a system message in the format we provided (see usage for more detail). To construct multi-turn conversations, you can simply use that chat template as well. Nothing needs to be changed. The role tool will work.