2024-03-22 20:13:11 +00:00
name : gpt-4
2024-03-21 00:12:20 +00:00
mmap : true
parameters :
2024-03-31 11:04:09 +00:00
model : huggingface://NousResearch/Hermes-2-Pro-Mistral-7B-GGUF/Hermes-2-Pro-Mistral-7B.Q2_K.gguf
2024-03-21 00:12:20 +00:00
template :
2024-03-22 20:13:11 +00:00
chat_message : |
2024-03-31 11:04:09 +00:00
<|im_start|>{{if eq .RoleName "assistant"}}assistant{{else if eq .RoleName "system"}}system{{else if eq .RoleName "tool"}}tool{{else if eq .RoleName "user"}}user{{end}}
2024-04-19 16:23:44 +00:00
{{- if .FunctionCall }}
<tool_call>
{{- else if eq .RoleName "tool" }}
<tool_response>
{{- end }}
2024-04-07 16:23:47 +00:00
{{- if .Content}}
2024-04-19 16:23:44 +00:00
{{.Content }}
{{- end }}
{{- if .FunctionCall}}
{{toJson .FunctionCall}}
{{- end }}
{{- if .FunctionCall }}
</tool_call>
{{- else if eq .RoleName "tool" }}
</tool_response>
2024-04-24 23:28:02 +00:00
{{- end }}<|im_end|>
2024-03-31 11:04:09 +00:00
# https://huggingface.co/NousResearch/Hermes-2-Pro-Mistral-7B-GGUF#prompt-format-for-function-calling
function : |
<|im_start|>system
You are a function calling AI model. You are provided with function signatures within <tools></tools> XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools :
<tools>
{{range .Functions}}
{'type': 'function', 'function' : {'name' : '{{.Name}}' , 'description' : '{{.Description}}' , 'parameters' : {{toJson .Parameters}} }}
{{end}}
</tools>
Use the following pydantic model json schema for each tool call you will make :
{'title': 'FunctionCall', 'type': 'object', 'properties' : {'arguments' : {'title': 'Arguments', 'type': 'object'}, 'name' : {'title': 'Name', 'type': 'string'}}, 'required' : [ 'arguments' , 'name' ] }
For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags as follows :
<tool_call>
{'arguments': <args-dict>, 'name' : <function-name>}
2024-04-24 23:28:02 +00:00
</tool_call><|im_end|>
2024-04-07 16:23:47 +00:00
{{.Input -}}
2024-03-31 11:04:09 +00:00
<|im_start|>assistant
<tool_call>
2024-03-22 20:13:11 +00:00
chat : |
2024-04-07 16:23:47 +00:00
{{.Input -}}
2024-03-22 20:13:11 +00:00
<|im_start|>assistant
completion : |
{{.Input}}
2024-03-31 11:04:09 +00:00
context_size : 4096
2024-03-22 20:13:11 +00:00
f16 : true
stopwords :
- <|im_end|>
- <dummy32000>
2024-04-01 09:48:35 +00:00
- "\n</tool_call>"
2024-04-02 13:38:00 +00:00
- "\n\n\n"
2024-03-21 00:12:20 +00:00
usage : |
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
2024-03-31 11:04:09 +00:00
"model": "gpt-4" ,
2024-03-21 00:12:20 +00:00
"messages": [{"role": "user", "content": "How are you doing?", "temperature": 0.1 }]
}'