Skip to content

Instantly share code, notes, and snippets.

View Reithan's full-sized avatar

Reithan

  • Cupertino, CA
View GitHub Profile
@Reithan
Reithan / gist:261e521b9ecdd792805fdb4fad45d404
Last active May 11, 2026 08:12
STScript QR For Detecting and Rating AI Slop
/let slopFactor {: msg= mode=score
/re-replace find=/’/gims replace="'" {{var::msg}} |
/re-replace find=/[“”]/gims replace="\"" {{pipe}} | /var msg | //"|
/let modes ["regex","fuzzy"] |
/let patterns [
{"name":"em-dash","weight":10,"mode":"regex","pattern":"/—/gms"},
{"name":"slop-names","weight":3,"mode":"fuzzy","threshold":0.1,"pattern":
["Elara","Vance","Voss","Seraphina","Kael","Leo","Jax","Thalric","Lyra","Aerith","Kaelen","Sylas","Valerius",
"Nova","Aurora","Zenith","Aether","Celeste","Seraphina",
"Oliver","Emily","Sophia","Liam","Noah","Ava"]},
@Reithan
Reithan / Gemma-4-31b-it.jinja
Created April 13, 2026 09:48
Bug-fixed version of the Gemma4-31B-it.jinja file to enable interleaved reasoning+tools,
{%- macro format_parameters(properties, required) -%}
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
{%- set ns = namespace(found_first=false) -%}
{%- for key, value in properties | dictsort -%}
{%- set add_comma = false -%}
{%- if key not in standard_keys -%}
{%- if ns.found_first %},{% endif -%}
{%- set ns.found_first = true -%}
{{ key }}:{
{%- if value['description'] -%}
@Reithan
Reithan / update_gguf_jinja.py
Created April 13, 2026 09:47
Creates a new copy of a gguf file with a different jinja chat template.
#!/usr/bin/env python3
"""
update_gguf_jinja.pyReplace a metadata string key in a GGUF model file.
By default replaces tokenizer.chat_template with the contents of a .jinja
file. Writes a new output file; the source is never modified.
Usage examples:
python update_gguf_jinja.py model.gguf template.jinja
python update_gguf_jinja.py model.gguf template.jinja -o patched.gguf