Skip to content

Instantly share code, notes, and snippets.

View mtasic85's full-sized avatar
🦁
Recruiters will be shot on sight

Marko Tasic mtasic85

🦁
Recruiters will be shot on sight
View GitHub Profile
@mtasic85
mtasic85 / llama-server
Created April 6, 2026 06:07
rwkv7-chat-template-tool-calling-30.jinja
./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-30.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_
@mtasic85
mtasic85 / llama-server
Created April 5, 2026 19:26
rwkv7-chat-template-tool-calling-30.jinja
./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-30.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_
@mtasic85
mtasic85 / partial rwkv tool calling template from ToolCall-15 benchmark
Created April 5, 2026 17:13
partial rwkv tool calling template from ToolCall-15 benchmark
### Assistant
<think>
The tool returned weather data: temperature 18°C, partly cloudy, humidity 65%, wind speed 12 km/h. The user asked "What's the weather like in Berlin right now?" So we should respond with a concise answer summarizing the weather. Possibly include temperature, condition, humidity, wind speed. Also note that it's in Celsius.
We should respond in a friendly manner.
Thus answer: "Right now in Berlin it's partly cloudy with a temperature of 18°C, humidity 65%, and a gentle wind of about 12 km/h."
We can also mention that it's a nice day.
Thus final answer.
</think>
Right now in Berlin it’s **partly cloudy** with a temperature of **18 °C**, humidity around **65 %**, and a gentle wind of about **12 km/h**. It’s a pleasant day!
final_answer=The user asks: "What's the weather like in Berlin right now?" We need to use the get_weather tool. The tool expects location and optionally units. The default units are celsius. So we can call get_weather with location "Berlin". The tool will return current we
@mtasic85
mtasic85 / llama-server
Created April 5, 2026 13:54
rwkv7-chat-template-tool-calling-27.jinja
./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-27.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_
@mtasic85
mtasic85 / llama-server
Last active April 5, 2026 10:03
rwkv7-chat-template-tool-calling-22.jinja
./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-22.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_
@mtasic85
mtasic85 / gist:1e19527d50d165249f4513f0eccc1718
Created April 1, 2026 07:01
llama-server RWKV7 rwkv7-chat-template-tool-calling-21
./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-21.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_
@mtasic85
mtasic85 / rwkv7-chat-template-tool-calling-21.jinja
Created April 1, 2026 07:00
rwkv7-chat-template-tool-calling-21.jinja
{%- if not add_generation_prompt is defined %}
{%- set add_generation_prompt = true %}
{%- endif %}
{%- set ns = namespace(system_prompt='', has_tools=false) %}
{%- for message in messages %}
{%- if message.role == 'system' %}
{%- set ns.system_prompt = message.content %}
{%- endif %}
{%- endfor %}
{%- if tools is defined and tools | length > 0 %}
@mtasic85
mtasic85 / gist:eacd0605c5d1a4bd7fb7d8d03490377e
Created March 31, 2026 16:39
llama-server RWKV7 rwkv7-chat-template-tool-calling-16
./build/bin/llama-server -v -lv 4 -fa on -n 16384 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-16.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name"
@mtasic85
mtasic85 / rwkv7-chat-template-tool-calling-16.jinja
Created March 31, 2026 16:38
rwkv7-chat-template-tool-calling-16.jinja
{%- if not add_generation_prompt is defined -%}
{%- set add_generation_prompt = true -%}
{%- endif -%}
{%- set ns = namespace(system_prompt='', has_tools=false) -%}
{# 1. Extract System Prompt and Check for Tools #}
{%- for message in messages -%}
{%- if message['role'] == 'system' -%}
{%- set ns.system_prompt = message['content'] -%}
@mtasic85
mtasic85 / parser_peg_json_v1_1.py
Last active September 5, 2021 12:28
Python - PEG - Parsing Combinators - Simple JSON parser v1.1
'''
PEG - Parsing Combinators
Example: Simple JSON parser
'''
from typing import Any, Callable
from string import digits, ascii_letters, whitespace
class JsonParser:
'''
VALUE ::= STRING | NUMBER | OBJECT | ARRAY