<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[CodeCut Newsletter]]></title><description><![CDATA[CodeCut is a newsletter for busy developers, data professionals, and AI engineers, delivering short, under-two-minute tips on data science, AI, and modern tools, three times per week.]]></description><link>https://newsletter.codecut.ai</link><image><url>https://newsletter.codecut.ai/img/substack.png</url><title>CodeCut Newsletter</title><link>https://newsletter.codecut.ai</link></image><generator>Substack</generator><lastBuildDate>Fri, 22 May 2026 17:49:52 GMT</lastBuildDate><atom:link href="https://newsletter.codecut.ai/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[CodeCut Newsletter]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[codecut@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[codecut@substack.com]]></itunes:email><itunes:name><![CDATA[CodeCut]]></itunes:name></itunes:owner><itunes:author><![CDATA[CodeCut]]></itunes:author><googleplay:owner><![CDATA[codecut@substack.com]]></googleplay:owner><googleplay:email><![CDATA[codecut@substack.com]]></googleplay:email><googleplay:author><![CDATA[CodeCut]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Quick Tips: smolagents - Build an AI Agent in 4 Lines of Code]]></title><description><![CDATA[Plus the Claude Code /goal command]]></description><link>https://newsletter.codecut.ai/p/smolagents-build-an-ai-agent-in-4</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/smolagents-build-an-ai-agent-in-4</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 21 May 2026 16:01:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!z3Ya!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Claude Code: Run Tasks to Completion with /goal</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!I_uX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!I_uX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png 424w, https://substackcdn.com/image/fetch/$s_!I_uX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png 848w, https://substackcdn.com/image/fetch/$s_!I_uX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png 1272w, https://substackcdn.com/image/fetch/$s_!I_uX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!I_uX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png" width="1080" height="818" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f418cdec-1453-497f-bade-f18713093c6e_1080x818.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:818,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Claude Code: Run Tasks to Completion with /goal&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Claude Code: Run Tasks to Completion with /goal" title="Code example: Claude Code: Run Tasks to Completion with /goal" srcset="https://substackcdn.com/image/fetch/$s_!I_uX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png 424w, https://substackcdn.com/image/fetch/$s_!I_uX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png 848w, https://substackcdn.com/image/fetch/$s_!I_uX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png 1272w, https://substackcdn.com/image/fetch/$s_!I_uX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff418cdec-1453-497f-bade-f18713093c6e_1080x818.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Starting a task in Claude Code often means spending multiple turns going back and forth before it finally reaches the result you wanted.</p><h4>Solution</h4><p><strong><a href="https://github.com/anthropics/claude-code">Claude Code</a></strong>&#8217;s <code>/goal</code> command lets you define a completion condition once, then continues working until that condition is met.</p><p>After each turn, a lightweight model evaluates the conversation against your condition. If the goal is not satisfied, Claude gets sent back for another turn with a short explanation of what still needs to be done.</p><p>To get the most out of <code>/goal</code>, write a condition the evaluator can actually verify.</p><ul><li><p>Name a measurable end state instead of a vague target (e.g. &#8220;all tests in <code>test/auth</code> pass&#8221; instead of &#8220;auth is working&#8221;)</p></li><li><p>List constraints that must hold along the way (e.g. &#8220;no other test file is modified&#8221; or &#8220;no tests are skipped or deleted&#8221;)</p></li><li><p>Add a safety limit like &#8220;stop after 20 turns&#8221; to avoid endless iterations.</p></li></ul><blockquote><p>&#128214; <a href="https://code.claude.com/docs/en/goal">View The Docs</a></p></blockquote><div><hr></div><h3>smolagents: Build an AI Agent in 4 Lines of Code</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z3Ya!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z3Ya!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png 424w, https://substackcdn.com/image/fetch/$s_!z3Ya!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png 848w, https://substackcdn.com/image/fetch/$s_!z3Ya!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png 1272w, https://substackcdn.com/image/fetch/$s_!z3Ya!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z3Ya!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png" width="617" height="661" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:661,&quot;width&quot;:617,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: smolagents: Build an AI Agent in 4 Lines of Code&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: smolagents: Build an AI Agent in 4 Lines of Code" title="Code example: smolagents: Build an AI Agent in 4 Lines of Code" srcset="https://substackcdn.com/image/fetch/$s_!z3Ya!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png 424w, https://substackcdn.com/image/fetch/$s_!z3Ya!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png 848w, https://substackcdn.com/image/fetch/$s_!z3Ya!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png 1272w, https://substackcdn.com/image/fetch/$s_!z3Ya!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee4bff33-1a4a-4a8e-980a-7a67e8a463af_617x661.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>LangChain and LangGraph are powerful, but they also come with concepts like chains, runnables, and state graphs.</p><p>That is useful for complex workflows, but overkill when you just want to give a model a tool and let it solve a task.</p><h4>Solution</h4><p><strong><a href="https://github.com/huggingface/smolagents">smolagents</a></strong> from Hugging Face is a barebones agent library designed for simplicity.</p><p>In roughly 1,000 lines of code, it gives you the core pieces needed to build a working agent with a single import and three lines of setup.</p><p>Key features:</p><ul><li><p>Agents act by writing Python in a sandbox, the same way you&#8217;d script a task in a notebook</p></li><li><p>Model-agnostic design, swap between OpenAI, Anthropic, local Ollama, or Hugging Face Inference</p></li><li><p>Push agents to the Hugging Face Hub to share with the community</p></li></ul><blockquote></blockquote><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Deep Dive: Shrink Your Python Container in One Command with SlimToolkit]]></title><description><![CDATA[Use SlimToolkit to shrink a Python container by half in one command. No Dockerfile changes. Walkthrough on a chatbot with common edge cases and fixes.]]></description><link>https://newsletter.codecut.ai/p/shrink-your-python-container-in-one</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/shrink-your-python-container-in-one</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 19 May 2026 16:01:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Zr89!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Zr89!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zr89!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png 424w, https://substackcdn.com/image/fetch/$s_!Zr89!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png 848w, https://substackcdn.com/image/fetch/$s_!Zr89!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png 1272w, https://substackcdn.com/image/fetch/$s_!Zr89!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zr89!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png" width="1200" height="628" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b329f779-2dd1-4c93-858b-c53de6212372_1200x628.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:628,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Shrink Your Python Container in One Command with SlimToolkit&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Shrink Your Python Container in One Command with SlimToolkit" title="Shrink Your Python Container in One Command with SlimToolkit" srcset="https://substackcdn.com/image/fetch/$s_!Zr89!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png 424w, https://substackcdn.com/image/fetch/$s_!Zr89!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png 848w, https://substackcdn.com/image/fetch/$s_!Zr89!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png 1272w, https://substackcdn.com/image/fetch/$s_!Zr89!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb329f779-2dd1-4c93-858b-c53de6212372_1200x628.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Introduction</h2><p>Most Docker images contain far more than a Python application actually needs at runtime. They include full OS layers with shells, compilers, and utilities that often go completely unused, leading to unnecessarily large images that consume storage and slow deployment pipelines.</p><p><a href="https://github.com/slimtoolkit/slim">SlimToolkit</a> analyzes your container at runtime, identifies which files are actually used, and builds a minimal image with only those dependencies.</p><p>This article walks through slimming a Chainlit LLM chatbot, but the same approach works on any Python container.</p><h2>What Is SlimToolkit?</h2><p><a href="https://github.com/slimtoolkit/slim">SlimToolkit</a> is a command-line tool that strips unused files from a container image <strong>without touching your Dockerfile</strong>. It works in two steps:</p><ol><li><p><strong>Static analysis.</strong> Looks at the image&#8217;s contents without running it.</p></li><li><p><strong>Dynamic analysis.</strong> Runs the image to see which files the app actually uses.</p></li></ol><p>The first step lists everything in the image. The second narrows that list to what the app actually needs. Everything outside the second list gets stripped.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HvAZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HvAZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png 424w, https://substackcdn.com/image/fetch/$s_!HvAZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png 848w, https://substackcdn.com/image/fetch/$s_!HvAZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png 1272w, https://substackcdn.com/image/fetch/$s_!HvAZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HvAZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png" width="1080" height="614" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:614,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;How SlimToolkit decides what to keep: static analysis lists every file in the image, dynamic analysis narrows it down to the files the app uses, and the difference gets stripped.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="How SlimToolkit decides what to keep: static analysis lists every file in the image, dynamic analysis narrows it down to the files the app uses, and the difference gets stripped." title="How SlimToolkit decides what to keep: static analysis lists every file in the image, dynamic analysis narrows it down to the files the app uses, and the difference gets stripped." srcset="https://substackcdn.com/image/fetch/$s_!HvAZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png 424w, https://substackcdn.com/image/fetch/$s_!HvAZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png 848w, https://substackcdn.com/image/fetch/$s_!HvAZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png 1272w, https://substackcdn.com/image/fetch/$s_!HvAZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5860ab73-fd9a-46c0-93a7-6c92c06eb2fc_1080x614.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Install it via the official install script (works on Linux and macOS):</p><pre><code><code>curl -sL https://raw.githubusercontent.com/slimtoolkit/slim/master/scripts/install-slim.sh | sudo -E bash -
</code></code></pre><p>Or with Homebrew on macOS:</p><pre><code><code>brew install docker-slim
</code></code></pre><p>Verify the install:</p><pre><code><code>slim --version
</code></code></pre><p><strong>Output</strong></p><pre><code><code>mint version darwin/arm64|Aurora|1.41.8|latest|latest
</code></code></pre><blockquote><p>&#128187; <strong>Get the Code</strong>: The complete source code and Jupyter notebook for this tutorial are available on <a href="https://github.com/khuyentran1401/codecut-blog/blob/main/slimtoolkit_llm_chatbot">GitHub</a>. Clone it to follow along!</p></blockquote><h2>Build the Chatbot Image</h2><p>To test SlimToolkit, build a small Chainlit chatbot image first. We&#8217;ll write a small Chainlit chatbot, package it with a Dockerfile, and build it.</p><h3>The Chainlit App</h3><p>The chatbot app uses two libraries:</p><ul><li><p><a href="https://github.com/Chainlit/chainlit">Chainlit</a>: an open-source Python framework for building LLM chat UIs; provides the web interface and message handling</p></li><li><p><a href="https://github.com/openai/openai-python">OpenAI SDK</a>: calls <code>gpt-4o-mini</code> for responses</p></li></ul><pre><code><code># app.py
import os
import chainlit as cl
from openai import AsyncOpenAI

client = AsyncOpenAI(api_key=os.environ.get("OPENAI_API_KEY"))


@cl.on_chat_start
async def start():
    cl.user_session.set("messages", [])


@cl.on_message
async def main(message: cl.Message):
    messages = cl.user_session.get("messages")
    messages.append({"role": "user", "content": message.content})

    response = await client.chat.completions.create(
        model="gpt-4o-mini",
        messages=messages,
    )
    reply = response.choices[0].message.content

    messages.append({"role": "assistant", "content": reply})
    cl.user_session.set("messages", messages)

    await cl.Message(content=reply).send()
</code></code></pre><p>Here&#8217;s what happens when someone uses the chatbot:</p><ul><li><p>At import time, <code>AsyncOpenAI</code> reads the <code>OPENAI_API_KEY</code> environment variable and constructs the client</p></li><li><p>When a new chat session opens, <code>@cl.on_chat_start</code> initializes an empty message list for that session</p></li><li><p>When the user types something, <code>@cl.on_message</code> appends it to the history, sends the whole conversation to <code>gpt-4o-mini</code>, stores the reply, and displays it</p></li></ul><p>Before containerizing, let&#8217;s test it locally first. Export your OpenAI key:</p><pre><code><code>export OPENAI_API_KEY=sk-...
</code></code></pre><p>Then run the app:</p><pre><code><code>chainlit run app.py
</code></code></pre><p>Open http://localhost:8000, you should see the Chainlit welcome screen.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wgnL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wgnL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 424w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 848w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 1272w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wgnL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png" width="960" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/523eca70-fd4b-4251-8f43-22287915a192_960x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:960,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Chainlit welcome screen&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Chainlit welcome screen" title="The Chainlit welcome screen" srcset="https://substackcdn.com/image/fetch/$s_!wgnL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 424w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 848w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 1272w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>The Dockerfile</h3><p>Pin every dependency in a <code>requirements.txt</code> so the build is reproducible:</p><pre><code><code># requirements.txt
chainlit==2.11.1
openai==2.16.0
</code></code></pre><p>Create a Dockerfile to build the image:</p><pre><code><code># Dockerfile
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY app.py .

EXPOSE 8000
CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "8000", "-h"]
</code></code></pre><p>Here&#8217;s what each step does:</p><ul><li><p>Pulls <code>python:3.11-slim</code> as the base image</p></li><li><p>Installs the pinned dependencies from <code>requirements.txt</code></p></li><li><p>Copies in <code>app.py</code></p></li><li><p>Starts Chainlit on port 8000 when the container runs</p></li></ul><p>Build the image:</p><pre><code><code>docker build -t llm-chatbot:fat .
</code></code></pre><p>Verify the image size:</p><pre><code><code>docker images llm-chatbot:fat
</code></code></pre><p><strong>Output</strong></p><pre><code><code>IMAGE             ID             DISK USAGE   CONTENT SIZE   EXTRA
llm-chatbot:fat   e8de32dd85d4        308MB             0B
</code></code></pre><p>Around 300 MB. Let&#8217;s see if we can shrink it with SlimToolkit.</p><h2>Slim the Image</h2><p>To slim the image, start with the basic command:</p><pre><code><code>slim build \
    --target llm-chatbot:fat \
    --tag llm-chatbot:slim \
    --env OPENAI_API_KEY=$OPENAI_API_KEY
</code></code></pre><p>Each flag plays a role in the slim build:</p><ul><li><p><code>--target llm-chatbot:fat</code>: tells slim which image to minify</p></li><li><p><code>--tag llm-chatbot:slim</code>: names the output image</p></li><li><p><code>--env OPENAI_API_KEY=$OPENAI_API_KEY</code>: sets the env var inside slim&#8217;s probe container so the module-level <code>AsyncOpenAI()</code> can construct at import time</p></li></ul><p>Here&#8217;s what happens when you run the command:</p><ol><li><p>Slim inspects the fat image</p></li><li><p>Starts it in a sandbox</p></li><li><p>Sends a <code>GET /</code> probe and records every file the container touches</p></li><li><p>Builds a slim image containing only those files</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8mSa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8mSa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png 424w, https://substackcdn.com/image/fetch/$s_!8mSa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png 848w, https://substackcdn.com/image/fetch/$s_!8mSa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png 1272w, https://substackcdn.com/image/fetch/$s_!8mSa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8mSa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png" width="1080" height="1146" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1146,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;slim build flow: slim build sends GET / into a sandbox where the fat image responds; slim records every file the container touches and builds a slim image from only those files.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="slim build flow: slim build sends GET / into a sandbox where the fat image responds; slim records every file the container touches and builds a slim image from only those files." title="slim build flow: slim build sends GET / into a sandbox where the fat image responds; slim records every file the container touches and builds a slim image from only those files." srcset="https://substackcdn.com/image/fetch/$s_!8mSa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png 424w, https://substackcdn.com/image/fetch/$s_!8mSa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png 848w, https://substackcdn.com/image/fetch/$s_!8mSa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png 1272w, https://substackcdn.com/image/fetch/$s_!8mSa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3225f7cb-1b0d-444b-8fac-a4b9747ef66f_1080x1146.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But the default <code>GET /</code> only loads the chat UI shell. It doesn&#8217;t actually send a chat message, so files needed for the chat path (OpenAI&#8217;s lazy submodules, httpcore, etc.) get stripped. To trace the chat path too, add <code>--continue-after enter</code>:</p><pre><code><code>slim build \
    --target llm-chatbot:fat \
    --tag llm-chatbot:slim \
    --env OPENAI_API_KEY=$OPENAI_API_KEY \
    --continue-after enter
</code></code></pre><p><code>--continue-after enter</code> pauses slim after the default probe so you can open the chatbot in a browser and send a message; this tells slim what files the chat actually needs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fwyW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fwyW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png 424w, https://substackcdn.com/image/fetch/$s_!fwyW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png 848w, https://substackcdn.com/image/fetch/$s_!fwyW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png 1272w, https://substackcdn.com/image/fetch/$s_!fwyW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fwyW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png" width="921" height="251" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/030d0693-9468-4712-99b8-2e57151df0fa_921x251.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:251,&quot;width&quot;:921,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Sending a message to the chatbot&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Sending a message to the chatbot" title="Sending a message to the chatbot" srcset="https://substackcdn.com/image/fetch/$s_!fwyW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png 424w, https://substackcdn.com/image/fetch/$s_!fwyW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png 848w, https://substackcdn.com/image/fetch/$s_!fwyW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png 1272w, https://substackcdn.com/image/fetch/$s_!fwyW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F030d0693-9468-4712-99b8-2e57151df0fa_921x251.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now that the chat path runs during the probe, slim keeps openai.resources and httpcore in the final image:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dULL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dULL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png 424w, https://substackcdn.com/image/fetch/$s_!dULL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png 848w, https://substackcdn.com/image/fetch/$s_!dULL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png 1272w, https://substackcdn.com/image/fetch/$s_!dULL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dULL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png" width="1080" height="1210" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1210,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;slim build flow with --continue-after enter: after the default GET / probe, slim pauses; you send a chat in the browser, which exercises openai.resources and httpcore; slim records those files and builds a slim image that includes them.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="slim build flow with --continue-after enter: after the default GET / probe, slim pauses; you send a chat in the browser, which exercises openai.resources and httpcore; slim records those files and builds a slim image that includes them." title="slim build flow with --continue-after enter: after the default GET / probe, slim pauses; you send a chat in the browser, which exercises openai.resources and httpcore; slim records those files and builds a slim image that includes them." srcset="https://substackcdn.com/image/fetch/$s_!dULL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png 424w, https://substackcdn.com/image/fetch/$s_!dULL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png 848w, https://substackcdn.com/image/fetch/$s_!dULL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png 1272w, https://substackcdn.com/image/fetch/$s_!dULL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F789da874-06f2-475a-84f1-e8cd6468a4ff_1080x1210.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Let&#8217;s compare both images:</p><pre><code><code>docker images llm-chatbot
</code></code></pre><p><strong>Output</strong></p><pre><code><code>IMAGE              ID             DISK USAGE   CONTENT SIZE   EXTRA
llm-chatbot:fat    e8de32dd85d4        308MB             0B    U
llm-chatbot:slim   e1f5e9b31e53        123MB             0B
</code></code></pre><p>Nice! We reduced the image size from 308 MB to 123 MB, about a 2.5x reduction.</p><p>Let&#8217;s run the slim image with the environment variable and see what happens.</p><pre><code><code>docker run -p 8000:8000 -e OPENAI_API_KEY=$OPENAI_API_KEY llm-chatbot:slim
</code></code></pre><p><strong>Output</strong></p><pre><code><code>File "/usr/local/lib/python3.11/site-packages/chainlit/server.py", line 181, in get_build_dir
    raise FileNotFoundError(f"{local_target} built UI dir not found")
FileNotFoundError: libs/copilot built UI dir not found
</code></code></pre><p>The error comes from a mismatch between Chainlit and slim:</p><ul><li><p>Chainlit expects <code>chainlit/copilot/</code> to exist when the server starts</p></li><li><p>Even with <code>--continue-after enter</code>, slim removed <code>chainlit/copilot/</code> because the chat you exercised in the browser only loaded the main chat UI. The Copilot widget is a separate Chainlit feature; no file inside <code>chainlit/copilot/</code> was opened during the probe</p></li><li><p>Now Chainlit&#8217;s startup check finds the directory missing and the container crashes</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fY20!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fY20!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png 424w, https://substackcdn.com/image/fetch/$s_!fY20!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png 848w, https://substackcdn.com/image/fetch/$s_!fY20!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png 1272w, https://substackcdn.com/image/fetch/$s_!fY20!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fY20!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png" width="1080" height="864" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:864,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Chainlit vs slim mismatch: the same GET / probe loads chainlit/main (kept by slim) but skips chainlit/copilot (stripped by slim). Chainlit's startup check for the stripped directory then crashes the container.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Chainlit vs slim mismatch: the same GET / probe loads chainlit/main (kept by slim) but skips chainlit/copilot (stripped by slim). Chainlit's startup check for the stripped directory then crashes the container." title="Chainlit vs slim mismatch: the same GET / probe loads chainlit/main (kept by slim) but skips chainlit/copilot (stripped by slim). Chainlit's startup check for the stripped directory then crashes the container." srcset="https://substackcdn.com/image/fetch/$s_!fY20!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png 424w, https://substackcdn.com/image/fetch/$s_!fY20!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png 848w, https://substackcdn.com/image/fetch/$s_!fY20!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png 1272w, https://substackcdn.com/image/fetch/$s_!fY20!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79a89fc-dd25-459b-9bf0-6dbc687f87e5_1080x864.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is not unique to Chainlit or chat-UI frameworks. Any framework that loads features lazily but checks for them at startup is vulnerable. Django&#8217;s admin, FastAPI apps with multiple routers, ML serving frameworks with embedded UIs, and plugin systems all hit the same problem.</p><h3>Add <code>--include-path</code> for the Chainlit Package</h3><p>The fix is <code>--include-path</code>, which tells SlimToolkit to preserve a path regardless of whether probing touched it. The path that matters is the whole Chainlit package directory, which contains every feature bundle Chainlit ships:</p><pre><code><code>slim build \
    --target llm-chatbot:fat \
    --tag llm-chatbot:slim \
    --include-path /usr/local/lib/python3.11/site-packages/chainlit \
    --continue-after enter \
    --env OPENAI_API_KEY=$OPENAI_API_KEY
</code></code></pre><p>Compare the images again:</p><pre><code><code>docker images llm-chatbot
</code></code></pre><p><strong>Output</strong></p><pre><code><code>IMAGE              ID             DISK USAGE   CONTENT SIZE   EXTRA
llm-chatbot:fat    e8de32dd85d4        308MB             0B    U
llm-chatbot:slim   952b6b44df9f        163MB             0B    U
</code></code></pre><p>Re-run the image to confirm it works:</p><pre><code><code>docker run -p 8000:8000 -e OPENAI_API_KEY=$OPENAI_API_KEY llm-chatbot:slim
</code></code></pre><p>With the <code>chainlit</code> directory preserved, the slim container starts and runs as expected.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wgnL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wgnL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 424w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 848w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 1272w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wgnL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png" width="960" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/523eca70-fd4b-4251-8f43-22287915a192_960x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:960,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Chainlit chatbot's welcome screen, running from the slim container at 163 MB.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Chainlit chatbot's welcome screen, running from the slim container at 163 MB." title="The Chainlit chatbot's welcome screen, running from the slim container at 163 MB." srcset="https://substackcdn.com/image/fetch/$s_!wgnL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 424w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 848w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 1272w, https://substackcdn.com/image/fetch/$s_!wgnL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F523eca70-fd4b-4251-8f43-22287915a192_960x572.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Inspecting the Result with <code>slim xray</code></h2><p>To see exactly which files slim stripped, run <code>slim xray</code> against both images. It reverse-engineers a built image into a JSON report listing every file, its size, and the layer it came from. Slim always writes its output to <code>slim.report.json</code>, so rename the first report before the second run overwrites it:</p><pre><code><code>slim xray --target llm-chatbot:fat
mv slim.report.json fat.report.json

slim xray --target llm-chatbot:slim
</code></code></pre><p>Each report is several megabytes of JSON, which makes manual comparison painful. To handle that, I packaged the diff and summary steps into <code>compare.sh</code>:</p><pre><code><code>bash compare.sh
</code></code></pre><p>Here are the biggest deletions, grouped by bucket:</p><pre><code><code>Removed                          Size    Bucket
/usr/bin/perl                    3.8 MB  OS cruft
libapt-pkg.so                    2.4 MB  OS cruft (apt)
ensurepip/pip-24.0.whl           2.1 MB  Python build leftover
libdb-5.3.so                     1.8 MB  OS cruft (apt)
/usr/bin/sqv                     1.6 MB  OS cruft (apt&#8217;s PGP verifier)
/usr/bin/bash                    1.4 MB  OS cruft
ensurepip/setuptools-79.0.1.whl  1.3 MB  Python build leftover
multidict/_multidict.so          923 kB  Unused part of aiohttp
jiter/jiter.so                   880 kB  Unused part of openai
pydoc_data/topics.py             775 kB  Python build leftover
aiohttp/_http_writer.so          600 kB  Unused part of aiohttp</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GbAY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GbAY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png 424w, https://substackcdn.com/image/fetch/$s_!GbAY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png 848w, https://substackcdn.com/image/fetch/$s_!GbAY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png 1272w, https://substackcdn.com/image/fetch/$s_!GbAY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GbAY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png" width="1080" height="828" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:828,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The biggest deletions, grouped by bucket&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The biggest deletions, grouped by bucket" title="The biggest deletions, grouped by bucket" srcset="https://substackcdn.com/image/fetch/$s_!GbAY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png 424w, https://substackcdn.com/image/fetch/$s_!GbAY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png 848w, https://substackcdn.com/image/fetch/$s_!GbAY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png 1272w, https://substackcdn.com/image/fetch/$s_!GbAY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6712a248-1eba-4f58-a1f9-430bf66581fc_1080x828.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The biggest savings come from the Debian base image, not from the Python packages. Of the top 11 deletions:</p><ul><li><p><strong>Five</strong> are base-image binaries: <code>perl</code>, <code>bash</code>, <code>libapt-pkg</code>, <code>libdb-5.3</code>, <code>sqv</code></p></li><li><p><strong>Three</strong> are install-time leftovers: bundled pip and setuptools wheels, plus the <code>pydoc</code> help-text database</p></li><li><p><strong>Three</strong> are write-side or helper modules of runtime libraries the probe didn&#8217;t exercise: <code>aiohttp/_http_writer</code>, <code>multidict</code>, <code>jiter</code></p></li></ul><h2>Final Thoughts</h2><p>A single <code>slim build</code> command took this chatbot from 308 MB to 163 MB. That is one data point on one image. Your numbers will likely look different. The wider the gap between what your image installs and what it actually runs at runtime, the bigger the reduction tends to be. Give it a try on your own images and see what kind of improvement you get.</p><h2>Related Tutorials</h2><ul><li><p><strong><a href="https://codecut.ai/run-github-actions-locally-act/">How to Test GitHub Actions Locally with act</a></strong>: Iterate on a slim-build CI workflow locally before pushing.</p></li><li><p><strong><a href="https://codecut.ai/unregistry-direct-docker-deployment/">Unregistry: Skip the Registry, Deploy Docker Images Directly</a></strong>: Deploy the slimmed image straight to a server, no registry required.</p></li></ul><div><hr></div><blockquote><p>&#128218; <strong>Want to go deeper?</strong> Learning new techniques is the easy part. Knowing how to structure, test, and deploy them is what separates side projects from real work. My book shows you how to build data science projects that actually make it to production. <a href="https://codecut.ai/production-ready-data-science/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=book_cta_footer">Get the book &#8594;</a></p></blockquote><div><hr></div><p><em>Originally published on <a href="https://codecut.ai/shrink-python-container-slimtoolkit/">CodeCut</a>.</em></p>]]></content:encoded></item><item><title><![CDATA[Never Use yaml.load() in Python. Here’s Why.]]></title><description><![CDATA[Plus stop AI from hallucinating library APIs]]></description><link>https://newsletter.codecut.ai/p/never-use-yamlload-in-python-heres</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/never-use-yamlload-in-python-heres</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 14 May 2026 16:02:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Zjm0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Never Use yaml.load() in Python. Here&#8217;s Why.</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Zjm0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zjm0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png 424w, https://substackcdn.com/image/fetch/$s_!Zjm0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png 848w, https://substackcdn.com/image/fetch/$s_!Zjm0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png 1272w, https://substackcdn.com/image/fetch/$s_!Zjm0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zjm0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png" width="1080" height="824" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:824,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Never Use yaml.load() in Python. Here's Why.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Never Use yaml.load() in Python. Here's Why." title="Code example: Never Use yaml.load() in Python. Here's Why." srcset="https://substackcdn.com/image/fetch/$s_!Zjm0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png 424w, https://substackcdn.com/image/fetch/$s_!Zjm0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png 848w, https://substackcdn.com/image/fetch/$s_!Zjm0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png 1272w, https://substackcdn.com/image/fetch/$s_!Zjm0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb31b7086-55d6-45e3-ab6d-e3117ccd25bc_1080x824.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Has your AI assistant ever suggested yaml.load() to parse a config file?</p><p>It&#8217;s an easy mistake: yaml.load() looks like a clean way to turn YAML into a Python dict, and AI tools generate it freely because it appears in plenty of legacy code.</p><p>But <code>yaml.load()</code> can do more than parse text. It can execute Python objects embedded in the YAML, meaning anyone who controls that file could run shell commands on your machine.</p><h4>Solution</h4><p>Use <code>yaml.safe_load()</code> instead. It only supports standard YAML types like mappings, lists, strings, numbers, booleans, and null, and rejects anything that tries to execute code.</p><p>To catch unsafe <code>yaml.load()</code> calls automatically, scan your codebase with <strong><a href="https://github.com/PyCQA/bandit">Bandit</a></strong>.</p><blockquote><p>&#128214; <a href="https://codecut.ai/bandit-ai-generated-python-security/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_bandit-ai-generated-python-security">View Full Article</a></p></blockquote><div><hr></div><h3>Context7: Stop AI Agents from Generating Deprecated Syntax</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Bagp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Bagp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png 424w, https://substackcdn.com/image/fetch/$s_!Bagp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png 848w, https://substackcdn.com/image/fetch/$s_!Bagp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png 1272w, https://substackcdn.com/image/fetch/$s_!Bagp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Bagp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png" width="1080" height="1298" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1298,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Context7: Stop AI Agents from Generating Deprecated Syntax&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Context7: Stop AI Agents from Generating Deprecated Syntax" title="Code example: Context7: Stop AI Agents from Generating Deprecated Syntax" srcset="https://substackcdn.com/image/fetch/$s_!Bagp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png 424w, https://substackcdn.com/image/fetch/$s_!Bagp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png 848w, https://substackcdn.com/image/fetch/$s_!Bagp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png 1272w, https://substackcdn.com/image/fetch/$s_!Bagp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac6eb27-47f7-401b-ad36-87ee90957020_1080x1298.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>AI coding assistants often generate code using training data that may already be outdated.</p><p>That means if you ask for Polars 1.x code, the model may still generate deprecated 0.x APIs from older training data.</p><h4>Solution</h4><p><strong><a href="https://github.com/upstash/context7">Context7</a></strong> solves this by pulling the latest, version-specific library docs directly into the prompt before the assistant writes any code. That way, it generates code against the API that actually exists today.</p><p>Other capabilities:</p><ul><li><p>One command sets it up across Cursor, Claude Code, Copilot, and 30+ clients</p></li><li><p>Trigger with <code>use context7</code> in any prompt</p></li><li><p>Runs as either an MCP server or a CLI + skill, so it works with or without MCP support</p></li><li><p>Automatically loads version-matched docs like &#8220;Polars 1.0</p></li></ul><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/beartype/beartype">beartype</a></strong> <em>[Code Quality]</em> - Near-real-time pure-Python runtime type-checker. Decorate a function and catch type violations the moment they happen, not after a stack trace.</p><p><strong><a href="https://github.com/jendrikseipp/vulture">vulture</a></strong> <em>[Code Quality]</em> - Find dead Python code. Scans your project for unused functions, classes, imports, and variables so you can safely delete them.</p><p><strong><a href="https://github.com/asottile/pyupgrade">pyupgrade</a></strong> <em>[Code Quality]</em> - A tool (and pre-commit hook) that automatically upgrades Python syntax to newer language versions. Drop f-strings, dict literals, and modern type hints in one sweep.</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Bandit: Catch Insecure Patterns in AI-Generated Python Code]]></title><description><![CDATA[Plus run LLMs 70% faster with llama.cpp]]></description><link>https://newsletter.codecut.ai/p/bandit-catch-insecure-patterns-in</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/bandit-catch-insecure-patterns-in</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 12 May 2026 16:01:35 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!GRkv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Bandit: Catch Insecure Patterns in AI-Generated Python Code</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GRkv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GRkv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png 424w, https://substackcdn.com/image/fetch/$s_!GRkv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png 848w, https://substackcdn.com/image/fetch/$s_!GRkv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png 1272w, https://substackcdn.com/image/fetch/$s_!GRkv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GRkv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png" width="1024" height="753" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:753,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Bandit: Catch Insecure Patterns in AI-Generated Python Code&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Bandit: Catch Insecure Patterns in AI-Generated Python Code" title="Code example: Bandit: Catch Insecure Patterns in AI-Generated Python Code" srcset="https://substackcdn.com/image/fetch/$s_!GRkv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png 424w, https://substackcdn.com/image/fetch/$s_!GRkv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png 848w, https://substackcdn.com/image/fetch/$s_!GRkv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png 1272w, https://substackcdn.com/image/fetch/$s_!GRkv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbedf982c-4840-457a-ae19-f11ed4f2b053_1024x753.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>LLMs have become extremely good at generating syntactically valid Python, but security quality has barely improved.</p><p>Veracode&#8217;s Spring 2026 GenAI Code Security Report found that security pass rates have remained stuck near 55% since 2024.</p><p>That gap exists because models learn from public code full of insecure patterns and reproduce them when prompted.</p><p>At the same time, reviewers usually verify whether code works, not whether it introduces vulnerabilities.</p><h4>Solution</h4><p><strong><a href="https://github.com/PyCQA/bandit">Bandit</a></strong> is a static analyzer for Python that identifies insecure patterns by matching code against 60+ Common Weakness Enumeration (CWE) rules.</p><p>Key capabilities:</p><ul><li><p>Flags hardcoded secrets, weak hashes (MD5, SHA1), and unsafe deserialization</p></li><li><p>Detects SQL string concatenation, <code>eval</code>, and <code>exec</code> injection risks</p></li><li><p>Catches empty <code>except</code> blocks and unpinned Hugging Face downloads</p></li><li><p>Integrates with pre-commit hooks and GitHub Actions out of the box</p></li><li><p>Maps every finding to a CWE ID so issues stay auditable</p></li></ul><blockquote><p>&#128214; <a href="https://codecut.ai/bandit-ai-generated-python-security/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_bandit-ai-generated-python-security">View Full Article</a></p></blockquote><div><hr></div><h3>llama.cpp: Run LLMs 70% Faster Than Ollama on the Same GPU</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wSdt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wSdt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png 424w, https://substackcdn.com/image/fetch/$s_!wSdt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png 848w, https://substackcdn.com/image/fetch/$s_!wSdt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png 1272w, https://substackcdn.com/image/fetch/$s_!wSdt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wSdt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png" width="1080" height="738" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:738,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: llama.cpp: Run LLMs 70% Faster Than Ollama on the Same GPU&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: llama.cpp: Run LLMs 70% Faster Than Ollama on the Same GPU" title="Code example: llama.cpp: Run LLMs 70% Faster Than Ollama on the Same GPU" srcset="https://substackcdn.com/image/fetch/$s_!wSdt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png 424w, https://substackcdn.com/image/fetch/$s_!wSdt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png 848w, https://substackcdn.com/image/fetch/$s_!wSdt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png 1272w, https://substackcdn.com/image/fetch/$s_!wSdt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9492d3c7-9010-4fec-9062-d44b85ac96d7_1080x738.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>An r/LocalLLaMA benchmark on Qwen-3 Coder 32B (FP16) measured Ollama at 30 tokens/sec and llama.cpp at 52 tokens/sec on the same model and hardware.</p><p>Ollama is built on top of llama.cpp, so the core inference engine is identical. The performance gap comes from configuration.</p><h4>Solution</h4><p>Ollama ships with conservative defaults designed to work reliably across many systems. <strong><a href="https://github.com/ggml-org/llama.cpp">llama.cpp</a></strong> exposes the low-level tuning flags so you can optimize specifically for your hardware.</p><p>Key flags to tune:</p><ul><li><p>GPU offload (<code>-ngl 99</code>): put the entire model on your GPU instead of partial offload</p></li><li><p>Throughput (<code>--batch-size</code>): bigger means faster prompts but more GPU memory</p></li><li><p>Context length (<code>--cache-type-k q4</code>): use less GPU memory per token so longer prompts fit</p></li><li><p>Generation speed (<code>-md</code>): run a small helper model alongside your main model for 2-3x faster generation</p></li></ul><blockquote><p>&#128214; <a href="https://www.reddit.com/r/LocalLLaMA/comments/1q64f26/llamacpp_vs_ollama_70_higher_code_generation/">View Source</a></p></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/plasma-umass/scalene">scalene</a></strong> <em>[Code Quality]</em> - A high-performance CPU, GPU, and memory profiler for Python with AI-powered optimization proposals.</p><p><strong><a href="https://github.com/pymc-labs/pymc-marketing">pymc-marketing</a></strong> <em>[Data Analysis]</em> - Bayesian marketing toolbox in PyMC. Includes Media Mix Modeling (MMM), customer lifetime value (CLV), and buy-till-you-die (BTYD) models.</p><p><strong><a href="https://github.com/antoniorodr/cronboard">cronboard</a></strong> <em>[Workflow Automation]</em> - A terminal-based dashboard for managing cron jobs locally and on remote servers. Add, edit, pause, resume, and search jobs from the terminal.</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Slim: Shrink Docker Images by 30x with One Command]]></title><description><![CDATA[Plus run vectorized expressions on Polars lists]]></description><link>https://newsletter.codecut.ai/p/slim-shrink-docker-images-by-30x</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/slim-shrink-docker-images-by-30x</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 07 May 2026 16:01:20 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!pUW-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Slim: Shrink Docker Images by 30x with One Command</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pUW-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pUW-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png 424w, https://substackcdn.com/image/fetch/$s_!pUW-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png 848w, https://substackcdn.com/image/fetch/$s_!pUW-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png 1272w, https://substackcdn.com/image/fetch/$s_!pUW-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pUW-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png" width="1080" height="1244" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1244,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Slim: Shrink Docker Images by 30x with One Command&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Slim: Shrink Docker Images by 30x with One Command" title="Code example: Slim: Shrink Docker Images by 30x with One Command" srcset="https://substackcdn.com/image/fetch/$s_!pUW-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png 424w, https://substackcdn.com/image/fetch/$s_!pUW-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png 848w, https://substackcdn.com/image/fetch/$s_!pUW-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png 1272w, https://substackcdn.com/image/fetch/$s_!pUW-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce79fb5-4672-4bc7-ae0a-29087fb62def_1080x1244.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Docker images include the entire OS layer. For a simple Python app, this is unnecessary because it never touches the shells, compilers, and system utilities bundled inside.</p><p>This inflates images to hundreds of megabytes, wasting storage and adding time to every deploy.</p><h4>Solution</h4><p><strong><a href="https://github.com/slimtoolkit/slim">Slim</a></strong> automatically analyzes your container at runtime to identify which files are actually used, then builds a minimal image with only essential components.</p><p>Slim works alongside Docker, not instead of it:</p><ul><li><p>Step 1: Build your image with <code>docker build</code></p></li><li><p>Step 2: Minify with <code>slim build your-image</code></p></li><li><p>Step 3: Push the <code>.slim</code> image to your registry</p></li><li><p>Your Dockerfile and workflow stay the same</p></li></ul><blockquote></blockquote><div><hr></div><h3>Polars: Vectorize List Column Transformations with list.eval</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tU4K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tU4K!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png 424w, https://substackcdn.com/image/fetch/$s_!tU4K!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png 848w, https://substackcdn.com/image/fetch/$s_!tU4K!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png 1272w, https://substackcdn.com/image/fetch/$s_!tU4K!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tU4K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png" width="683" height="695" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:695,&quot;width&quot;:683,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Polars: Vectorize List Column Transformations with list.eval&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Polars: Vectorize List Column Transformations with list.eval" title="Code example: Polars: Vectorize List Column Transformations with list.eval" srcset="https://substackcdn.com/image/fetch/$s_!tU4K!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png 424w, https://substackcdn.com/image/fetch/$s_!tU4K!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png 848w, https://substackcdn.com/image/fetch/$s_!tU4K!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png 1272w, https://substackcdn.com/image/fetch/$s_!tU4K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80dab8d9-35ce-4211-979a-7e9b98aebda2_683x695.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>When working with list columns, most people reach for <code>apply</code> with a Python lambda that loops over every list row by row.</p><p>That approach breaks vectorization, so performance quickly degrades as the dataset grows.</p><h4>Solution</h4><p><strong><a href="https://github.com/pola-rs/polars">Polars</a></strong> solves this with <code>list.eval</code>, which runs a full expression against each list using <code>pl.element()</code> and stays fully vectorized.</p><p>Key benefits:</p><ul><li><p>Vectorized per-element transformations without Python loops</p></li><li><p>Support for a wide range of expressions, including aggregations like <code>max</code>, <code>mean</code>, and <code>sum</code></p></li><li><p>Composable with other Polars expressions for clean, readable pipelines</p></li></ul><blockquote><p>&#128214; <a href="https://codecut.ai/pandas-vs-polars-vs-duckdb-comparison/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_pandas-vs-polars-vs-duckdb-comparison">View Full Article</a></p></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/asottile/pyupgrade">pyupgrade</a></strong> <em>[Code Quality]</em> - A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of Python.</p><p><strong><a href="https://github.com/bgreenwell/doxx">doxx</a></strong> <em>[Python Utils]</em> - Expose the contents of .docx files without leaving your terminal. Fast, safe, and smart, with no Office required.</p><p><strong><a href="https://github.com/bruin-data/ingestr">ingestr</a></strong> <em>[Data Processing]</em> - ingestr is a CLI tool to copy data between any databases with a single command seamlessly.</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Mem0: Turn AI Conversations into a Knowledge Graph]]></title><description><![CDATA[Plus Git-style versioning for cloud storage]]></description><link>https://newsletter.codecut.ai/p/mem0-turn-ai-conversations-into-a</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/mem0-turn-ai-conversations-into-a</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 05 May 2026 16:01:18 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!uyGL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Mem0: Turn AI Conversations into a Knowledge Graph</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uyGL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uyGL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png 424w, https://substackcdn.com/image/fetch/$s_!uyGL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png 848w, https://substackcdn.com/image/fetch/$s_!uyGL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png 1272w, https://substackcdn.com/image/fetch/$s_!uyGL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uyGL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png" width="1080" height="1328" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1328,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Mem0: Turn AI Conversations into a Knowledge Graph&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Mem0: Turn AI Conversations into a Knowledge Graph" title="Code example: Mem0: Turn AI Conversations into a Knowledge Graph" srcset="https://substackcdn.com/image/fetch/$s_!uyGL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png 424w, https://substackcdn.com/image/fetch/$s_!uyGL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png 848w, https://substackcdn.com/image/fetch/$s_!uyGL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png 1272w, https://substackcdn.com/image/fetch/$s_!uyGL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42ac10a5-65f5-4a7b-9b8a-d2ba03fc160b_1080x1328.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Vector databases store each memory as an independent embedding. You can search for similar text, but they cannot link entities across facts or follow relationships between them.</p><p>Store &#8220;Alice and Bob are collaborating&#8221; and &#8220;Alice leads payments&#8221; separately, and a vector store cannot recognize that both facts refer to the same Alice.</p><h4>Solution</h4><p><strong><a href="https://github.com/mem0ai/mem0">Mem0</a></strong> fixes this by extracting entities and relationships from each conversation.</p><p>When you store &#8220;Alice and Bob are collaborating&#8221; and &#8220;Alice leads payments,&#8221; Mem0 recognizes that both facts refer to the same Alice and links them in a knowledge graph.</p><p>Key capabilities:</p><ul><li><p>Reads raw conversations and identifies the entities for you</p></li><li><p>Relationship tracking between people, projects, and concepts</p></li><li><p>A memory layer that grows smarter with every interaction</p></li></ul><blockquote><p>&#129514; <a href="https://bit.ly/4eXJRYY">Run code</a></p></blockquote><div><hr></div><h3>lakeFS: Bring Git-Style Branches and Commits to Cloud Storage</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jBzo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jBzo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png 424w, https://substackcdn.com/image/fetch/$s_!jBzo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png 848w, https://substackcdn.com/image/fetch/$s_!jBzo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png 1272w, https://substackcdn.com/image/fetch/$s_!jBzo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jBzo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png" width="626" height="619" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:619,&quot;width&quot;:626,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: lakeFS: Bring Git-Style Branches and Commits to Cloud Storage&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: lakeFS: Bring Git-Style Branches and Commits to Cloud Storage" title="Code example: lakeFS: Bring Git-Style Branches and Commits to Cloud Storage" srcset="https://substackcdn.com/image/fetch/$s_!jBzo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png 424w, https://substackcdn.com/image/fetch/$s_!jBzo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png 848w, https://substackcdn.com/image/fetch/$s_!jBzo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png 1272w, https://substackcdn.com/image/fetch/$s_!jBzo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb307b68b-3ae0-4497-94ab-f933d35df7ce_626x619.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Cloud storage like S3, Google Cloud Storage, and Azure Blob has no concept of versions, branches, or commits like Git does.</p><p>As a result, testing changes can mean copying terabytes of data, and fixing mistakes requires tedious file-by-file restores.</p><h4>Solution</h4><p><strong><a href="https://github.com/treeverse/lakeFS">lakeFS</a></strong> turns your cloud storage into a Git-like repository. You get branches, commits, merges, and instant rollback, all without copying data.</p><blockquote></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/unslothai/unsloth">unsloth</a></strong> <em>[LLM]</em> - Fine-tune LLMs 5x faster with 60% less memory using QLoRA, no accuracy loss.</p><p><strong><a href="https://github.com/upstash/context7">context7</a></strong> <em>[RAG]</em> - Pulls up-to-date, version-specific docs and code examples straight into your LLM prompts and AI code editors.</p><p><strong><a href="https://github.com/yamadashy/repomix">Repomix</a></strong> <em>[LLM]</em> - Packs your entire repository into a single AI-friendly file you can paste into Claude, ChatGPT, or Gemini.</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Generate Time-Sortable IDs with Python 3.14’s UUID v7]]></title><description><![CDATA[Plus auto-infer Python types with Pyrefly]]></description><link>https://newsletter.codecut.ai/p/generate-time-sortable-ids-with-python</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/generate-time-sortable-ids-with-python</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 30 Apr 2026 16:01:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!AC9Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Generate Time-Sortable IDs with Python 3.14&#8217;s UUID v7</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AC9Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AC9Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png 424w, https://substackcdn.com/image/fetch/$s_!AC9Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png 848w, https://substackcdn.com/image/fetch/$s_!AC9Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png 1272w, https://substackcdn.com/image/fetch/$s_!AC9Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AC9Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png" width="474" height="535" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:535,&quot;width&quot;:474,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Generate Time-Sortable IDs with Python 3.14's UUID v7&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Generate Time-Sortable IDs with Python 3.14's UUID v7" title="Code example: Generate Time-Sortable IDs with Python 3.14's UUID v7" srcset="https://substackcdn.com/image/fetch/$s_!AC9Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png 424w, https://substackcdn.com/image/fetch/$s_!AC9Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png 848w, https://substackcdn.com/image/fetch/$s_!AC9Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png 1272w, https://substackcdn.com/image/fetch/$s_!AC9Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174270cf-93f4-46be-8cfe-ec631907a67b_474x535.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>UUID4 generates purely random identifiers that lack chronological ordering.</p><p>Without embedded timestamps, you need separate timestamp fields and custom sorting logic to organize records by creation time.</p><h4>Solution</h4><p>Python 3.14 introduces UUID version 7 with built-in timestamp ordering.</p><p>Key features:</p><ul><li><p>Determine creation order by comparing two UUIDs directly</p></li><li><p>Retrieve exact creation time by extracting the embedded timestamp</p></li></ul><blockquote></blockquote><div><hr></div><h3>Pyrefly: Automatic Type Inference for Python</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2Ucg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Ucg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png 424w, https://substackcdn.com/image/fetch/$s_!2Ucg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png 848w, https://substackcdn.com/image/fetch/$s_!2Ucg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ucg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Ucg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png" width="662" height="446" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:446,&quot;width&quot;:662,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Pyrefly: Automatic Type Inference for Python&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Pyrefly: Automatic Type Inference for Python" title="Code example: Pyrefly: Automatic Type Inference for Python" srcset="https://substackcdn.com/image/fetch/$s_!2Ucg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png 424w, https://substackcdn.com/image/fetch/$s_!2Ucg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png 848w, https://substackcdn.com/image/fetch/$s_!2Ucg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ucg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F812a4bae-301f-4fb8-adcc-43769828f2c2_662x446.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>By default, MyPy ignores untyped function bodies, forcing you to manually annotate variables and return types to get meaningful type checking.</p><p>This adds overhead and clutters your code with types that don&#8217;t add much value.</p><h4>Solution</h4><p><strong><a href="https://github.com/facebook/pyrefly">Pyrefly</a></strong> automatically infers return types and local variable types from usage, so you only annotate function parameters and public APIs where it matters.</p><p>Other features:</p><ul><li><p>Lightning-fast type checking built in Rust</p></li><li><p>Works with VSCode, Neovim, Helix, Emacs, and Zed</p></li><li><p>Recognizes dataclass transforms from attrs, Pydantic, and similar libraries</p></li></ul><blockquote></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/tobgu/pyrsistent">pyrsistent</a></strong> <em>[Python Utils]</em> - Persistent/Immutable/Functional data structures for Python</p><p><strong><a href="https://github.com/GrahamDumpleton/wrapt">wrapt</a></strong> <em>[Python Utils]</em> - A Python module for decorators, wrappers and monkey patching</p><p><strong><a href="https://github.com/posit-dev/py-shiny">Shiny for Python</a></strong> <em>[Dashboard]</em> - Build fast, beautiful reactive web applications in Python</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[kotaemon: Self-Hosted Document QA with Citations in One Command]]></title><description><![CDATA[Plus replace MCP tools with modular skill files]]></description><link>https://newsletter.codecut.ai/p/kotaemon-self-hosted-document-qa</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/kotaemon-self-hosted-document-qa</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 28 Apr 2026 16:01:41 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_mBQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>kotaemon: Self-Hosted Document QA with Citations in One Command</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_mBQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_mBQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png 424w, https://substackcdn.com/image/fetch/$s_!_mBQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png 848w, https://substackcdn.com/image/fetch/$s_!_mBQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png 1272w, https://substackcdn.com/image/fetch/$s_!_mBQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_mBQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png" width="1200" height="792" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:792,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: kotaemon: Self-Hosted Document QA with Citations in One Command&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: kotaemon: Self-Hosted Document QA with Citations in One Command" title="Code example: kotaemon: Self-Hosted Document QA with Citations in One Command" srcset="https://substackcdn.com/image/fetch/$s_!_mBQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png 424w, https://substackcdn.com/image/fetch/$s_!_mBQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png 848w, https://substackcdn.com/image/fetch/$s_!_mBQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png 1272w, https://substackcdn.com/image/fetch/$s_!_mBQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e64a13e-0bd5-48e0-914c-e7357f1e2547_1200x792.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Building a RAG app for document Q&amp;A usually means assembling a parser, vector database, retrieval pipeline, and UI from scratch.</p><p>Each piece has its own setup, and getting everything to work together can take hours of debugging.</p><h4>Solution</h4><p><strong><a href="https://github.com/Cinnamon/kotaemon">kotaemon</a></strong> packages the entire RAG stack into a single Docker image, letting you skip the setup and go straight to asking questions.</p><p>Key features:</p><ul><li><p>Citations linked to exact PDF pages for verifiable answers</p></li><li><p>Question answering across multiple documents with figures and tables</p></li><li><p>Works with local models or cloud APIs like OpenAI, Azure, and Groq</p></li><li><p>Extensible Gradio-based UI with multi-user document management</p></li></ul><blockquote></blockquote><div><hr></div><h3>gws: Replace Bulky MCP Tools with 100+ Modular Skill Files</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cZVv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cZVv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png 424w, https://substackcdn.com/image/fetch/$s_!cZVv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png 848w, https://substackcdn.com/image/fetch/$s_!cZVv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png 1272w, https://substackcdn.com/image/fetch/$s_!cZVv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cZVv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png" width="1200" height="801" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:801,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: gws: Replace Bulky MCP Tools with 100+ Modular Skill Files&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: gws: Replace Bulky MCP Tools with 100+ Modular Skill Files" title="Code example: gws: Replace Bulky MCP Tools with 100+ Modular Skill Files" srcset="https://substackcdn.com/image/fetch/$s_!cZVv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png 424w, https://substackcdn.com/image/fetch/$s_!cZVv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png 848w, https://substackcdn.com/image/fetch/$s_!cZVv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png 1272w, https://substackcdn.com/image/fetch/$s_!cZVv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F839a4917-12c5-4cf3-919c-4c16182e9df2_1200x801.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Connecting AI agents to Google Workspace through MCP often means injecting every tool definition into each request, even if only a couple are needed.</p><p>That overhead quickly eats into the token budget, leaving less room for reasoning and task execution.</p><h4>Solution</h4><p><strong><a href="https://github.com/googleworkspace/cli">gws</a></strong> solves this by replacing bulky tool definitions with 100+ modular SKILL.md files.</p><p>Agents load only the skills they need, keeping the context lean and efficient.</p><p>Key features:</p><ul><li><p>Works with Claude Code, Cursor, Gemini CLI, and other AI agents out of the box</p></li><li><p>100+ skill files covering Google Docs, Sheets, Drive, Calendar, and more</p></li><li><p>Agents load only relevant skills instead of full tool definitions</p></li></ul><blockquote></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/Unstructured-IO/unstructured">unstructured</a></strong> <em>[RAG]</em> - Turn any document into clean, structured data ready for RAG pipelines and LLM applications.</p><p><strong><a href="https://github.com/mangiucugna/json_repair">json_repair</a></strong> <em>[LLM]</em> - Repair malformed JSON from LLMs, APIs, and logs. A drop-in replacement for json.loads() that auto-fixes broken output.</p><p><strong><a href="https://github.com/mindsdb/mindsdb">MindsDB</a></strong> <em>[AI Agents]</em> - Query AI models directly from your database using SQL. Connect 200+ data sources to LLMs, ML, and vector operations.</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[TimescaleDB: Turn PostgreSQL into a Time-Series Engine with One Extension]]></title><description><![CDATA[Plus constrain LLM outputs with one function]]></description><link>https://newsletter.codecut.ai/p/timescaledb-turn-postgresql-into</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/timescaledb-turn-postgresql-into</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 23 Apr 2026 16:01:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PQZJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>TimescaleDB: Turn PostgreSQL into a Time-Series Engine with One Extension (Sponsored)</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eC_x!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eC_x!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png 424w, https://substackcdn.com/image/fetch/$s_!eC_x!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png 848w, https://substackcdn.com/image/fetch/$s_!eC_x!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png 1272w, https://substackcdn.com/image/fetch/$s_!eC_x!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eC_x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png" width="600" height="261" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:261,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: TimescaleDB: Turn PostgreSQL into a Time-Series Engine with One Extension&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: TimescaleDB: Turn PostgreSQL into a Time-Series Engine with One Extension" title="Code example: TimescaleDB: Turn PostgreSQL into a Time-Series Engine with One Extension" srcset="https://substackcdn.com/image/fetch/$s_!eC_x!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png 424w, https://substackcdn.com/image/fetch/$s_!eC_x!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png 848w, https://substackcdn.com/image/fetch/$s_!eC_x!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png 1272w, https://substackcdn.com/image/fetch/$s_!eC_x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66b3fa45-dc41-46a6-9b11-799213db0ed1_600x261.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>In standard PostgreSQL, all rows live in one table. As time-series data grows into the millions, queries cannot skip irrelevant data, so even recent lookups scan far more than needed.</p><h4>Solution</h4><p><a href="https://fandf.co/41KN2eZ">TimescaleDB</a> solves this with hypertables, which automatically partition data into time-based chunks.</p><p>Queries only touch the relevant chunks, leaving the rest untouched.</p><p>Other capabilities:</p><ul><li><p>Shrink storage by up to 95% with columnar compression that stays fully queryable</p></li><li><p>Faster queries with continuous aggregates that refresh only new data</p></li><li><p>Built-in retention policies to automatically remove old data</p></li></ul><blockquote></blockquote><div><hr></div><h3>Guidance: One Function for Clean LLM Labels</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PQZJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PQZJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png 424w, https://substackcdn.com/image/fetch/$s_!PQZJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png 848w, https://substackcdn.com/image/fetch/$s_!PQZJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png 1272w, https://substackcdn.com/image/fetch/$s_!PQZJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PQZJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png" width="668" height="514" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:514,&quot;width&quot;:668,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Guidance: One Function for Clean LLM Labels&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Guidance: One Function for Clean LLM Labels" title="Code example: Guidance: One Function for Clean LLM Labels" srcset="https://substackcdn.com/image/fetch/$s_!PQZJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png 424w, https://substackcdn.com/image/fetch/$s_!PQZJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png 848w, https://substackcdn.com/image/fetch/$s_!PQZJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png 1272w, https://substackcdn.com/image/fetch/$s_!PQZJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95fc8c91-2e5c-4483-87da-0f42652da335_668x514.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Classification tasks with LLMs can get messy. Instead of a clean label, you might get &#8220;Option A&#8221;, &#8220;The answer is A&#8221;, or a full explanation.</p><p>Cleaning this up requires extra parsing, retries, and validation that can make your system fragile.</p><h4>Solution</h4><p>With <a href="https://github.com/guidance-ai/guidance">Guidance</a>, the <code>select()</code> function constrains the model to return exactly one option from your list.</p><p>Key benefits:</p><ul><li><p>Guarantees output matches one of your predefined options</p></li><li><p>Eliminate parsing code and regex patterns</p></li><li><p>Works with any list of valid choices</p></li></ul><blockquote><p>&#128214; <a href="https://codecut.ai/structured-llm-outputs-tools-comparison/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_structured-llm-outputs-tools-comparison">View Full Article</a></p></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/google-research/timesfm">TimesFM</a></strong> <em>[ML]</em> - Pretrained time-series foundation model by Google Research for zero-shot forecasting</p><p><strong><a href="https://github.com/google/timesketch">timesketch</a></strong> <em>[Data Processing]</em> - Collaborative forensic timeline analysis tool</p><p><strong><a href="https://github.com/uber/orbit">Orbit</a></strong> <em>[ML]</em> - Bayesian time series forecasting with an intuitive initialize-fit-predict interface</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[dotenvx: Commit .env Files to Git Without Leaking Secrets]]></title><description><![CDATA[Plus catch security flaws with Bandit]]></description><link>https://newsletter.codecut.ai/p/dotenvx-commit-env-files-to-git-without</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/dotenvx-commit-env-files-to-git-without</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 21 Apr 2026 16:02:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Duxj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>dotenvx: Commit .env Files to Git Without Leaking Secrets</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Duxj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Duxj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png 424w, https://substackcdn.com/image/fetch/$s_!Duxj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png 848w, https://substackcdn.com/image/fetch/$s_!Duxj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png 1272w, https://substackcdn.com/image/fetch/$s_!Duxj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Duxj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png" width="1200" height="560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:560,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: dotenvx: Commit .env Files to Git Without Leaking Secrets&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: dotenvx: Commit .env Files to Git Without Leaking Secrets" title="Code example: dotenvx: Commit .env Files to Git Without Leaking Secrets" srcset="https://substackcdn.com/image/fetch/$s_!Duxj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png 424w, https://substackcdn.com/image/fetch/$s_!Duxj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png 848w, https://substackcdn.com/image/fetch/$s_!Duxj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png 1272w, https://substackcdn.com/image/fetch/$s_!Duxj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16e28729-c1c3-4cb1-8286-86dc218bc037_1200x560.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>A <code>.env</code> file stores configuration like API keys and database URLs in plain text.</p><p>Because of that, committing it to git would leak every secret. Teams usually gitignore the file and distribute credentials manually through Slack or password managers instead.</p><p>Over time, this leads to secrets being scattered across different places without a clear source of truth.</p><h4>Solution</h4><p><a href="https://github.com/dotenvx/dotenvx">dotenvx</a> changes this by encrypting <code>.env</code> files with public-key cryptography.</p><p>You can commit the encrypted file to git, and your team only needs a private key (kept in a gitignored <code>.env.keys</code> file) to decrypt it when running the application.</p><p>Key capabilities:</p><ul><li><p>Works with Python, Node, Go, Ruby, Rust, and more via a single CLI</p></li><li><p>Encrypts <code>.env</code> files using the same cryptography as Bitcoin (secp256k1)</p></li><li><p>Separates environments with <code>.env.production</code>, <code>.env.staging</code>, and <code>.env.ci</code></p></li><li><p>Requires zero infrastructure (no Vault, no KMS, no cloud setup)</p></li></ul><blockquote></blockquote><div><hr></div><h3>Bandit: Find Python Security Flaws with One Pre-Commit Hook</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hmO9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hmO9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png 424w, https://substackcdn.com/image/fetch/$s_!hmO9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png 848w, https://substackcdn.com/image/fetch/$s_!hmO9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png 1272w, https://substackcdn.com/image/fetch/$s_!hmO9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hmO9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png" width="625" height="417" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:417,&quot;width&quot;:625,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Bandit: Find Python Security Flaws with One Pre-Commit Hook&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Bandit: Find Python Security Flaws with One Pre-Commit Hook" title="Code example: Bandit: Find Python Security Flaws with One Pre-Commit Hook" srcset="https://substackcdn.com/image/fetch/$s_!hmO9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png 424w, https://substackcdn.com/image/fetch/$s_!hmO9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png 848w, https://substackcdn.com/image/fetch/$s_!hmO9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png 1272w, https://substackcdn.com/image/fetch/$s_!hmO9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4749397b-d6df-4ce7-900b-91cdf5c3521f_625x417.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>AI code generators can produce working code in seconds, but they often introduce risky patterns like hardcoding passwords or API keys directly in the source.</p><p>These issues can easily slip through a quick review.</p><h4>Solution</h4><p><a href="https://github.com/PyCQA/bandit">Bandit</a> is a Python security linter that automatically detects vulnerability patterns in your code, from hardcoded secrets to unsafe function calls.</p><p>Key capabilities:</p><ul><li><p>Detects hardcoded passwords, tokens, and API keys</p></li><li><p>Flags risky calls like <code>eval</code>, <code>exec</code>, and <code>pickle</code></p></li><li><p>Seamlessly integrates into pre-commit hooks, CI workflows, and editors</p></li><li><p>Generates severity-ranked reports so you can prioritize fixes</p></li></ul><blockquote></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/jendrikseipp/vulture">vulture</a></strong> <em>[Code Quality]</em> - Find dead Python code with confidence-scored static analysis</p><p><strong><a href="https://github.com/getsentry/responses">responses</a></strong> <em>[Testing]</em> - A utility library for mocking out the Python Requests library</p><p><strong><a href="https://github.com/beartype/beartype">beartype</a></strong> <em>[Code Quality]</em> - Unbearably fast near-real-time pure-Python runtime type-checker</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Ibis: Write Once, Query 22+ SQL Databases]]></title><description><![CDATA[Plus auto-update LLM memory with mem0]]></description><link>https://newsletter.codecut.ai/p/ibis-write-once-query-22-sql-databases</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/ibis-write-once-query-22-sql-databases</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 16 Apr 2026 16:00:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!l8pF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>mem0: Auto-Update LLM Memory When Facts Change</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!89L_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!89L_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png 424w, https://substackcdn.com/image/fetch/$s_!89L_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png 848w, https://substackcdn.com/image/fetch/$s_!89L_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png 1272w, https://substackcdn.com/image/fetch/$s_!89L_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!89L_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png" width="1200" height="623" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:623,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: mem0: Auto-Update LLM Memory When Facts Change&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: mem0: Auto-Update LLM Memory When Facts Change" title="Code example: mem0: Auto-Update LLM Memory When Facts Change" srcset="https://substackcdn.com/image/fetch/$s_!89L_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png 424w, https://substackcdn.com/image/fetch/$s_!89L_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png 848w, https://substackcdn.com/image/fetch/$s_!89L_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png 1272w, https://substackcdn.com/image/fetch/$s_!89L_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55dcb736-aa98-4092-a0ef-00540efc48dc_1200x623.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Developers commonly store conversation embeddings in ChromaDB or Pinecone, then retrieve similar chunks before each LLM response.</p><p>But these systems do not handle changing information. When facts evolve, they simply accumulate, leaving your AI with conflicting context and no way to resolve it.</p><h4>Solution</h4><p><a href="https://github.com/mem0ai/mem0">mem0</a> introduces a smarter memory layer. It identifies contradictions, updates existing knowledge, and ensures only the latest facts are retained.</p><p>Key capabilities:</p><ul><li><p>Extracts structured facts directly from raw conversations</p></li><li><p>Conflict resolution that replaces outdated facts instead of duplicating them</p></li><li><p>Memory isolation across users, sessions, and agents</p></li><li><p>Retrieves context semantically, not just by similarity</p></li></ul><blockquote></blockquote><div><hr></div><h3>Ibis: Write Once, Query 22+ SQL Databases</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!l8pF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!l8pF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png 424w, https://substackcdn.com/image/fetch/$s_!l8pF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png 848w, https://substackcdn.com/image/fetch/$s_!l8pF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png 1272w, https://substackcdn.com/image/fetch/$s_!l8pF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!l8pF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png" width="1200" height="513" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d51407b8-6271-414f-92f0-c45e713ff320_1200x513.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:513,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Ibis: Write Once, Query 22+ SQL Databases&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Ibis: Write Once, Query 22+ SQL Databases" title="Code example: Ibis: Write Once, Query 22+ SQL Databases" srcset="https://substackcdn.com/image/fetch/$s_!l8pF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png 424w, https://substackcdn.com/image/fetch/$s_!l8pF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png 848w, https://substackcdn.com/image/fetch/$s_!l8pF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png 1272w, https://substackcdn.com/image/fetch/$s_!l8pF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd51407b8-6271-414f-92f0-c45e713ff320_1200x513.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Running queries across multiple databases often means rewriting the same logic for each backend&#8217;s SQL dialect. A query that works in DuckDB may require syntax changes for PostgreSQL, and another rewrite for BigQuery.</p><h4>Solution</h4><p><a href="https://github.com/ibis-project/ibis">Ibis</a> removes that friction by compiling Python expressions into each backend&#8217;s native SQL. Swap the connection, and the same code runs across 22+ databases.</p><p>Key features:</p><ul><li><p>Write once, run on DuckDB, PostgreSQL, BigQuery, Snowflake, and 18+ more</p></li><li><p>Lazy execution that builds and optimizes the query plan before sending it to the database</p></li><li><p>Intuitive chaining syntax similar to Polars</p></li></ul><blockquote><p>&#128214; <a href="https://codecut.ai/ibis-vs-narwhals-vs-fugue-dataframe-portability/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_ibis-vs-narwhals-vs-fugue-dataframe-portability">View Full Article</a></p></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/doccano/doccano">doccano</a></strong> <em>[Data Processing]</em> - Open source annotation tool for text classification, sequence labeling, and sequence-to-sequence tasks</p><p><strong><a href="https://github.com/microsoft/data-formulator">Data Formulator</a></strong> <em>[Data Visualization]</em> - AI-powered data visualization tool that transforms and explores data with drag-and-drop charts and AI agents</p><p><strong><a href="https://github.com/dathere/qsv">qsv</a></strong> <em>[Data Processing]</em> - Blazing-fast CLI toolkit for querying, transforming, and analyzing CSV data at scale</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Autoresearch: Run ML Experiments on Autopilot with Git-Backed Rollback]]></title><description><![CDATA[Plus automate Google Workspace with gws CLI]]></description><link>https://newsletter.codecut.ai/p/autoresearch-run-ml-experiments-on</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/autoresearch-run-ml-experiments-on</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 14 Apr 2026 16:02:39 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!W7Xr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>gws: One CLI for Drive, Gmail, Calendar, and Sheets</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tmhQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tmhQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png 424w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png 848w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png 1272w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png" width="567" height="493" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d2077ee-d009-46a6-916b-246f26de723f_567x493.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:493,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: gws: One CLI for Drive, Gmail, Calendar, and Sheets&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: gws: One CLI for Drive, Gmail, Calendar, and Sheets" title="Code example: gws: One CLI for Drive, Gmail, Calendar, and Sheets" srcset="https://substackcdn.com/image/fetch/$s_!tmhQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png 424w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png 848w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png 1272w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2077ee-d009-46a6-916b-246f26de723f_567x493.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Managing Workspace through the browser means clicking through multiple apps just to pull a spreadsheet, check your calendar, and send a follow-up email.</p><p>That manual loop adds up fast when you repeat it daily or weekly.</p><h4>Solution</h4><p><a href="https://github.com/googleworkspace/cli">gws</a> is a CLI that unifies every Workspace service behind simple terminal commands with structured JSON output ready for scripting.</p><p>Key capabilities:</p><ul><li><p>Single interface for Drive, Gmail, Calendar, Sheets, Docs, and more</p></li><li><p>JSON output that pipes directly into your existing scripts and workflows</p></li><li><p>100+ AI agent skills that let LLMs orchestrate Workspace tasks programmatically</p></li></ul><blockquote></blockquote><div><hr></div><h3>Autoresearch: Run ML Experiments on Autopilot with Git-Backed Rollback</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W7Xr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W7Xr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png 424w, https://substackcdn.com/image/fetch/$s_!W7Xr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png 848w, https://substackcdn.com/image/fetch/$s_!W7Xr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png 1272w, https://substackcdn.com/image/fetch/$s_!W7Xr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W7Xr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png" width="1189" height="690" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:690,&quot;width&quot;:1189,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Autoresearch: Run ML Experiments on Autopilot with Git-Backed Rollback&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Autoresearch: Run ML Experiments on Autopilot with Git-Backed Rollback" title="Code example: Autoresearch: Run ML Experiments on Autopilot with Git-Backed Rollback" srcset="https://substackcdn.com/image/fetch/$s_!W7Xr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png 424w, https://substackcdn.com/image/fetch/$s_!W7Xr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png 848w, https://substackcdn.com/image/fetch/$s_!W7Xr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png 1272w, https://substackcdn.com/image/fetch/$s_!W7Xr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4400b6-6a29-4d76-994f-acf65449764e_1189x690.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Running experiments manually means adjusting one hyperparameter, waiting for training to finish, checking results, and repeating for hours.</p><p>Progress stops the moment you step away, and you only explore the narrow set of ideas you thought of.</p><h4>Solution</h4><p><a href="https://github.com/karpathy/autoresearch">Autoresearch</a> is an open-source framework that solves this with an autonomous loop. An AI agent commits each change to git, trains for 5 minutes, and checks whether the model actually improved.</p><p>If the metric improves, the change stays. If not, the agent reverts to the last good state automatically.</p><p>Key benefits:</p><ul><li><p>Git-backed snapshots before every experiment for instant rollback</p></li><li><p>Structured results log that survives crashes and tracks every attempt</p></li><li><p>Continuous looping with no human confirmation needed</p></li></ul><blockquote></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/pymc-devs/pymc">PyMC</a></strong> <em>[ML]</em> - Bayesian statistical modeling with advanced MCMC and variational inference algorithms</p><p><strong><a href="https://github.com/CamDavidsonPilon/lifelines">lifelines</a></strong> <em>[ML]</em> - Survival analysis in Python, including Kaplan-Meier, Nelson-Aalen, and regression</p><p><strong><a href="https://github.com/py-why/causal-learn">causal-learn</a></strong> <em>[ML]</em> - Causal discovery with constraint-based, score-based, and functional causal model methods</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Type Check Your Python Codebase 15x Faster with Pyrefly]]></title><description><![CDATA[Plus turn Python into C speed with one decorator]]></description><link>https://newsletter.codecut.ai/p/type-check-your-python-codebase-15x</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/type-check-your-python-codebase-15x</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 09 Apr 2026 16:01:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Ir07!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Codon: One Decorator to Turn Python into C Speed</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HNy4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HNy4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png 424w, https://substackcdn.com/image/fetch/$s_!HNy4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png 848w, https://substackcdn.com/image/fetch/$s_!HNy4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png 1272w, https://substackcdn.com/image/fetch/$s_!HNy4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HNy4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png" width="638" height="671" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bba43b9e-2aec-4f12-bafd-24191f277157_638x671.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:671,&quot;width&quot;:638,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Codon: One Decorator to Turn Python into C Speed&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Codon: One Decorator to Turn Python into C Speed" title="Code example: Codon: One Decorator to Turn Python into C Speed" srcset="https://substackcdn.com/image/fetch/$s_!HNy4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png 424w, https://substackcdn.com/image/fetch/$s_!HNy4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png 848w, https://substackcdn.com/image/fetch/$s_!HNy4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png 1272w, https://substackcdn.com/image/fetch/$s_!HNy4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbba43b9e-2aec-4f12-bafd-24191f277157_638x671.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Slow Python functions in large codebases are painful to optimize. You might try Numba or Cython, but Numba only works for numerical code with NumPy arrays.</p><p>You might try Cython, but it needs .pyx files, variable type annotations, and build setup. That&#8217;s hours of refactoring before you see any speedup.</p><h4>Solution</h4><p><a href="https://github.com/exaloop/codon">Codon</a> solves this with a single @codon.jit decorator that compiles your Python to machine code.</p><p>Key benefits:</p><ul><li><p>Works on any Python code, not just NumPy arrays</p></li><li><p>No type annotations required since types are inferred automatically</p></li><li><p>Compiled functions are cached for instant repeated calls</p></li><li><p>Zero code changes beyond adding the decorator</p></li></ul><p>The example below shows the real performance:</p><ul><li><p>Pure Python: 0.240s</p></li><li><p>Codon first call: 0.324s (one-time compilation)</p></li><li><p>Codon cached calls: 0.006s (37x faster)</p></li></ul><blockquote><p>&#129514; <a href="https://bit.ly/492cz6D">Run code</a></p></blockquote><div><hr></div><h3>Datadog: Trace Bad Data from Dashboard to Root Cause in One View (Sponsored)</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!H30v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!H30v!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png 424w, https://substackcdn.com/image/fetch/$s_!H30v!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png 848w, https://substackcdn.com/image/fetch/$s_!H30v!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png 1272w, https://substackcdn.com/image/fetch/$s_!H30v!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!H30v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png" width="1200" height="1716" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1716,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Datadog: Trace Bad Data from Dashboard to Root Cause in One View (Sponsored)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Datadog: Trace Bad Data from Dashboard to Root Cause in One View (Sponsored)" title="Code example: Datadog: Trace Bad Data from Dashboard to Root Cause in One View (Sponsored)" srcset="https://substackcdn.com/image/fetch/$s_!H30v!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png 424w, https://substackcdn.com/image/fetch/$s_!H30v!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png 848w, https://substackcdn.com/image/fetch/$s_!H30v!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png 1272w, https://substackcdn.com/image/fetch/$s_!H30v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd35a8ae-316e-4a22-8900-5f448073c122_1200x1716.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>If your pipeline isn&#8217;t connected end to end, debugging means jumping between tools and manually tracing the issue. It&#8217;s slow and error-prone.</p><h4>Solution</h4><p>Instead of jumping between tools, Datadog Data Observability gives you one connected view from ingestion to dashboards.</p><p>It does this through:</p><ul><li><p>Quality Monitoring: catches anomalies like missing rows or stale data automatically</p></li><li><p>Jobs Monitoring: gives visibility into Spark and Airflow runs, including failures and cost</p></li><li><p>Data and code lineage: traces problems upstream to the source and downstream to every affected dashboard, model, and report</p></li></ul><blockquote><p>&#128214; <a href="https://fandf.co/4sLeKUK">Try Datadog Data Observability</a></p></blockquote><div><hr></div><h3>Type Check Your Python Codebase 15x Faster with Pyrefly</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ir07!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ir07!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png 424w, https://substackcdn.com/image/fetch/$s_!Ir07!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png 848w, https://substackcdn.com/image/fetch/$s_!Ir07!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png 1272w, https://substackcdn.com/image/fetch/$s_!Ir07!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ir07!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png" width="660" height="308" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:308,&quot;width&quot;:660,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Type Check Your Python Codebase 15x Faster with Pyrefly&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Type Check Your Python Codebase 15x Faster with Pyrefly" title="Code example: Type Check Your Python Codebase 15x Faster with Pyrefly" srcset="https://substackcdn.com/image/fetch/$s_!Ir07!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png 424w, https://substackcdn.com/image/fetch/$s_!Ir07!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png 848w, https://substackcdn.com/image/fetch/$s_!Ir07!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png 1272w, https://substackcdn.com/image/fetch/$s_!Ir07!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63a36008-4c2f-40d0-a411-e081f8829a5e_660x308.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Tools like MyPy and Pyright process files sequentially, so larger codebases lead to longer wait times.</p><h4>Solution</h4><p><a href="https://github.com/facebook/pyrefly">Pyrefly</a>, Meta&#8217;s Rust-based type checker, runs checks in parallel, keeping performance nearly constant as your codebase grows.</p><p>Key features:</p><ul><li><p>Re-checks only changed modules for faster incremental runs</p></li><li><p>Automatically infers types for variables and return values</p></li></ul><p>On the PyTorch codebase, Pyrefly completes a full check in 2.4 seconds, about 15x faster than Pyright and 20x faster than MyPy.</p><blockquote></blockquote><div><hr></div><h2>&#128218; Latest Deep Dives</h2><p><strong><a href="https://codecut.ai/browser-use-ai-browser-agent/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_browser-use-ai-browser-agent">browser-use: Turn Plain English Prompts into Working Browser Automation</a></strong></p><p>Traditional tools like Playwright rely on CSS selectors, tightly coupling your scraper to a site&#8217;s HTML. When the site changes, everything breaks and needs to be rewritten.</p><p>browser-use takes a different approach. You describe the goal in plain English, and an LLM decides what to click, type, and extract.</p><p>In this article, I tested browser-use on two real tasks:</p><ul><li><p>Finding AI stories on Hacker News and synthesizing themes</p></li><li><p>Scraping Newegg for gaming laptops with specific constraints</p></li></ul><p>I share the actual outputs, cost per run, and an honest breakdown of what worked and what didn&#8217;t, so you can decide if it fits your use case.</p><blockquote><p>&#128214; <a href="https://codecut.ai/browser-use-ai-browser-agent/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_browser-use-ai-browser-agent">View Full Article</a></p></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/PyCQA/bandit">bandit</a></strong> <em>[Code Quality]</em> - A security linter that scans Python code for common vulnerabilities by building and analyzing abstract syntax trees.</p><p><strong><a href="https://github.com/plasma-umass/scalene">scalene</a></strong> <em>[Code Quality]</em> - High-performance CPU, GPU, and memory profiler for Python with AI-powered optimization proposals.</p><p><strong><a href="https://github.com/jendrikseipp/vulture">vulture</a></strong> <em>[Code Quality]</em> - Finds unused code in Python programs, including dead functions, classes, variables, and unreachable code blocks.</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Chandra OCR: From Handwritten Notes to Structured Text in Seconds]]></title><description><![CDATA[Plus simplify git worktrees for AI agents]]></description><link>https://newsletter.codecut.ai/p/chandra-ocr-from-handwritten-notes</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/chandra-ocr-from-handwritten-notes</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 07 Apr 2026 16:03:12 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!UGbz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#129309; Collaboration</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YqGg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YqGg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png 424w, https://substackcdn.com/image/fetch/$s_!YqGg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png 848w, https://substackcdn.com/image/fetch/$s_!YqGg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png 1272w, https://substackcdn.com/image/fetch/$s_!YqGg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YqGg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png" width="1200" height="833" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:833,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Give Your AI Agent Live Web Access with Bright Data MCP&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Give Your AI Agent Live Web Access with Bright Data MCP" title="Give Your AI Agent Live Web Access with Bright Data MCP" srcset="https://substackcdn.com/image/fetch/$s_!YqGg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png 424w, https://substackcdn.com/image/fetch/$s_!YqGg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png 848w, https://substackcdn.com/image/fetch/$s_!YqGg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png 1272w, https://substackcdn.com/image/fetch/$s_!YqGg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0107319b-9db2-4b1d-9330-abbbf7d26ba3_1200x833.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Give Your AI Agent Live Web Access with Bright Data MCP</h3><p>With basic search APIs, agents often miss critical context from sources like social platforms, forums, news, and answer engines. That leads to incomplete or outdated responses.</p><p>Bright Data&#8217;s MCP server unifies all web data access into one interface your AI agent can use directly.</p><p>With Bright Data MCP, your AI agent can access:</p><ul><li><p>Search engines (Google, Bing, more)</p></li><li><p>Social media (Twitter/X, Reddit, Instagram, TikTok)</p></li><li><p>Web archives (historical web data, years deep)</p></li><li><p>Answer engines (ChatGPT, Perplexity, Gemini)</p></li></ul><p>All through one connection.</p><blockquote><p>&#128279; <a href="https://brightdata.com/ai/mcp-server?utm_source=brand&amp;utm_medium=newsletter&amp;utm_campaign=khuyen-tran">Try Bright Data MCP</a></p></blockquote><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Chandra OCR: From Handwritten Notes to Structured Text in Seconds</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UGbz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UGbz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png 424w, https://substackcdn.com/image/fetch/$s_!UGbz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png 848w, https://substackcdn.com/image/fetch/$s_!UGbz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png 1272w, https://substackcdn.com/image/fetch/$s_!UGbz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UGbz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png" width="652" height="610" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aece4867-a555-4e2b-b608-2629063ba9e2_652x610.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:610,&quot;width&quot;:652,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Chandra OCR: From Handwritten Notes to Structured Text in Seconds&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Chandra OCR: From Handwritten Notes to Structured Text in Seconds" title="Code example: Chandra OCR: From Handwritten Notes to Structured Text in Seconds" srcset="https://substackcdn.com/image/fetch/$s_!UGbz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png 424w, https://substackcdn.com/image/fetch/$s_!UGbz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png 848w, https://substackcdn.com/image/fetch/$s_!UGbz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png 1272w, https://substackcdn.com/image/fetch/$s_!UGbz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faece4867-a555-4e2b-b608-2629063ba9e2_652x610.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Most OCR tools are designed for printed text and struggle with handwritten notes, especially when they include diagrams, equations, and free-form writing.</p><h4>Solution</h4><p><a href="https://github.com/datalab-to/chandra">Chandra OCR</a> is built for this exact use case. It extracts text, images, and diagrams from handwritten notes and reconstructs them into clean Markdown or HTML.</p><p>How it compares to other OCR tools:</p><ul><li><p>85.9% overall on the olmOCR benchmark, outperforming olmOCR 2 (82.4%), GPT-4o (69.9%), Gemini Flash 2 (63.8%), and Mistral OCR (72.0%)</p></li><li><p>Scores 89.3% on handwritten math, where most OCR tools struggle</p></li><li><p>Supports 90+ languages out of the box</p></li></ul><blockquote></blockquote><div><hr></div><h3>Worktrunk: Give Every AI Agent Its Own Branch in Seconds</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XRlT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XRlT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png 424w, https://substackcdn.com/image/fetch/$s_!XRlT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png 848w, https://substackcdn.com/image/fetch/$s_!XRlT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png 1272w, https://substackcdn.com/image/fetch/$s_!XRlT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XRlT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png" width="600" height="640" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:640,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Worktrunk: Give Every AI Agent Its Own Branch in Seconds&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Worktrunk: Give Every AI Agent Its Own Branch in Seconds" title="Code example: Worktrunk: Give Every AI Agent Its Own Branch in Seconds" srcset="https://substackcdn.com/image/fetch/$s_!XRlT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png 424w, https://substackcdn.com/image/fetch/$s_!XRlT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png 848w, https://substackcdn.com/image/fetch/$s_!XRlT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png 1272w, https://substackcdn.com/image/fetch/$s_!XRlT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb933c8bd-209b-42e8-859d-79a7ce0bbadd_600x640.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Git worktrees give each agent its own isolated copy of the repo, so multiple agents can edit files simultaneously without conflicts.</p><p>But the native commands are verbose and stop at creating the directory. Launching agents, installing dependencies, and cleaning up after merge are all separate manual steps.</p><h4>Solution</h4><p><a href="https://github.com/max-sixty/worktrunk">Worktrunk</a> is a CLI that makes git worktrees as easy as branches with just three core commands: switch, list, and remove.</p><p>Three commands cover the full lifecycle:</p><ul><li><p>switch: Create a worktree, run hooks for dependency setup, and launch an agent</p></li><li><p>list: See diff status, commit counts, CI state, and AI-generated summaries per branch</p></li><li><p>merge: Squash, rebase, or fast-forward to main with automatic worktree and branch cleanup</p></li></ul><blockquote></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/jawah/niquests">niquests</a></strong> <em>[Python Utils]</em> - Drop-in replacement for Requests with automatic HTTP/1.1, HTTP/2, and HTTP/3 support, plus WebSocket and SSE built in.</p><p><strong><a href="https://github.com/exaloop/codon">codon</a></strong> <em>[Python Utils]</em> - A high-performance Python compiler that produces native machine code with 10-100x speedups and built-in multithreading support.</p><p><strong><a href="https://github.com/ariebovenberg/whenever">whenever</a></strong> <em>[Python Utils]</em> - Modern, type-safe datetime library for Python with a Rust extension for performance, inspired by Temporal.</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Browser-Use: Automate Any Browser Task with Plain English]]></title><description><![CDATA[Plus give your AI memory with mem0]]></description><link>https://newsletter.codecut.ai/p/browser-use-automate-any-browser</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/browser-use-automate-any-browser</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 02 Apr 2026 16:03:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_eVj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>mem0: Give Your AI Memory Without Building a Vector DB</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QFvQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QFvQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png 424w, https://substackcdn.com/image/fetch/$s_!QFvQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png 848w, https://substackcdn.com/image/fetch/$s_!QFvQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png 1272w, https://substackcdn.com/image/fetch/$s_!QFvQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QFvQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png" width="683" height="766" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:766,&quot;width&quot;:683,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: mem0: Give Your AI Memory Without Building a Vector DB&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: mem0: Give Your AI Memory Without Building a Vector DB" title="Code example: mem0: Give Your AI Memory Without Building a Vector DB" srcset="https://substackcdn.com/image/fetch/$s_!QFvQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png 424w, https://substackcdn.com/image/fetch/$s_!QFvQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png 848w, https://substackcdn.com/image/fetch/$s_!QFvQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png 1272w, https://substackcdn.com/image/fetch/$s_!QFvQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f85a8e5-7dc1-42a9-8ae4-3e426044d3c4_683x766.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>When you build an AI app using the OpenAI or Anthropic API, every conversation starts from scratch with no built-in memory between sessions.</p><p>Adding memory yourself with a vector database like ChromaDB requires writing custom extraction, deduplication, and scoping logic on top of the storage layer.</p><h4>Solution</h4><p><a href="https://github.com/mem0ai/mem0">mem0</a> handles all of that in a single function call. Just pass in conversations and retrieve relevant memories when needed.</p><p>Key features:</p><ul><li><p>Automatic fact extraction from raw conversations via <code>memory.add()</code></p></li><li><p>Cross-session retrieval with <code>memory.search()</code> in any future conversation</p></li><li><p>Automatic conflict resolution when user preferences change over time</p></li></ul><blockquote><p>&#129514; <a href="https://bit.ly/4bXNGKA">Run code</a></p></blockquote><div><hr></div><h3>Browser-Use: Automate Any Browser Task with Plain English</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_eVj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_eVj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png 424w, https://substackcdn.com/image/fetch/$s_!_eVj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png 848w, https://substackcdn.com/image/fetch/$s_!_eVj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png 1272w, https://substackcdn.com/image/fetch/$s_!_eVj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_eVj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png" width="649" height="577" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:577,&quot;width&quot;:649,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Browser-Use: Automate Any Browser Task with Plain English&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Browser-Use: Automate Any Browser Task with Plain English" title="Code example: Browser-Use: Automate Any Browser Task with Plain English" srcset="https://substackcdn.com/image/fetch/$s_!_eVj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png 424w, https://substackcdn.com/image/fetch/$s_!_eVj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png 848w, https://substackcdn.com/image/fetch/$s_!_eVj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png 1272w, https://substackcdn.com/image/fetch/$s_!_eVj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ba87dd9-4fee-4dc0-81f8-347fd50f5759_649x577.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Most data collection tasks go beyond simple extraction. You need to log in, apply filters, navigate pagination, and then gather results.</p><p>Selenium can handle navigation, but it requires maintaining CSS selectors that can easily break when a site changes.</p><h4>Solution</h4><p><a href="https://github.com/browser-use/browser-use">Browser Use</a> simplifies the entire process. Describe what you want, and it navigates, clicks, types, and extracts automatically.</p><p>Key features:</p><ul><li><p>Natural language task descriptions</p></li><li><p>Works with GPT-4, Claude, Gemini, and local models via Ollama</p></li><li><p>Structured output with Pydantic models</p></li></ul><blockquote></blockquote><div><hr></div><h2>&#128218; Latest Deep Dives</h2><p><strong><a href="https://codecut.ai/run-github-actions-locally-act/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_run-github-actions-locally-act">How to Test GitHub Actions Locally with act</a></strong></p><p>Debugging GitHub Actions is painfully slow. Every YAML change requires a commit, a push, and a 2-5 minute wait just to find out you missed a colon.</p><p>This article introduces act, a CLI tool that runs GitHub Actions workflows locally in Docker containers.</p><p>You&#8217;ll set up an ML testing pipeline and learn to pass secrets, run specific jobs, and validate workflows in seconds.</p><blockquote><p>&#128214; <a href="https://codecut.ai/run-github-actions-locally-act/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_run-github-actions-locally-act">View Full Article</a></p></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/open-webui/open-webui">open-webui</a></strong> <em>[LLM]</em> - A self-hosted AI platform with built-in RAG, model builder, and support for Ollama and OpenAI-compatible APIs</p><p><strong><a href="https://github.com/infiniflow/ragflow">ragflow</a></strong> <em>[RAG]</em> - An open-source RAG engine with deep document understanding for unstructured data in any format</p><p><strong><a href="https://github.com/vllm-project/vllm">vllm</a></strong> <em>[MLOps]</em> - A high-throughput, memory-efficient inference and serving engine for LLMs with multi-GPU support</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[latexify_py: Turn Python Functions into LaTeX with One Decorator]]></title><description><![CDATA[Plus run GitHub Actions locally with act]]></description><link>https://newsletter.codecut.ai/p/latexify_py-turn-python-functions</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/latexify_py-turn-python-functions</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 31 Mar 2026 16:02:43 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9tlA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#129309; COLLABORATION</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5JhP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5JhP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png 424w, https://substackcdn.com/image/fetch/$s_!5JhP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png 848w, https://substackcdn.com/image/fetch/$s_!5JhP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png 1272w, https://substackcdn.com/image/fetch/$s_!5JhP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5JhP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png" width="1200" height="833" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:833,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Give Your AI Agent Live Web Access with Bright Data MCP&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Give Your AI Agent Live Web Access with Bright Data MCP" title="Give Your AI Agent Live Web Access with Bright Data MCP" srcset="https://substackcdn.com/image/fetch/$s_!5JhP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png 424w, https://substackcdn.com/image/fetch/$s_!5JhP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png 848w, https://substackcdn.com/image/fetch/$s_!5JhP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png 1272w, https://substackcdn.com/image/fetch/$s_!5JhP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945becaa-0533-4c48-9f65-aac2a773d4bc_1200x833.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Give Your AI Agent Live Web Access with Bright Data MCP</h3><p>With basic search APIs, agents often miss critical context from sources like social platforms, forums, news, and answer engines. That leads to incomplete or outdated responses.</p><p>Bright Data&#8217;s MCP server unifies all web data access into one interface your AI agent can use directly.</p><p>With Bright Data MCP, your AI agent can access:</p><ul><li><p>Search engines (Google, Bing, more)</p></li><li><p>Social media (Twitter/X, Reddit, Instagram, TikTok)</p></li><li><p>Web archives (historical web data, years deep)</p></li><li><p>Answer engines (ChatGPT, Perplexity, Gemini)</p></li></ul><p>All through one connection.</p><blockquote><p>&#128279; <a href="https://brightdata.com/ai/mcp-server?utm_source=brand&amp;utm_medium=newsletter&amp;utm_campaign=khuyen-tran">Try Bright Data MCP</a></p></blockquote><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>latexify_py: Turn Python Functions into LaTeX with One Decorator</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9tlA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9tlA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png 424w, https://substackcdn.com/image/fetch/$s_!9tlA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png 848w, https://substackcdn.com/image/fetch/$s_!9tlA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png 1272w, https://substackcdn.com/image/fetch/$s_!9tlA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9tlA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png" width="1200" height="1202" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1202,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: latexify_py: Turn Python Functions into LaTeX with One Decorator&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: latexify_py: Turn Python Functions into LaTeX with One Decorator" title="Code example: latexify_py: Turn Python Functions into LaTeX with One Decorator" srcset="https://substackcdn.com/image/fetch/$s_!9tlA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png 424w, https://substackcdn.com/image/fetch/$s_!9tlA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png 848w, https://substackcdn.com/image/fetch/$s_!9tlA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png 1272w, https://substackcdn.com/image/fetch/$s_!9tlA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7eb77d1-4347-4147-93dc-d6c8d4c08c68_1200x1202.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Non-programmers cannot easily read Python logic. However, manually converting it to LaTeX is slow and quickly becomes outdated as the code changes.</p><h4>Solution</h4><p><a href="https://github.com/google/latexify_py">latexify_py</a> solves this with a single decorator, generating LaTeX directly from your function so the math stays readable and always in sync with the code.</p><p>Key capabilities:</p><ul><li><p>Three decorators for different outputs: expressions, full equations, or pseudocode</p></li><li><p>Displays rendered LaTeX directly in Jupyter cells</p></li><li><p>Functions still work normally when called</p></li></ul><blockquote><p>&#128214; <a href="https://codecut.ai/python-code-to-latex-jupyter-notebooks/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_python-code-to-latex-jupyter-notebooks">View Full Article</a> | &#129514; <a href="https://bit.ly/4bW2ycE">Run code</a></p></blockquote><div><hr></div><h3>act: Run GitHub Actions Locally with Docker</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-DtQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-DtQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png 424w, https://substackcdn.com/image/fetch/$s_!-DtQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png 848w, https://substackcdn.com/image/fetch/$s_!-DtQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png 1272w, https://substackcdn.com/image/fetch/$s_!-DtQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-DtQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png" width="636" height="601" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:601,&quot;width&quot;:636,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: act: Run GitHub Actions Locally with Docker&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: act: Run GitHub Actions Locally with Docker" title="Code example: act: Run GitHub Actions Locally with Docker" srcset="https://substackcdn.com/image/fetch/$s_!-DtQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png 424w, https://substackcdn.com/image/fetch/$s_!-DtQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png 848w, https://substackcdn.com/image/fetch/$s_!-DtQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png 1272w, https://substackcdn.com/image/fetch/$s_!-DtQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6070dcf3-2ac4-4669-bcbd-7ad7e9377183_636x601.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>GitHub Actions has no local execution mode. You can&#8217;t test a step, inspect an environment variable, or reproduce a runner-specific failure on your own machine.</p><p>Each change requires a commit and a wait for the cloud runner. A small mistake like a missing secret means starting the loop again.</p><h4>Solution</h4><p>With <a href="https://github.com/nektos/act">act</a>, you can execute workflows locally using Docker. Failures surface immediately, making it easier to iterate and commit only when the workflow passes.</p><blockquote><p>&#128214; <a href="https://codecut.ai/run-github-actions-locally-act/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_run-github-actions-locally-act">View Full Article</a></p></blockquote><blockquote></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/mangiucugna/json_repair">json_repair</a></strong> <em>[LLM]</em> - A Python module to repair invalid JSON, especially from LLM outputs, with schema validation support</p><p><strong><a href="https://github.com/tobgu/pyrsistent">pyrsistent</a></strong> <em>[Python Utilities]</em> - Persistent, immutable, and functional data structures for Python</p><p><strong><a href="https://github.com/j178/prek">prek</a></strong> <em>[Code Quality]</em> - A faster, Rust-based reimagining of pre-commit with monorepo support and parallel hook execution</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Chronos: Forecast Any Time Series Without Training a Model]]></title><description><![CDATA[Plus an AI agent built for data engineers]]></description><link>https://newsletter.codecut.ai/p/chronos-forecast-any-time-series</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/chronos-forecast-any-time-series</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 26 Mar 2026 16:01:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!jrMR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#129309; COLLABORATION</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!p-4t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!p-4t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png 424w, https://substackcdn.com/image/fetch/$s_!p-4t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png 848w, https://substackcdn.com/image/fetch/$s_!p-4t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png 1272w, https://substackcdn.com/image/fetch/$s_!p-4t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!p-4t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png" width="1200" height="833" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c767c018-0495-49e2-a529-3c24dead4729_1200x833.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:833,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Bright Data MCP server for AI agent web access&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Bright Data MCP server for AI agent web access" title="Bright Data MCP server for AI agent web access" srcset="https://substackcdn.com/image/fetch/$s_!p-4t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png 424w, https://substackcdn.com/image/fetch/$s_!p-4t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png 848w, https://substackcdn.com/image/fetch/$s_!p-4t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png 1272w, https://substackcdn.com/image/fetch/$s_!p-4t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc767c018-0495-49e2-a529-3c24dead4729_1200x833.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Give Your AI Agent Live Web Access with Bright Data MCP</h3><p>With basic search APIs, agents often miss critical context from sources like social platforms, forums, news, and answer engines. That leads to incomplete or outdated responses.</p><p>Bright Data&#8217;s MCP server unifies all web data access into one interface your AI agent can use directly.</p><p>With Bright Data MCP, your AI agent can access:</p><ul><li><p>Search engines (Google, Bing, more)</p></li><li><p>Social media (Twitter/X, Reddit, Instagram, TikTok)</p></li><li><p>Web archives (historical web data, years deep)</p></li><li><p>Answer engines (ChatGPT, Perplexity, Gemini)</p></li></ul><p>All through one connection.</p><blockquote><p>&#128279; <a href="https://brightdata.com/ai/mcp-server?utm_source=brand&amp;utm_medium=newsletter&amp;utm_campaign=khuyen-tran">Try Bright Data MCP</a></p></blockquote><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Chronos: Forecast Any Time Series Without Training a Model</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jrMR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jrMR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png 424w, https://substackcdn.com/image/fetch/$s_!jrMR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png 848w, https://substackcdn.com/image/fetch/$s_!jrMR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png 1272w, https://substackcdn.com/image/fetch/$s_!jrMR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jrMR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png" width="738" height="610" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:610,&quot;width&quot;:738,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Chronos: Forecast Any Time Series Without Training a Model&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Chronos: Forecast Any Time Series Without Training a Model" title="Code example: Chronos: Forecast Any Time Series Without Training a Model" srcset="https://substackcdn.com/image/fetch/$s_!jrMR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png 424w, https://substackcdn.com/image/fetch/$s_!jrMR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png 848w, https://substackcdn.com/image/fetch/$s_!jrMR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png 1272w, https://substackcdn.com/image/fetch/$s_!jrMR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95118ec4-552b-4e05-9fb8-68bcf9f1fdd5_738x610.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Traditional forecasting requires domain-specific data, feature engineering, and multiple rounds of model tuning.</p><h4>Solution</h4><p><a href="https://github.com/amazon-science/chronos-forecasting">Chronos</a> is a family of pretrained time series forecasting models from Amazon Science that deliver zero-shot predictions out of the box.</p><p>Simply load a pretrained model and generate forecasts on any time series data, with no fine-tuning required.</p><p>If zero-shot accuracy isn&#8217;t enough, you can fine-tune on your data with AutoGluon in a few lines.</p><blockquote><p>&#129514; <a href="https://bit.ly/4uOPAFW">Run code</a></p></blockquote><div><hr></div><h3>altimate-code: The Missing AI Layer for Data Engineering Teams</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xuDI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xuDI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png 424w, https://substackcdn.com/image/fetch/$s_!xuDI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png 848w, https://substackcdn.com/image/fetch/$s_!xuDI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png 1272w, https://substackcdn.com/image/fetch/$s_!xuDI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xuDI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png" width="1200" height="695" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:695,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: altimate-code: The Missing AI Layer for Data Engineering Teams&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: altimate-code: The Missing AI Layer for Data Engineering Teams" title="Code example: altimate-code: The Missing AI Layer for Data Engineering Teams" srcset="https://substackcdn.com/image/fetch/$s_!xuDI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png 424w, https://substackcdn.com/image/fetch/$s_!xuDI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png 848w, https://substackcdn.com/image/fetch/$s_!xuDI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png 1272w, https://substackcdn.com/image/fetch/$s_!xuDI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F722c0d44-1db7-480b-96cf-ce2ad690252c_1200x695.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>General AI tools can write SQL and catch obvious mistakes. But they cannot systematically detect anti-patterns, trace lineage, or keep warehouse costs under control.</p><p>That gap can lead to inefficient queries, broken dependencies, and hidden compliance risks building up over time.</p><h4>Solution</h4><p>I recently tried <a href="https://github.com/AltimateAI/altimate-code">altimate-code</a>, an open-source agent with 100+ tools purpose-built for data engineers, and built a demo repo to test it.</p><p>From a single prompt, it generated a full dbt project with staging, intermediate, and mart layers, added automated tests, and built an interactive dashboard.</p><p>What makes it different:</p><ul><li><p>100+ tools that analyze SQL through structural parsing, not text guessing</p></li><li><p>Works across your stack including Snowflake, BigQuery, Databricks, DuckDB, and more</p></li><li><p>Model-agnostic. Compatible with OpenAI, Anthropic, Gemini, Ollama, and others</p></li></ul><blockquote><p>&#129514; <a href="https://github.com/khuyentran1401/altimate-code-demo">Demo repo</a></p></blockquote><blockquote></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/google-research/timesfm">timesfm</a></strong> <em>[Machine Learning]</em> - Pretrained time series foundation model by Google Research for zero-shot forecasting</p><p><strong><a href="https://github.com/unit8co/darts">darts</a></strong> <em>[Machine Learning]</em> - A Python library for user-friendly forecasting and anomaly detection on time series</p><p><strong><a href="https://github.com/uber/orbit">orbit</a></strong> <em>[Machine Learning]</em> - A Python package for Bayesian time series forecasting with probabilistic models under the hood</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Polars scan_csv: Merge CSVs with Different Schemas in One Call]]></title><description><![CDATA[Plus build Python packages with UV]]></description><link>https://newsletter.codecut.ai/p/polars-scan_csv-merge-csvs-with-different</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/polars-scan_csv-merge-csvs-with-different</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 24 Mar 2026 16:02:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!K9u1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Polars scan_csv: Merge CSVs with Different Schemas in One Call</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K9u1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K9u1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png 424w, https://substackcdn.com/image/fetch/$s_!K9u1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png 848w, https://substackcdn.com/image/fetch/$s_!K9u1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png 1272w, https://substackcdn.com/image/fetch/$s_!K9u1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K9u1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png" width="599" height="682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:599,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Polars scan_csv: Merge CSVs with Different Schemas in One Call&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Polars scan_csv: Merge CSVs with Different Schemas in One Call" title="Code example: Polars scan_csv: Merge CSVs with Different Schemas in One Call" srcset="https://substackcdn.com/image/fetch/$s_!K9u1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png 424w, https://substackcdn.com/image/fetch/$s_!K9u1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png 848w, https://substackcdn.com/image/fetch/$s_!K9u1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png 1272w, https://substackcdn.com/image/fetch/$s_!K9u1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce3f50a8-cb28-415a-bb2c-fbadf9dddae1_599x682.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Polars&#8217; <code>scan_csv</code> lets you load multiple CSV files lazily, reading data only when needed.</p><p>But before v1.39.0, every file had to share the same columns, or you&#8217;d get a SchemaError.</p><h4>Solution</h4><p><a href="https://github.com/pola-rs/polars">Polars</a> v1.39.0 introduces <code>missing_columns="insert"</code> in <code>scan_csv</code>, allowing you to combine multiple files in one call while null-filling any missing columns.</p><blockquote><p>&#128214; <a href="https://codecut.ai/pandas-vs-polars-vs-duckdb-comparison/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_pandas-vs-polars-vs-duckdb-comparison">View Full Article</a> | &#129514; <a href="https://bit.ly/4do1Vej">Run code</a></p></blockquote><div><hr></div><h3>Build Professional Python Packages with UV --package</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_rNa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_rNa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png 424w, https://substackcdn.com/image/fetch/$s_!_rNa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png 848w, https://substackcdn.com/image/fetch/$s_!_rNa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png 1272w, https://substackcdn.com/image/fetch/$s_!_rNa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_rNa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png" width="615" height="566" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/26fb6170-412c-4861-831f-37885f43c6b9_615x566.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:566,&quot;width&quot;:615,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Build Professional Python Packages with UV --package&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Build Professional Python Packages with UV --package" title="Code example: Build Professional Python Packages with UV --package" srcset="https://substackcdn.com/image/fetch/$s_!_rNa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png 424w, https://substackcdn.com/image/fetch/$s_!_rNa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png 848w, https://substackcdn.com/image/fetch/$s_!_rNa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png 1272w, https://substackcdn.com/image/fetch/$s_!_rNa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26fb6170-412c-4861-831f-37885f43c6b9_615x566.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Python packages turn your code into reusable modules you can share across projects.</p><p>But building them requires complex setup with setuptools, managing build systems, and understanding distribution mechanics.</p><h4>Solution</h4><p><a href="https://github.com/astral-sh/uv">UV</a>, a fast Python package installer and resolver, reduces the entire process to 2 simple commands:</p><ul><li><p>uv init --package sets up your package structure instantly</p></li><li><p>uv build and uv publish to create and distribute to PyPI</p></li></ul><blockquote><p>&#128214; <a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Dive deeper in Production Ready Data Science</a></p></blockquote><div><hr></div><h2>&#128218; Latest Deep Dives</h2><p><strong><a href="https://codecut.ai/uv-pixi-comparison/">uv vs pixi: Which Python Environment Manager Should You Use for Data Science?</a></strong></p><p>uv installs Python packages from PyPI, but it doesn&#8217;t support compiled C/C++ libraries.</p><p>The typical workaround is to install system libraries separately using an OS package manager, then manually align versions with your Python dependencies. Since these system dependencies aren&#8217;t captured in project files, reproducing the environment across machines can be unreliable.</p><p>pixi solves this by managing both Python packages from PyPI and compiled system libraries from conda-forge in a single tool.</p><p>Quick comparison:</p><ul><li><p>uv: fast, reliable lockfiles, Python-only</p></li><li><p>conda: system libraries supported, but slower and no lockfiles</p></li><li><p>pixi: fast, unified, with system libraries, lockfiles, and a built-in task runner</p></li></ul><p>In this article, I compare uv and pixi on a real ML project so you can see how they perform in practice.</p><blockquote><p>&#128214; <a href="https://codecut.ai/uv-pixi-comparison/">View Full Article</a></p></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/iterative/datachain">datachain</a></strong> <em>[Data Processing]</em> - Process and curate unstructured data from cloud storages using local ML models and Python</p><p><strong><a href="https://github.com/HumanSignal/label-studio">label-studio</a></strong> <em>[Data Processing]</em> - Open source data labeling and annotation tool with standardized output format for ML workflows</p><p><strong><a href="https://github.com/jqnatividad/qsv">qsv</a></strong> <em>[Command Line]</em> - Blazingly fast CSV command-line toolkit for slicing, dicing, and analyzing tabular data</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Handle Messy Data with RapidFuzz Fuzzy Matching]]></title><description><![CDATA[Plus efficient LLM inference with vLLM]]></description><link>https://newsletter.codecut.ai/p/handle-messy-data-with-rapidfuzz</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/handle-messy-data-with-rapidfuzz</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Thu, 19 Mar 2026 16:01:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!HYsr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>vLLM: Serve More LLM Users on the Same GPU</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HYsr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HYsr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png 424w, https://substackcdn.com/image/fetch/$s_!HYsr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png 848w, https://substackcdn.com/image/fetch/$s_!HYsr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png 1272w, https://substackcdn.com/image/fetch/$s_!HYsr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HYsr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png" width="643" height="745" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:745,&quot;width&quot;:643,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: vLLM: Serve More LLM Users on the Same GPU&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: vLLM: Serve More LLM Users on the Same GPU" title="Code example: vLLM: Serve More LLM Users on the Same GPU" srcset="https://substackcdn.com/image/fetch/$s_!HYsr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png 424w, https://substackcdn.com/image/fetch/$s_!HYsr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png 848w, https://substackcdn.com/image/fetch/$s_!HYsr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png 1272w, https://substackcdn.com/image/fetch/$s_!HYsr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa2f3d40-5a6f-448e-9a85-05b637fa87b4_643x745.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Most frameworks reserve GPU memory for the longest possible response, even when the actual output is short.</p><p>With multiple concurrent users, this quickly fills the GPU with reserved memory that is mostly never used.</p><h4>Solution</h4><p><a href="https://github.com/vllm-project/vllm">vLLM</a>&#8217;s PagedAttention allocates memory in small blocks as the response grows, instead of reserving everything up front.</p><p>This keeps memory usage efficient and allows the GPU to serve more requests.</p><blockquote></blockquote><div><hr></div><h3>Handle Messy Data with RapidFuzz Fuzzy Matching</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vPqB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vPqB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png 424w, https://substackcdn.com/image/fetch/$s_!vPqB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png 848w, https://substackcdn.com/image/fetch/$s_!vPqB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png 1272w, https://substackcdn.com/image/fetch/$s_!vPqB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vPqB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png" width="1200" height="1076" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1076,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Handle Messy Data with RapidFuzz Fuzzy Matching&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Handle Messy Data with RapidFuzz Fuzzy Matching" title="Code example: Handle Messy Data with RapidFuzz Fuzzy Matching" srcset="https://substackcdn.com/image/fetch/$s_!vPqB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png 424w, https://substackcdn.com/image/fetch/$s_!vPqB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png 848w, https://substackcdn.com/image/fetch/$s_!vPqB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png 1272w, https://substackcdn.com/image/fetch/$s_!vPqB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124de7c7-237f-432d-a588-23c86cf9584e_1200x1076.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Traditional regex approaches require hours of preprocessing but still break with common data variations like missing spaces, typos, or inconsistent formatting.</p><h4>Solution</h4><p><a href="https://github.com/maxbachmann/RapidFuzz">RapidFuzz</a> eliminates data cleaning overhead with intelligent fuzzy matching.</p><p>Key benefits:</p><ul><li><p>Automatic handling of typos, spacing, and case variations</p></li><li><p>Production-ready C++ performance for large datasets</p></li><li><p>Full spectrum of fuzzy algorithms in one library</p></li></ul><blockquote><p>&#128214; <a href="https://codecut.ai/text-similarity-fuzzy-matching-guide/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_text-similarity-fuzzy-matching-guide">View Full Article</a> | &#129514; <a href="https://bit.ly/42DoVj5">Run code</a></p></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/QData/TextAttack">TextAttack</a></strong> <em>[NLP]</em> - Python framework for adversarial attacks, data augmentation, and model training in NLP</p><p><strong><a href="https://github.com/stanfordnlp/stanza">stanza</a></strong> <em>[NLP]</em> - Stanford NLP Python library for tokenization, sentence segmentation, NER, and parsing of 60+ languages</p><p><strong><a href="https://github.com/fastino-ai/GLiNER2">GLiNER2</a></strong> <em>[NLP]</em> - Unified schema-based framework for entity extraction, text classification, and relation extraction in one pass</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Scrapling: Adaptive Web Scraping in Python]]></title><description><![CDATA[Plus one Python API for 25+ database backends]]></description><link>https://newsletter.codecut.ai/p/scrapling-adaptive-web-scraping-in</link><guid isPermaLink="false">https://newsletter.codecut.ai/p/scrapling-adaptive-web-scraping-in</guid><dc:creator><![CDATA[CodeCut]]></dc:creator><pubDate>Tue, 17 Mar 2026 16:01:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MY1c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Grab your coffee. Here are this week&#8217;s highlights.</p><div><hr></div><h2>&#128197; Today&#8217;s Picks</h2><h3>Scrapling: Adaptive Web Scraping in Python</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MY1c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MY1c!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png 424w, https://substackcdn.com/image/fetch/$s_!MY1c!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png 848w, https://substackcdn.com/image/fetch/$s_!MY1c!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png 1272w, https://substackcdn.com/image/fetch/$s_!MY1c!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MY1c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png" width="643" height="724" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:724,&quot;width&quot;:643,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Scrapling: Adaptive Web Scraping in Python&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Scrapling: Adaptive Web Scraping in Python" title="Code example: Scrapling: Adaptive Web Scraping in Python" srcset="https://substackcdn.com/image/fetch/$s_!MY1c!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png 424w, https://substackcdn.com/image/fetch/$s_!MY1c!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png 848w, https://substackcdn.com/image/fetch/$s_!MY1c!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png 1272w, https://substackcdn.com/image/fetch/$s_!MY1c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa7589a-c1c7-487e-9600-35fc92db6709_643x724.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Traditional scraping with BeautifulSoup uses hardcoded CSS selectors to find elements on a page.</p><p>If the site updates its layout, those selectors no longer match and the scraper ends up returning empty data.</p><h4>Solution</h4><p>Instead of relying only on selectors, <a href="https://github.com/D4Vinci/Scrapling">Scrapling</a> records how elements appear during the initial scrape.</p><p>If the site is redesigned later, it can use that stored structure to find the same elements again.</p><blockquote></blockquote><div><hr></div><h3>Ibis: One Python API for 25+ Database Backends</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OTcB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OTcB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png 424w, https://substackcdn.com/image/fetch/$s_!OTcB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png 848w, https://substackcdn.com/image/fetch/$s_!OTcB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png 1272w, https://substackcdn.com/image/fetch/$s_!OTcB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OTcB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png" width="658" height="724" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:724,&quot;width&quot;:658,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code example: Ibis: One Python API for 25+ Database Backends&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code example: Ibis: One Python API for 25+ Database Backends" title="Code example: Ibis: One Python API for 25+ Database Backends" srcset="https://substackcdn.com/image/fetch/$s_!OTcB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png 424w, https://substackcdn.com/image/fetch/$s_!OTcB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png 848w, https://substackcdn.com/image/fetch/$s_!OTcB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png 1272w, https://substackcdn.com/image/fetch/$s_!OTcB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ed375ed-af30-4140-9e2e-bfbdb1ea48c2_658x724.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Problem</h4><p>Many data workflows begin with pandas for quick experimentation, while production pipelines might run on databases like PostgreSQL or BigQuery.</p><p>Moving from prototype to production usually means rewriting the same transformation logic in SQL. That translation takes time and can easily introduce errors.</p><h4>Solution</h4><p><a href="https://github.com/ibis-project/ibis">Ibis</a> solves this by letting you define transformations once in Python and compiling them into native SQL for 25+ backends automatically.</p><blockquote><p>&#128214; <a href="https://codecut.ai/ibis-vs-narwhals-vs-fugue-dataframe-portability/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_ibis-vs-narwhals-vs-fugue-dataframe-portability">View Full Article</a></p></blockquote><div><hr></div><h2>&#9749;&#65039; Weekly Finds</h2><p><strong><a href="https://github.com/shiyu-coder/Kronos">Kronos</a></strong> <em>[Machine Learning]</em> - A decoder-only foundation model pre-trained on K-line sequences for financial market forecasting</p><p><strong><a href="https://github.com/prefix-dev/pixi">pixi</a></strong> <em>[Environment Management]</em> - Fast, cross-platform package manager built on the Conda ecosystem, written in Rust</p><p><strong><a href="https://github.com/opendatalab/MinerU">MinerU</a></strong> <em>[OCR/PDF Processing]</em> - One-stop tool for converting PDFs, webpages, and e-books into machine-readable markdown and JSON</p><div><hr></div><h3>&#128172; Rate Your Experience</h3><p>How would you rate your newsletter experience? <a href="https://r7yuob192zv.typeform.com/to/VODwGYMW">Share your feedback &#8594;</a></p><div><hr></div><h3>&#128269; Explore More on CodeCut</h3><ul><li><p><a href="https://codecut.ai/tool-selector/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_tool-selector">Tool Selector</a> - Discover 70+ Python tools for AI and data science</p></li><li><p><a href="https://codecut.ai/production-ready-data-science/?utm_source=Substack&amp;utm_medium=email&amp;utm_campaign=article_production-ready-data-science">Production Ready Data Science</a> - A practical book for taking projects from prototype to production</p></li></ul>]]></content:encoded></item></channel></rss>