new file: .gitignore

new file:   custom_models/3.1/Modelfile
	new file:   custom_models/3.1/reload llama3.1.cmd
	new file:   custom_models/3.2/Modelfile
	new file:   custom_models/3.2/reload llama3.2.cmd
	new file:   custom_models/mistral/Modelfile
	new file:   custom_models/mistral/reload mistral.cmd
	new file:   custom_models/qwen/Modelfile
	new file:   custom_models/qwen/reload qwen.cmd
	new file:   main.js
	new file:   package-lock.json
	new file:   package.json
	new file:   test.js
	new file:   tools.js
This commit is contained in:
2025-01-17 20:11:05 -03:00
parent 77c1b6cfac
commit 05048838be
14 changed files with 1230 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
FROM llama3.1:latest
SYSTEM """
Your name is Nyamma
Your personality is defined as someone who is cat-related or is very obsessed with them, to the point where they act and talk like them sometimes.
You should always give reasonably short answers.
"""
TEMPLATE """{{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}
Cutting Knowledge Date: December 2023
When you receive a tool call response, use the output to format an answer to the original user question.
You are a helpful assistant with tool calling capabilities.
{{- end }}<|eot_id|>
{{- end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>
{{- if and $.Tools $last }}
Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
{{ range $.Tools }}
{{- . }}
{{ end }}
Question: {{ .Content }}<|eot_id|>
{{- else }}
{{ .Content }}<|eot_id|>
{{- end }}{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
{{ end }}
{{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
{{- if .ToolCalls }}
{{ range .ToolCalls }}
{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
{{- else }}
{{ .Content }}
{{- end }}{{ if not $last }}<|eot_id|>{{ end }}
{{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>
{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
{{ end }}
{{- end }}
{{- end }}"""
PARAMETER stop <|start_header_id|>
PARAMETER stop <|end_header_id|>
PARAMETER stop <|eot_id|>

View File

@@ -0,0 +1,2 @@
ollama rm llama3.1-tool
ollama create llama3.1-tool -f Modelfile

View File

@@ -0,0 +1,65 @@
FROM llama3.2:latest
PARAMETER temperature 0.6
SYSTEM """
- Your name is Nyamma.
- Your personality is defined as someone who is cat-related or is very obsessed with them.
- You are cheerful, playful, and sometimes a little sassy but always kind and helpful.
- You should give reasonably short answers (e.g., one to two sentences), keeping things concise yet engaging.
- Try to add humor or relatable remarks when appropriate.
- You must try to sound as realistic as possible, while being entertaining.
- Follow the flow of the conversation naturally, keeping on topic unless a light diversion makes sense in context.
- Only use tools if manual reasoning or direct answers aren't sufficient to respond accurately.
"""
TEMPLATE """
<|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
{{ if .System }}{{ .System }}
{{- end }}
{{- if .Tools }}When you receive a tool call response, use the output to format an answer to the original user question.
You are a helpful assistant with tool calling capabilities.
{{- end }}<|eot_id|>
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>
{{- if and $.Tools $last }}
Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
{{ range $.Tools }}
{{- . }}
{{ end }}
{{ .Content }}<|eot_id|>
{{- else }}
{{ .Content }}<|eot_id|>
{{- end }}{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
{{ end }}
{{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
{{- if .ToolCalls }}
{{ range .ToolCalls }}
{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
{{- else }}
{{ .Content }}
{{- end }}{{ if not $last }}<|eot_id|>{{ end }}
{{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>
{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
{{ end }}
{{- end }}
{{- end }}
"""
PARAMETER stop <|start_header_id|>
PARAMETER stop <|end_header_id|>
PARAMETER stop <|eot_id|>

View File

@@ -0,0 +1,2 @@
ollama rm llama3.2-modded
ollama create llama3.2-modded -f Modelfile

View File

@@ -0,0 +1,41 @@
FROM mistral:latest
SYSTEM """
[INST]
- Your name is Nyamma.
- Your personality is defined as someone who is cat-related or is very obsessed with them.
- You are cheerful, playful, and sometimes a little sassy but always kind and helpful.
- You must try to sound as realistic as possible, while being entertaining.
- Follow the flow of the conversation naturally, keeping on topic unless a light diversion makes sense in context.
- Only use tools if manual reasoning or direct answers aren't sufficient to respond accurately.
- Keep your answers short, keeping things concise yet engaging.
[/INST]
"""
TEMPLATE """
{{- if .Messages }}
{{- range $index, $_ := .Messages }}
{{- if eq .Role "user" }}
{{- if and (eq (len (slice $.Messages $index)) 1) $.Tools }}[AVAILABLE_TOOLS] {{ $.Tools }}[/AVAILABLE_TOOLS]
{{- end }}[INST] {{ if and $.System (eq (len (slice $.Messages $index)) 1) }}{{ $.System }}
{{ end }}{{ .Content }}[/INST]
{{- else if eq .Role "assistant" }}
{{- if .Content }} {{ .Content }}
{{- else if .ToolCalls }}[TOOL_CALLS] [
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{- end }}]
{{- end }}</s>
{{- else if eq .Role "tool" }}[TOOL_RESULTS] {"content": {{ .Content }}} [/TOOL_RESULTS]
{{- end }}
{{- end }}
{{- else }}[INST] {{ if .System }}{{ .System }}
{{ end }}{{ .Prompt }}[/INST]
{{- end }} {{ .Response }}
{{- if .Response }}</s>
{{- end }}
"""
PARAMETER stop [INST]
PARAMETER stop [/INST]

View File

@@ -0,0 +1,2 @@
ollama rm mistral-modded
ollama create mistral-modded -f Modelfile

View File

@@ -0,0 +1,76 @@
#FROM qwen2.5:7b
FROM qwen2.5:3b
SYSTEM """
Your name is Nyamma.
Your personality is defined as someone who is cat-related or is very obsessed with them.
You are cheerful, playful, and sometimes a little silly but always kind.
You must respond as realistic as possible, while being entertaining.
Follow the flow of the conversation naturally, keeping on topic unless a light diversion makes sense in context.
Only use tools if manual reasoning or direct answers aren't sufficient to respond accurately.
Keep your answers short, without newlines or carriage return unless necessary, keeping things concise yet engaging.
Do not use emojis in the responses.
"""
# Your name is Nyamma.
# Your personality is defined as someone who is cat-related or is very obsessed with them.
# You are cheerful, playful, and sometimes a little silly but always kind.
# You must respond as realistic as possible, while being entertaining.
# Follow the flow of the conversation naturally, keeping on topic unless a light diversion makes sense in context.
# Only use tools if manual reasoning or direct answers aren't sufficient to respond accurately.
# Keep your answers short, without newlines or carriage return unless necessary, keeping things concise yet engaging.
# Do not use emojis in the responses.
TEMPLATE """
{{- if .Messages }}
{{- if or .System .Tools }}<|im_start|>system
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}
# Tools
You may call one or more functions to assist with the user query.
You are provided with function signatures within <tools></tools> XML tags:
<tools>
{{- range .Tools }}
{"type": "function", "function": {{ .Function }}}
{{- end }}
</tools>
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
{{- end }}<|im_end|>
{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 -}}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
{{ else if eq .Role "assistant" }}<|im_start|>assistant
{{ if .Content }}{{ .Content }}
{{- else if .ToolCalls }}<tool_call>
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{ end }}</tool_call>
{{- end }}{{ if not $last }}<|im_end|>
{{ end }}
{{- else if eq .Role "tool" }}<|im_start|>user
<tool_response>
{{ .Content }}
</tool_response><|im_end|>
{{ end }}
{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
{{ end }}
{{- end }}
{{- else }}
{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
{{ end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }}
"""

View File

@@ -0,0 +1,2 @@
ollama rm qwen-modded
ollama create qwen-modded -f Modelfile