[{"data":1,"prerenderedAt":189},["ShallowReactive",2],{"\u002Ftlt-2025.07.12-gremllm":3},{"id":4,"title":5,"body":6,"createdAt":178,"description":12,"draft":179,"extension":180,"image":19,"mastodonThread":181,"meta":182,"navigation":67,"path":183,"seo":184,"stem":185,"tags":186,"updatedAt":178,"__hash__":188},"content\u002FTLT - 2025.07.12 - Gremllm.md","Gremllm",{"type":7,"value":8,"toc":176},"minimark",[9,13,20,28,34,147,155,162,172],[10,11,12],"p",{},"A project which puts LLM-powered gremlins right into your runtime!",[10,14,15],{},[16,17],"img",{"alt":18,"src":19},"Gremllm cartoon","img\u002FGremllm_cartoon.png",[10,21,22,23,27],{},"As previously mentioned, I enjoy trying out new tech like claude-code, making esoteric and ill-advised libraries that are maybe-jokes, pushing on meta-models and run-time ",[24,25,26],"code",{},"eval",", and like many others I don't mind 5 minutes of fame. So by that measure, TOTAL SUCCESS!",[10,29,30,31,33],{},"Let's start with what this new ",[24,32,5],{}," library that I made can do:",[35,36,41],"pre",{"className":37,"code":38,"language":39,"meta":40,"style":40},"language-python shiki shiki-themes github-light github-dark monokai","from gremllm import Gremllm\n\ncounter = Gremllm('counter')\ncounter.value = 0\ncounter.increment()\ncounter.increment(5)\ncounter.add_seventeen()\nprint(counter.current_value)\nprint(counter.value_in_hex)\ncounter.reset()\n","python","",[24,42,43,62,69,88,100,106,117,123,133,141],{"__ignoreMap":40},[44,45,48,52,56,59],"span",{"class":46,"line":47},"line",1,[44,49,51],{"class":50},"sC2Qs","from",[44,53,55],{"class":54},"sMOD_"," gremllm ",[44,57,58],{"class":50},"import",[44,60,61],{"class":54}," Gremllm\n",[44,63,65],{"class":46,"line":64},2,[44,66,68],{"emptyLinePlaceholder":67},true,"\n",[44,70,72,75,78,81,85],{"class":46,"line":71},3,[44,73,74],{"class":54},"counter ",[44,76,77],{"class":50},"=",[44,79,80],{"class":54}," Gremllm(",[44,82,84],{"class":83},"sstjo","'counter'",[44,86,87],{"class":54},")\n",[44,89,91,94,96],{"class":46,"line":90},4,[44,92,93],{"class":54},"counter.value ",[44,95,77],{"class":50},[44,97,99],{"class":98},"s7F3e"," 0\n",[44,101,103],{"class":46,"line":102},5,[44,104,105],{"class":54},"counter.increment()\n",[44,107,109,112,115],{"class":46,"line":108},6,[44,110,111],{"class":54},"counter.increment(",[44,113,114],{"class":98},"5",[44,116,87],{"class":54},[44,118,120],{"class":46,"line":119},7,[44,121,122],{"class":54},"counter.add_seventeen()\n",[44,124,126,130],{"class":46,"line":125},8,[44,127,129],{"class":128},"sTrkL","print",[44,131,132],{"class":54},"(counter.current_value)\n",[44,134,136,138],{"class":46,"line":135},9,[44,137,129],{"class":128},[44,139,140],{"class":54},"(counter.value_in_hex)\n",[44,142,144],{"class":46,"line":143},10,[44,145,146],{"class":54},"counter.reset()\n",[10,148,149,150,154],{},"To be clear -- each of those methods is completely made up. At runtime when you invoke a method it is ",[151,152,153],"em",{},"at that moment"," sent over to the LLM (ChatGPT in this case) to generate the python code, which is then executed. It's like claude-code, but at runtime!",[10,156,157,158,161],{},"Speaking of which, I built Gremllm ",[151,159,160],{},"using"," Claude Code, which I've been using a lot lately. I'm not always convinced that it is faster, and I'm not always convinced that it is slower, but it is fun enough that I am making stuff that I might not make otherwise at the very least.",[10,163,164,165,167,168,171],{},"Using Claude Code did have some trickery. The biggest thing is that it kept wanting to run my ",[24,166,26],{}," (or in Python it is actually ",[24,169,170],{},"exec",") in some sort of sandbox, and I had to be like \"no... please do this dangerous thing. Really!\". Even now it is doing some things that are more safe than I would have done if it was completely written by hand.",[173,174,175],"style",{},"html pre.shiki code .sC2Qs, html code.shiki .sC2Qs{--shiki-default:#D73A49;--shiki-dark:#F97583;--shiki-sepia:#F92672}html pre.shiki code .sMOD_, html code.shiki .sMOD_{--shiki-default:#24292E;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2}html pre.shiki code .sstjo, html code.shiki .sstjo{--shiki-default:#032F62;--shiki-dark:#9ECBFF;--shiki-sepia:#E6DB74}html pre.shiki code .s7F3e, html code.shiki .s7F3e{--shiki-default:#005CC5;--shiki-dark:#79B8FF;--shiki-sepia:#AE81FF}html pre.shiki code .sTrkL, html code.shiki .sTrkL{--shiki-default:#005CC5;--shiki-dark:#79B8FF;--shiki-sepia:#66D9EF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html.sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}",{"title":40,"searchDepth":64,"depth":64,"links":177},[],"2025-07-12T00:00:00.000Z",false,"md",null,{},"\u002Ftlt-2025.07.12-gremllm",{"title":5,"description":12},"TLT - 2025.07.12 - Gremllm",[187],"blog","borhbqEkc1p9O0yyBOzuUcYL7mnj9wY2SY6eyRgC-eM",1778988315094]