khaimai commited on
Commit
6f7ed43
1 Parent(s): 1753889

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +85 -3
README.md CHANGED
@@ -1,3 +1,85 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+ # Model Card for functionary-small-v2.5
5
+
6
+ [https://github.com/MeetKai/functionary](https://github.com/MeetKai/functionary)
7
+
8
+ ![Functionary Logo](https://huggingface.co/meetkai/functionary-medium-v2.2/resolve/main/functionary_logo.jpg "Functionary Logo")
9
+
10
+ Functionary is a language model that can interpret and execute functions/plugins.
11
+
12
+ The model determines when to execute functions, whether in parallel or serially, and can understand their outputs. It only triggers functions as needed. Function definitions are given as JSON Schema Objects, similar to OpenAI GPT function calls.
13
+
14
+ ## Key Features
15
+
16
+ - Intelligent **parallel tool use**
17
+ - Able to analyze functions/tools outputs and provide relevant responses **grounded in the outputs**
18
+ - Able to decide **when to not use tools/call functions** and provide normal chat response
19
+ - Truly one of the best open-source alternative to GPT-4
20
+ - Support code interpreter
21
+
22
+ ## Prompt Template
23
+
24
+ We convert function definitions to a similar text to TypeScript definitions. Then we inject these definitions as system prompts. After that, we inject the default system prompt. Then we start the conversation messages.
25
+
26
+ This formatting is also available via our vLLM server which we process the functions into Typescript definitions encapsulated in a system message and use a pre-defined Transformers chat template. This means that lists of messages can be formatted for you with the apply_chat_template() method within our server:
27
+
28
+ ```python
29
+ from openai import OpenAI
30
+
31
+ client = OpenAI(base_url="http://localhost:8000/v1", api_key="functionary")
32
+
33
+ client.chat.completions.create(
34
+ model="path/to/functionary/model/",
35
+ messages=[{"role": "user",
36
+ "content": "What is the weather for Istanbul?"}
37
+ ],
38
+ tools=[{
39
+ "type": "function",
40
+ "function": {
41
+ "name": "get_current_weather",
42
+ "description": "Get the current weather",
43
+ "parameters": {
44
+ "type": "object",
45
+ "properties": {
46
+ "location": {
47
+ "type": "string",
48
+ "description": "The city and state, e.g. San Francisco, CA"
49
+ }
50
+ },
51
+ "required": ["location"]
52
+ }
53
+ }
54
+ }],
55
+ tool_choice="auto"
56
+ )
57
+ ```
58
+
59
+ will yield:
60
+
61
+ ```
62
+ <|start_header_id|>system<|end_header_id|>
63
+
64
+ // Supported function definitions that should be called when necessary.
65
+ namespace functions {
66
+
67
+ // Get the current weather
68
+ type get_current_weather = (_: {
69
+ // The city and state, e.g. San Francisco, CA
70
+ location: string,
71
+ }) => any;
72
+
73
+ } // namespace functions<|eot_id|><|start_header_id|>user<|end_header_id|>
74
+
75
+ What is the weather for Istanbul?
76
+ ```
77
+
78
+ A more detailed example is provided [here](https://github.com/MeetKai/functionary/blob/main/tests/prompt_test_v2.llama3.txt).
79
+
80
+ ## Run the model
81
+
82
+ We encourage users to run our models using our OpenAI-compatible vLLM server [here](https://github.com/MeetKai/functionary).
83
+
84
+ # The MeetKai Team
85
+ ![MeetKai Logo](https://huggingface.co/meetkai/functionary-medium-v2.2/resolve/main/meetkai_logo.png "MeetKai Logo")