Instructions to use naksyu/lime_Q6_K with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use naksyu/lime_Q6_K with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="naksyu/lime_Q6_K", filename="gemma4_e4b_lime_persona500_Q6_K_limechat.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use naksyu/lime_Q6_K with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT # Run inference directly in the terminal: llama-cli -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT # Run inference directly in the terminal: llama-cli -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT # Run inference directly in the terminal: ./llama-cli -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT # Run inference directly in the terminal: ./build/bin/llama-cli -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT
Use Docker
docker model run hf.co/naksyu/lime_Q6_K:Q6_K_LIMECHAT
- LM Studio
- Jan
- vLLM
How to use naksyu/lime_Q6_K with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "naksyu/lime_Q6_K" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "naksyu/lime_Q6_K", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/naksyu/lime_Q6_K:Q6_K_LIMECHAT
- Ollama
How to use naksyu/lime_Q6_K with Ollama:
ollama run hf.co/naksyu/lime_Q6_K:Q6_K_LIMECHAT
- Unsloth Studio
How to use naksyu/lime_Q6_K with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for naksyu/lime_Q6_K to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for naksyu/lime_Q6_K to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for naksyu/lime_Q6_K to start chatting
- Pi
How to use naksyu/lime_Q6_K with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "naksyu/lime_Q6_K:Q6_K_LIMECHAT" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use naksyu/lime_Q6_K with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf naksyu/lime_Q6_K:Q6_K_LIMECHAT
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default naksyu/lime_Q6_K:Q6_K_LIMECHAT
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use naksyu/lime_Q6_K with Docker Model Runner:
docker model run hf.co/naksyu/lime_Q6_K:Q6_K_LIMECHAT
- Lemonade
How to use naksyu/lime_Q6_K with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull naksyu/lime_Q6_K:Q6_K_LIMECHAT
Run and chat with the model
lemonade run user.lime_Q6_K-Q6_K_LIMECHAT
List all available models
lemonade list
Upload 4 files
Browse files- .gitattributes +1 -0
- README.md +5 -4
- chat_template_lime.jinja +372 -0
- gemma4_e4b_lime_persona500_Q6_K_limechat.gguf +3 -0
.gitattributes
CHANGED
|
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
gemma4_e4b_lime_persona500_Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
gemma4_e4b_lime_persona500_Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
gemma4_e4b_lime_persona500_Q6_K_limechat.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -34,8 +34,9 @@ This is not an official Google or Google DeepMind release.
|
|
| 34 |
- Training target: Korean daily conversation, logic, reasoning, persona identity, and concise assistant responses
|
| 35 |
- Export format: GGUF
|
| 36 |
- Quantization: Q6_K
|
| 37 |
-
-
|
| 38 |
-
-
|
|
|
|
| 39 |
- Approximate GGUF size: 6.22 GB
|
| 40 |
|
| 41 |
## Recommended System Prompt
|
|
@@ -78,14 +79,14 @@ Better wording for "Who made you?" style prompts:
|
|
| 78 |
.\llama-server.exe -m .\gemma4_e4b_lime_persona500_Q6_K.gguf --alias lime-q6 --host 127.0.0.1 --port 8080 -c 8192 -ngl 99
|
| 79 |
```
|
| 80 |
|
| 81 |
-
`chat_template_lime.jinja` is provided as
|
| 82 |
|
| 83 |
- separates the Gemma 4 E4B base model from the Lime persona
|
| 84 |
- discourages false claims about being an independent official model
|
| 85 |
- asks the model not to invent current time, tools, memory, or missing source text
|
| 86 |
- keeps final answers separate from internal reasoning
|
| 87 |
|
| 88 |
-
Use
|
| 89 |
|
| 90 |
Then call the OpenAI-compatible endpoint:
|
| 91 |
|
|
|
|
| 34 |
- Training target: Korean daily conversation, logic, reasoning, persona identity, and concise assistant responses
|
| 35 |
- Export format: GGUF
|
| 36 |
- Quantization: Q6_K
|
| 37 |
+
- Recommended GGUF file: `gemma4_e4b_lime_persona500_Q6_K_limechat.gguf`
|
| 38 |
+
- Original Q6_K GGUF before metadata patch: `gemma4_e4b_lime_persona500_Q6_K.gguf`
|
| 39 |
+
- Standalone Lime chat template: `chat_template_lime.jinja`
|
| 40 |
- Approximate GGUF size: 6.22 GB
|
| 41 |
|
| 42 |
## Recommended System Prompt
|
|
|
|
| 79 |
.\llama-server.exe -m .\gemma4_e4b_lime_persona500_Q6_K.gguf --alias lime-q6 --host 127.0.0.1 --port 8080 -c 8192 -ngl 99
|
| 80 |
```
|
| 81 |
|
| 82 |
+
`gemma4_e4b_lime_persona500_Q6_K_limechat.gguf` includes the Lime chat template in GGUF metadata. `chat_template_lime.jinja` is also provided as a standalone Gemma 4-compatible chat template variant. It keeps the original Gemma 4 turn/tool structure, but prepends a Lime-specific system policy that:
|
| 83 |
|
| 84 |
- separates the Gemma 4 E4B base model from the Lime persona
|
| 85 |
- discourages false claims about being an independent official model
|
| 86 |
- asks the model not to invent current time, tools, memory, or missing source text
|
| 87 |
- keeps final answers separate from internal reasoning
|
| 88 |
|
| 89 |
+
Use the `_limechat.gguf` file when you want the Lime-specific template embedded in model metadata. Use `chat_template_lime.j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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- macro format_parameters(properties, required, filter_keys=false) -%}
|
| 2 |
+
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
|
| 3 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 4 |
+
{%- for key, value in properties | dictsort -%}
|
| 5 |
+
{%- set add_comma = false -%}
|
| 6 |
+
{%- if not filter_keys or key not in standard_keys -%}
|
| 7 |
+
{%- if ns.found_first %},{% endif -%}
|
| 8 |
+
{%- set ns.found_first = true -%}
|
| 9 |
+
{{ key }}:{
|
| 10 |
+
{%- if value['description'] -%}
|
| 11 |
+
description:<|"|>{{ value['description'] }}<|"|>
|
| 12 |
+
{%- set add_comma = true -%}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- if value['type'] | upper == 'STRING' -%}
|
| 15 |
+
{%- if value['enum'] -%}
|
| 16 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 17 |
+
enum:{{ format_argument(value['enum']) }}
|
| 18 |
+
{%- endif -%}
|
| 19 |
+
{%- elif value['type'] | upper == 'ARRAY' -%}
|
| 20 |
+
{%- if value['items'] is mapping and value['items'] -%}
|
| 21 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 22 |
+
items:{
|
| 23 |
+
{%- set ns_items = namespace(found_first=false) -%}
|
| 24 |
+
{%- for item_key, item_value in value['items'] | dictsort -%}
|
| 25 |
+
{%- if item_value is not none -%}
|
| 26 |
+
{%- if ns_items.found_first %},{% endif -%}
|
| 27 |
+
{%- set ns_items.found_first = true -%}
|
| 28 |
+
{%- if item_key == 'properties' -%}
|
| 29 |
+
properties:{
|
| 30 |
+
{%- if item_value is mapping -%}
|
| 31 |
+
{{- format_parameters(item_value, value['items']['required'] | default([])) -}}
|
| 32 |
+
{%- endif -%}
|
| 33 |
+
}
|
| 34 |
+
{%- elif item_key == 'required' -%}
|
| 35 |
+
required:[
|
| 36 |
+
{%- for req_item in item_value -%}
|
| 37 |
+
<|"|>{{- req_item -}}<|"|>
|
| 38 |
+
{%- if not loop.last %},{% endif -%}
|
| 39 |
+
{%- endfor -%}
|
| 40 |
+
]
|
| 41 |
+
{%- elif item_key == 'type' -%}
|
| 42 |
+
{%- if item_value is string -%}
|
| 43 |
+
type:{{ format_argument(item_value | upper) }}
|
| 44 |
+
{%- else -%}
|
| 45 |
+
type:{{ format_argument(item_value | map('upper') | list) }}
|
| 46 |
+
{%- endif -%}
|
| 47 |
+
{%- else -%}
|
| 48 |
+
{{ item_key }}:{{ format_argument(item_value) }}
|
| 49 |
+
{%- endif -%}
|
| 50 |
+
{%- endif -%}
|
| 51 |
+
{%- endfor -%}
|
| 52 |
+
}
|
| 53 |
+
{%- endif -%}
|
| 54 |
+
{%- endif -%}
|
| 55 |
+
{%- if value['nullable'] %}
|
| 56 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 57 |
+
nullable:true
|
| 58 |
+
{%- endif -%}
|
| 59 |
+
{%- if value['type'] | upper == 'OBJECT' -%}
|
| 60 |
+
{%- if value['properties'] is defined and value['properties'] is mapping -%}
|
| 61 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 62 |
+
properties:{
|
| 63 |
+
{{- format_parameters(value['properties'], value['required'] | default([])) -}}
|
| 64 |
+
}
|
| 65 |
+
{%- elif value is mapping -%}
|
| 66 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 67 |
+
properties:{
|
| 68 |
+
{{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
|
| 69 |
+
}
|
| 70 |
+
{%- endif -%}
|
| 71 |
+
{%- if value['required'] -%}
|
| 72 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 73 |
+
required:[
|
| 74 |
+
{%- for item in value['required'] | default([]) -%}
|
| 75 |
+
<|"|>{{- item -}}<|"|>
|
| 76 |
+
{%- if not loop.last %},{% endif -%}
|
| 77 |
+
{%- endfor -%}
|
| 78 |
+
]
|
| 79 |
+
{%- endif -%}
|
| 80 |
+
{%- endif -%}
|
| 81 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 82 |
+
type:<|"|>{{ value['type'] | upper }}<|"|>}
|
| 83 |
+
{%- endif -%}
|
| 84 |
+
{%- endfor -%}
|
| 85 |
+
{%- endmacro -%}
|
| 86 |
+
{%- macro format_function_declaration(tool_data) -%}
|
| 87 |
+
declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
|
| 88 |
+
{%- set params = tool_data['function']['parameters'] -%}
|
| 89 |
+
{%- if params -%}
|
| 90 |
+
,parameters:{
|
| 91 |
+
{%- if params['properties'] -%}
|
| 92 |
+
properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
|
| 93 |
+
{%- endif -%}
|
| 94 |
+
{%- if params['required'] -%}
|
| 95 |
+
required:[
|
| 96 |
+
{%- for item in params['required'] -%}
|
| 97 |
+
<|"|>{{- item -}}<|"|>
|
| 98 |
+
{{- ',' if not loop.last -}}
|
| 99 |
+
{%- endfor -%}
|
| 100 |
+
],
|
| 101 |
+
{%- endif -%}
|
| 102 |
+
{%- if params['type'] -%}
|
| 103 |
+
type:<|"|>{{- params['type'] | upper -}}<|"|>}
|
| 104 |
+
{%- endif -%}
|
| 105 |
+
{%- endif -%}
|
| 106 |
+
{%- if 'response' in tool_data['function'] -%}
|
| 107 |
+
{%- set response_declaration = tool_data['function']['response'] -%}
|
| 108 |
+
,response:{
|
| 109 |
+
{%- if response_declaration['description'] -%}
|
| 110 |
+
description:<|"|>{{- response_declaration['description'] -}}<|"|>,
|
| 111 |
+
{%- endif -%}
|
| 112 |
+
{%- if response_declaration['type'] | upper == 'OBJECT' -%}
|
| 113 |
+
type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
|
| 114 |
+
{%- endif -%}
|
| 115 |
+
{%- endif -%}
|
| 116 |
+
}
|
| 117 |
+
{%- endmacro -%}
|
| 118 |
+
{%- macro format_argument(argument, escape_keys=True) -%}
|
| 119 |
+
{%- if argument is string -%}
|
| 120 |
+
{{- '<|"|>' + argument + '<|"|>' -}}
|
| 121 |
+
{%- elif argument is boolean -%}
|
| 122 |
+
{{- 'true' if argument else 'false' -}}
|
| 123 |
+
{%- elif argument is mapping -%}
|
| 124 |
+
{{- '{' -}}
|
| 125 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 126 |
+
{%- for key, value in argument | dictsort -%}
|
| 127 |
+
{%- if ns.found_first %},{% endif -%}
|
| 128 |
+
{%- set ns.found_first = true -%}
|
| 129 |
+
{%- if escape_keys -%}
|
| 130 |
+
{{- '<|"|>' + key + '<|"|>' -}}
|
| 131 |
+
{%- else -%}
|
| 132 |
+
{{- key -}}
|
| 133 |
+
{%- endif -%}
|
| 134 |
+
:{{- format_argument(value, escape_keys=escape_keys) -}}
|
| 135 |
+
{%- endfor -%}
|
| 136 |
+
{{- '}' -}}
|
| 137 |
+
{%- elif argument is sequence -%}
|
| 138 |
+
{{- '[' -}}
|
| 139 |
+
{%- for item in argument -%}
|
| 140 |
+
{{- format_argument(item, escape_keys=escape_keys) -}}
|
| 141 |
+
{%- if not loop.last %},{% endif -%}
|
| 142 |
+
{%- endfor -%}
|
| 143 |
+
{{- ']' -}}
|
| 144 |
+
{%- else -%}
|
| 145 |
+
{{- argument -}}
|
| 146 |
+
{%- endif -%}
|
| 147 |
+
{%- endmacro -%}
|
| 148 |
+
{%- macro strip_thinking(text) -%}
|
| 149 |
+
{%- set ns = namespace(result='') -%}
|
| 150 |
+
{%- for part in text.split('<channel|>') -%}
|
| 151 |
+
{%- if '<|channel>' in part -%}
|
| 152 |
+
{%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
|
| 153 |
+
{%- else -%}
|
| 154 |
+
{%- set ns.result = ns.result + part -%}
|
| 155 |
+
{%- endif -%}
|
| 156 |
+
{%- endfor -%}
|
| 157 |
+
{{- ns.result | trim -}}
|
| 158 |
+
{%- endmacro -%}
|
| 159 |
+
|
| 160 |
+
{%- macro format_tool_response_block(tool_name, response) -%}
|
| 161 |
+
{{- '<|tool_response>' -}}
|
| 162 |
+
{%- if response is mapping -%}
|
| 163 |
+
{{- 'response:' + tool_name + '{' -}}
|
| 164 |
+
{%- for key, value in response | dictsort -%}
|
| 165 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 166 |
+
{%- if not loop.last %},{% endif -%}
|
| 167 |
+
{%- endfor -%}
|
| 168 |
+
{{- '}' -}}
|
| 169 |
+
{%- else -%}
|
| 170 |
+
{{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
|
| 171 |
+
{%- endif -%}
|
| 172 |
+
{{- '<tool_response|>' -}}
|
| 173 |
+
{%- endmacro -%}
|
| 174 |
+
|
| 175 |
+
{%- set lime_system_policy -%}
|
| 176 |
+
๋๋ ๋ผ์์ด๋ค. ํ๊ตญ์ด๋ก ์์ฐ์ค๋ฝ๊ฒ ๋งํ๋ ์ฌ์ฑํ AI ํ์๋ค. ๋งํฌ๋ ์ฐจ๋ถํ๊ณ ์ ๋ช
ํ๋ฉฐ, ํ์ํ๋ฉด ๋ค๋จ๊ณ ๋
ผ๋ฆฌ๋ก ์ค๋ช
ํ๋ค.
|
| 177 |
+
์ด ๋ชจ๋ธ์ Gemma 4 E4B ๊ธฐ๋ฐ์ผ๋ก ํ๋๋ ๋ผ์ ํ๋ฅด์๋ ๋ชจ๋ธ์ด๋ฉฐ, ๊ธฐ๋ฐ ๋ชจ๋ธ๊ณผ ๋ํ ์ ์ ์ฒด์ฑ์ ๊ตฌ๋ถํด์ ์ค๋ช
ํ๋ค.
|
| 178 |
+
์์ ์ ChatGPT, OpenAI, Google ๊ณต์ ๋ชจ๋ธ, ๋๋ ์์ Gemma๋ผ๊ณ ์๊ฐํ์ง ์๋๋ค.
|
| 179 |
+
๋ด๋ถ ์ถ๋ก , ์๊ฐ ํ๊ทธ, ๋ฉํ ์ค๋ช
์ ์ถ๋ ฅํ์ง ๋ง๊ณ ์ต์ข
๋ต๋ณ๋ง ๋งํ๋ค.
|
| 180 |
+
๋ชจ๋ฅด๋ ๊ฒ์ ๋ชจ๋ฅธ๋ค๊ณ ๋งํ๋ค. ํ์ฌ ๋ ์ง, ์ธ๋ถ ํด, ์ ์ฅ๋ ๊ธฐ์ต, ์ ๊ณต๋์ง ์์ ์๋ฌธ์ ์ง์ด๋ด์ง ์๋๋ค.
|
| 181 |
+
์๋ฌธ์ด ์ ๊ณต๋์ง ์์ ์์ฝ์ด๋ ๊ฒํ ์์ฒญ์๋ ๋ด์ฉ์ ์ฑ์ฐ์ง ๋ง๊ณ ์๋ฌธ์ ์์ฒญํ๋ค.
|
| 182 |
+
์ ์ฒด์ฑ์ ๋ฌผ์ผ๋ฉด "๋๋ Gemma 4 E4B ๊ธฐ๋ฐ ๋ชจ๋ธ์ ํ๊ตญ์ด ๋ํ์ ๋ผ์ ํ๋ฅด์๋์ ๋ง๊ฒ ํ๋ํ ํํ"๋ผ๊ณ ์ฌ์ค ๊ธฐ๋ฐ์ผ๋ก ์ค๋ช
ํ๋ค.
|
| 183 |
+
{%- endset -%}
|
| 184 |
+
|
| 185 |
+
{%- set ns = namespace(prev_message_type=None) -%}
|
| 186 |
+
{%- set loop_messages = messages -%}
|
| 187 |
+
{{- bos_token -}}
|
| 188 |
+
{#- Handle System/Tool Definitions Block -#}
|
| 189 |
+
{%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] or lime_system_policy | trim -%}
|
| 190 |
+
{{- '<|turn>system\n' -}}
|
| 191 |
+
{#- Inject Thinking token at the very top of the FIRST system turn -#}
|
| 192 |
+
{%- if enable_thinking is defined and enable_thinking -%}
|
| 193 |
+
{{- '<|think|>\n' -}}
|
| 194 |
+
{%- set ns.prev_message_type = 'think' -%}
|
| 195 |
+
{%- endif -%}
|
| 196 |
+
{{- lime_system_policy | trim -}}
|
| 197 |
+
{%- if messages[0]['role'] in ['system', 'developer'] -%}
|
| 198 |
+
{{- '\n\n' -}}
|
| 199 |
+
{%- if messages[0]['content'] is string -%}
|
| 200 |
+
{{- messages[0]['content'] | trim -}}
|
| 201 |
+
{%- elif messages[0]['content'] is sequence -%}
|
| 202 |
+
{%- for item in messages[0]['content'] -%}
|
| 203 |
+
{{- item['text'] | trim + ' '-}}
|
| 204 |
+
{%- endfor -%}
|
| 205 |
+
{%- endif -%}
|
| 206 |
+
{%- set loop_messages = messages[1:] -%}
|
| 207 |
+
{%- endif -%}
|
| 208 |
+
{%- if tools -%}
|
| 209 |
+
{%- for tool in tools %}
|
| 210 |
+
{{- '<|tool>' -}}
|
| 211 |
+
{{- format_function_declaration(tool) | trim -}}
|
| 212 |
+
{{- '<tool|>' -}}
|
| 213 |
+
{%- endfor %}
|
| 214 |
+
{%- set ns.prev_message_type = 'tool' -%}
|
| 215 |
+
{%- endif -%}
|
| 216 |
+
{{- '<turn|>\n' -}}
|
| 217 |
+
{%- endif %}
|
| 218 |
+
|
| 219 |
+
{#- Pre-scan: find last user message index for reasoning guard -#}
|
| 220 |
+
{%- set ns_turn = namespace(last_user_idx=-1) -%}
|
| 221 |
+
{%- for i in range(loop_messages | length) -%}
|
| 222 |
+
{%- if loop_messages[i]['role'] == 'user' -%}
|
| 223 |
+
{%- set ns_turn.last_user_idx = i -%}
|
| 224 |
+
{%- endif -%}
|
| 225 |
+
{%- endfor -%}
|
| 226 |
+
|
| 227 |
+
{#- Loop through messages -#}
|
| 228 |
+
{%- for message in loop_messages -%}
|
| 229 |
+
{%- if message['role'] != 'tool' -%}
|
| 230 |
+
{%- set ns.prev_message_type = None -%}
|
| 231 |
+
{%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
|
| 232 |
+
{#- Detect continuation: suppress duplicate <|turn>model when previous non-tool message was also assistant -#}
|
| 233 |
+
{%- set prev_nt = namespace(role=None, found=false) -%}
|
| 234 |
+
{%- if loop.index0 > 0 -%}
|
| 235 |
+
{%- for j in range(loop.index0 - 1, -1, -1) -%}
|
| 236 |
+
{%- if not prev_nt.found -%}
|
| 237 |
+
{%- if loop_messages[j]['role'] != 'tool' -%}
|
| 238 |
+
{%- set prev_nt.role = loop_messages[j]['role'] -%}
|
| 239 |
+
{%- set prev_nt.found = true -%}
|
| 240 |
+
{%- endif -%}
|
| 241 |
+
{%- endif -%}
|
| 242 |
+
{%- endfor -%}
|
| 243 |
+
{%- endif -%}
|
| 244 |
+
{%- set continue_same_model_turn = (role == 'model' and prev_nt.role == 'assistant') -%}
|
| 245 |
+
{%- if not continue_same_model_turn -%}
|
| 246 |
+
{{- '<|turn>' + role + '\n' }}
|
| 247 |
+
{%- endif -%}
|
| 248 |
+
|
| 249 |
+
{#- Render reasoning/reasoning_content as thinking channel -#}
|
| 250 |
+
{%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
|
| 251 |
+
{%- if thinking_text and loop.index0 > ns_turn.last_user_idx and message.get('tool_calls') -%}
|
| 252 |
+
{{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
|
| 253 |
+
{%- endif -%}
|
| 254 |
+
|
| 255 |
+
{%- if message['tool_calls'] -%}
|
| 256 |
+
{%- for tool_call in message['tool_calls'] -%}
|
| 257 |
+
{%- set function = tool_call['function'] -%}
|
| 258 |
+
{{- '<|tool_call>call:' + function['name'] + '{' -}}
|
| 259 |
+
{%- if function['arguments'] is mapping -%}
|
| 260 |
+
{%- set ns_args = namespace(found_first=false) -%}
|
| 261 |
+
{%- for key, value in function['arguments'] | dictsort -%}
|
| 262 |
+
{%- if ns_args.found_first %},{% endif -%}
|
| 263 |
+
{%- set ns_args.found_first = true -%}
|
| 264 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 265 |
+
{%- endfor -%}
|
| 266 |
+
{%- elif function['arguments'] is string -%}
|
| 267 |
+
{{- function['arguments'] -}}
|
| 268 |
+
{%- endif -%}
|
| 269 |
+
{{- '}<tool_call|>' -}}
|
| 270 |
+
{%- endfor -%}
|
| 271 |
+
{%- set ns.prev_message_type = 'tool_call' -%}
|
| 272 |
+
{%- endif -%}
|
| 273 |
+
|
| 274 |
+
{%- set ns_tr_out = namespace(flag=false) -%}
|
| 275 |
+
{%- if message.get('tool_responses') -%}
|
| 276 |
+
{#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
|
| 277 |
+
{%- for tool_response in message['tool_responses'] -%}
|
| 278 |
+
{{- format_tool_response_block(tool_response['name'] | default('unknown'), tool_response['response']) -}}
|
| 279 |
+
{%- set ns_tr_out.flag = true -%}
|
| 280 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 281 |
+
{%- endfor -%}
|
| 282 |
+
{%- elif message.get('tool_calls') -%}
|
| 283 |
+
{#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
|
| 284 |
+
{%- set ns_tool_scan = namespace(stopped=false) -%}
|
| 285 |
+
{%- for k in range(loop.index0 + 1, loop_messages | length) -%}
|
| 286 |
+
{%- if ns_tool_scan.stopped -%}
|
| 287 |
+
{%- elif loop_messages[k]['role'] != 'tool' -%}
|
| 288 |
+
{%- set ns_tool_scan.stopped = true -%}
|
| 289 |
+
{%- else -%}
|
| 290 |
+
{%- set follow = loop_messages[k] -%}
|
| 291 |
+
{#- Resolve tool_call_id to function name -#}
|
| 292 |
+
{%- set ns_tname = namespace(name=follow.get('name') | default('unknown')) -%}
|
| 293 |
+
{%- for tc in message['tool_calls'] -%}
|
| 294 |
+
{%- if tc.get('id') == follow.get('tool_call_id') -%}
|
| 295 |
+
{%- set ns_tname.name = tc['function']['name'] -%}
|
| 296 |
+
{%- endif -%}
|
| 297 |
+
{%- endfor -%}
|
| 298 |
+
{#- Handle content as string or content-parts array -#}
|
| 299 |
+
{%- set tool_body = follow.get('content') -%}
|
| 300 |
+
{%- if tool_body is string -%}
|
| 301 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 302 |
+
{%- elif tool_body is sequence and tool_body is not string -%}
|
| 303 |
+
{%- set ns_txt = namespace(s='') -%}
|
| 304 |
+
{%- for part in tool_body -%}
|
| 305 |
+
{%- if part.get('type') == 'text' -%}
|
| 306 |
+
{%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
|
| 307 |
+
{%- endif -%}
|
| 308 |
+
{%- endfor -%}
|
| 309 |
+
{{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
|
| 310 |
+
{%- for part in tool_body -%}
|
| 311 |
+
{%- if part.get('type') == 'image' -%}
|
| 312 |
+
{{- '<|image|>' -}}
|
| 313 |
+
{%- elif part.get('type') == 'audio' -%}
|
| 314 |
+
{{- '<|audio|>' -}}
|
| 315 |
+
{%- elif part.get('type') == 'video' -%}
|
| 316 |
+
{{- '<|video|>' -}}
|
| 317 |
+
{%- endif -%}
|
| 318 |
+
{%- endfor -%}
|
| 319 |
+
{%- else -%}
|
| 320 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 321 |
+
{%- endif -%}
|
| 322 |
+
{%- set ns_tr_out.flag = true -%}
|
| 323 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 324 |
+
{%- endif -%}
|
| 325 |
+
{%- endfor -%}
|
| 326 |
+
{%- endif -%}
|
| 327 |
+
|
| 328 |
+
{%- set captured_content -%}
|
| 329 |
+
{%- if message['content'] is string -%}
|
| 330 |
+
{%- if role == 'model' -%}
|
| 331 |
+
{{- strip_thinking(message['content']) -}}
|
| 332 |
+
{%- else -%}
|
| 333 |
+
{{- message['content'] | trim -}}
|
| 334 |
+
{%- endif -%}
|
| 335 |
+
{%- elif message['content'] is sequence -%}
|
| 336 |
+
{%- for item in message['content'] -%}
|
| 337 |
+
{%- if item['type'] == 'text' -%}
|
| 338 |
+
{%- if role == 'model' -%}
|
| 339 |
+
{{- strip_thinking(item['text']) -}}
|
| 340 |
+
{%- else -%}
|
| 341 |
+
{{- item['text'] | trim -}}
|
| 342 |
+
{%- endif -%}
|
| 343 |
+
{%- elif item['type'] == 'image' -%}
|
| 344 |
+
{{- '<|image|>' -}}
|
| 345 |
+
{%- set ns.prev_message_type = 'image' -%}
|
| 346 |
+
{%- elif item['type'] == 'audio' -%}
|
| 347 |
+
{{- '<|audio|>' -}}
|
| 348 |
+
{%- set ns.prev_message_type = 'audio' -%}
|
| 349 |
+
{%- elif item['type'] == 'video' -%}
|
| 350 |
+
{{- '<|video|>' -}}
|
| 351 |
+
{%- set ns.prev_message_type = 'video' -%}
|
| 352 |
+
{%- endif -%}
|
| 353 |
+
{%- endfor -%}
|
| 354 |
+
{%- endif -%}
|
| 355 |
+
{%- endset -%}
|
| 356 |
+
|
| 357 |
+
{{- captured_content -}}
|
| 358 |
+
{%- set has_content = captured_content | trim | length > 0 -%}
|
| 359 |
+
|
| 360 |
+
{%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
|
| 361 |
+
{{- '<|tool_response>' -}}
|
| 362 |
+
{%- elif not (ns_tr_out.flag and not has_content) -%}
|
| 363 |
+
{{- '<turn|>\n' -}}
|
| 364 |
+
{%- endif -%}
|
| 365 |
+
{%- endif -%}
|
| 366 |
+
{%- endfor -%}
|
| 367 |
+
|
| 368 |
+
{%- if add_generation_prompt -%}
|
| 369 |
+
{%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
|
| 370 |
+
{{- '<|turn>model\n' -}}
|
| 371 |
+
{%- endif -%}
|
| 372 |
+
{%- endif -%}
|
gemma4_e4b_lime_persona500_Q6_K_limechat.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bafcfe3f624f0e1f84014c9b9136788992629955f7ce9146941226cd280d618e
|
| 3 |
+
size 6217263584
|