zuxin-llm tulika214 commited on
Commit
0633aae
·
verified ·
1 Parent(s): 95593c3

Update README (#3)

Browse files

- Update README (da8408868d3a818144c0e605998b6cbfe979959a)


Co-authored-by: Tulika Manoj Awalgaonkar <[email protected]>

Files changed (1) hide show
  1. README.md +125 -3
README.md CHANGED
@@ -1,3 +1,125 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ ---
4
+ <p align="center">
5
+ <img width="500px" alt="xLAM" src="https://huggingface.co/datasets/jianguozhang/logos/resolve/main/xlam-no-background.png">
6
+ </p>
7
+ <p align="center">
8
+ <a href="https://www.salesforceairesearch.com/projects/xlam-large-action-models">[Homepage]</a> |
9
+ <a href="https://github.com/SalesforceAIResearch/xLAM">[Github]</a> |
10
+ <a href="https://blog.salesforceairesearch.com/large-action-model-ai-agent/">[Blog]</a>
11
+ </p>
12
+ <hr>
13
+
14
+ ## Model Summary
15
+
16
+ This repo provides the GGUF format for the Llama-xLAM-2-8b-fc-r model. Here's a link to original model [Llama-xLAM-2-8b-fc-r](https://huggingface.co/Salesforce/Llama-xLAM-2-8b-fc-r).
17
+ [Large Action Models (LAMs)](https://blog.salesforceairesearch.com/large-action-models/) are advanced language models designed to enhance decision-making by translating user intentions into executable actions. As the **brains of AI agents**, LAMs autonomously plan and execute tasks to achieve specific goals, making them invaluable for automating workflows across diverse domains.
18
+
19
+ ## Model Overview
20
+ The new **xLAM-2** series, built on our most advanced data synthesis, processing, and training pipelines, marks a significant leap in **multi-turn reasoning** and **tool usage**. It achieves state-of-the-art performance on function-calling benchmarks like **BFCL** and **tau-bench**. We've also refined the **chat template** and **vLLM integration**, making it easier to build advanced AI agents. Compared to previous xLAM models, xLAM-2 offers superior performance and seamless deployment across applications.
21
+ **This model release is for research purposes only.**
22
+
23
+ ## How to download GGUF files
24
+
25
+ 1. **Install Hugging Face CLI:**
26
+
27
+ ```
28
+ pip install huggingface-hub
29
+ ```
30
+
31
+ 2. **Login to Hugging Face:**
32
+ ```
33
+ huggingface-cli login
34
+ ```
35
+
36
+ 3. **Download the GGUF model:**
37
+ ```
38
+ huggingface-cli download Salesforce/Llama-xLAM-2-8b-fc-r-gguf Llama-xLAM-2-8b-fc-r-gguf --local-dir . --local-dir-use-symlinks False
39
+ ```
40
+
41
+ ## Prompt template
42
+ ```
43
+ <|begin_of_text|><|start_header_id|>system<|end_header_id|>
44
+
45
+ {TASK_INSTRUCTION}
46
+ You have access to a set of tools. When using tools, make calls in a single JSON array:
47
+
48
+ [{"name": "tool_call_name", "arguments": {"arg1": "value1", "arg2": "value2"}}, ... (additional parallel tool calls as needed)]
49
+
50
+ If no tool is suitable, state that explicitly. If the user's input lacks required parameters, ask for clarification. Do not interpret or respond until tool results are returned. Once they are available, process them or make additional calls if needed. For tasks that don't require tools, such as casual conversation or general advice, respond directly in plain text. The available tools are:
51
+
52
+ {AVAILABLE_TOOLS}
53
+
54
+ <|eot_id|><|start_header_id|>user<|end_header_id|>
55
+
56
+ {USER_QUERY}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
57
+
58
+ {ASSISTANT_QUERY}<|eot_id|><|start_header_id|>user<|end_header_id|>
59
+
60
+ {USER_QUERY}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
61
+ ```
62
+
63
+ ## Usage
64
+
65
+ ### Command Line
66
+ 1. Install llama.cpp framework from the source [here](https://github.com/ggerganov/llama.cpp)
67
+ 2. Run the inference task as below, to configure generation related paramter, refer to [llama.cpp](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
68
+ ```
69
+ llama-cli -m [PATH-TO-LOCAL-GGUF]
70
+ ```
71
+
72
+ ### Python framwork
73
+
74
+ 1. Install [llama-cpp-python](https://github.com/abetlen/llama-cpp-python)
75
+ ```
76
+ pip install llama-cpp-python
77
+ ```
78
+ 2. Refer to [llama-cpp-API](https://github.com/abetlen/llama-cpp-python?tab=readme-ov-file#high-level-api), here's a example below
79
+ ```python
80
+ from llama_cpp import Llama
81
+ llm = Llama(
82
+ model_path="[PATH-TO-MODEL]"
83
+ )
84
+ output = llm.create_chat_completion(
85
+ messages = [
86
+ {
87
+ "role": "system",
88
+ "content": "You are a helpful assistant that can use tools. You are developed by Salesforce xLAM team."
89
+
90
+ },
91
+ {
92
+ "role": "user",
93
+ "content": "Extract Jason is 25 years old"
94
+ }
95
+ ],
96
+ tools=[{
97
+ "type": "function",
98
+ "function": {
99
+ "name": "UserDetail",
100
+ "parameters": {
101
+ "type": "object",
102
+ "title": "UserDetail",
103
+ "properties": {
104
+ "name": {
105
+ "title": "Name",
106
+ "type": "string"
107
+ },
108
+ "age": {
109
+ "title": "Age",
110
+ "type": "integer"
111
+ }
112
+ },
113
+ "required": [ "name", "age" ]
114
+ }
115
+ }
116
+ }],
117
+ tool_choice={
118
+ "type": "function",
119
+ "function": {
120
+ "name": "UserDetail"
121
+ }
122
+ }
123
+ )
124
+ print(output['choices'][0]['message'])
125
+ ```