﻿<?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[Patrick’s Substack]]></title><description><![CDATA[Python and Machine Learning News]]></description><link>https://patrickloeber.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!lEtc!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f9563b-11eb-475b-95c9-ffa623c1782a_992x992.png</url><title>Patrick’s Substack</title><link>https://patrickloeber.substack.com</link></image><generator>Substack</generator><lastBuildDate>Thu, 11 Jun 2026 16:59:15 GMT</lastBuildDate><atom:link href="https://patrickloeber.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Patrick Loeber]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[patrickloeber@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[patrickloeber@substack.com]]></itunes:email><itunes:name><![CDATA[Patrick Loeber]]></itunes:name></itunes:owner><itunes:author><![CDATA[Patrick Loeber]]></itunes:author><googleplay:owner><![CDATA[patrickloeber@substack.com]]></googleplay:owner><googleplay:email><![CDATA[patrickloeber@substack.com]]></googleplay:email><googleplay:author><![CDATA[Patrick Loeber]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[2 months at Google DeepMind - Recap]]></title><description><![CDATA[A quick summary of all exciting developments and product updates]]></description><link>https://patrickloeber.substack.com/p/2-months-at-google-deepmind-recap</link><guid isPermaLink="false">https://patrickloeber.substack.com/p/2-months-at-google-deepmind-recap</guid><dc:creator><![CDATA[Patrick Loeber]]></dc:creator><pubDate>Mon, 31 Mar 2025 14:11:12 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ebd6a408-cb7c-4995-856f-c112ebf894a9_740x555.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi there&#128075;</p><p>It&#8217;s been a while since you heard from me. I <a href="https://x.com/patloeber/status/1886774324830331009">joined Google DeepMind</a> two months ago, and the weeks have been extremely busy and packed with exciting developments.</p><p>Below is a quick summary of everything that happened. As part of the Developer Relations Engineering team for Gemini and Gemma, I've had a front-row seat to most of those launches:</p><p><strong>Model updates:</strong></p><ul><li><p><a href="https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/">Gemini 2.5 Pro</a></p></li><li><p><a href="https://developers.googleblog.com/en/experiment-with-gemini-20-flash-native-image-generation/">Gemini 2.0 Flash native image generation</a></p></li><li><p><a href="https://deepmind.google/technologies/gemini-robotics/">Gemini Robotics</a></p></li><li><p><a href="https://developers.googleblog.com/en/gemini-embedding-text-model-now-available-gemini-api/">Gemini Embedding</a></p></li><li><p><a href="https://developers.googleblog.com/en/imagen-3-arrives-in-the-gemini-api/">Imagen 3</a></p></li><li><p><a href="https://developers.googleblog.com/en/gemini-2-family-expands/">Gemini 2.0 Flash</a></p></li><li><p><a href="https://developers.googleblog.com/en/gemini-2-family-expands/">Gemini 2.0 Flash-Lite</a></p></li><li><p><a href="https://developers.googleblog.com/en/gemini-2-family-expands/">Gemini 2.0 Pro</a></p></li><li><p><a href="https://blog.google/technology/developers/gemma-3/">Gemma 3</a></p></li><li><p><a href="https://developers.googleblog.com/en/safer-and-multimodal-responsible-ai-with-gemma/">ShieldGemma 2</a></p></li><li><p><a href="https://developers.googleblog.com/en/introducing-paligemma-2-mix/">PaliGemma 2 Mix</a></p></li></ul><p><strong>Product improvements:</strong></p><ul><li><p><a href="https://x.com/OfficialLoganK/status/1899914266062577722">YouTube link support</a></p></li><li><p><a href="https://x.com/OfficialLoganK/status/1894049802557456669">Conversation branching in Google AI Studio</a></p></li><li><p><a href="https://research.google/blog/accelerating-scientific-breakthroughs-with-an-ai-co-scientist/">AI co-scientist</a></p></li><li><p><a href="https://blog.google/products/gemini/gemini-collaboration-features/">Audio overview &amp; Canvas mode</a> (Gemini app)</p></li><li><p><a href="https://blog.google/products/search/ai-mode-search/">AI Mode powered by Gemini</a> (Google Search)</p></li><li><p><a href="https://developers.googleblog.com/en/gemini-20-deep-dive-code-execution/">Code execution as a tool</a></p></li></ul><p><strong>Dev Ex:</strong></p><ul><li><p><a href="https://x.com/patloeber/status/1888983994533867558">Gen AI Python SDK v1.0.0</a></p></li><li><p><a href="https://github.com/googleapis/js-genai">Gen AI JS/TS SDK</a> (preview launch)</p></li><li><p><a href="https://ai.google.dev/gemini-api/docs/openai">Improved OpenAI SDK compatibility layer</a></p></li><li><p><a href="https://ai.google.dev/">Major docs updates</a> (still ongoing)</p></li><li><p><a href="https://github.com/google-gemini/cookbook">New cookbooks</a> </p></li></ul><p><strong>Hands-on tutorials from me (not official Google tutorials):</strong></p><ul><li><p><a href="https://patloeber.com/gemini-multimodal/">Get started with Gemini's multimodal capabilities</a></p></li><li><p><a href="https://github.com/patrickloeber/genai-tutorials/blob/main/notebooks/gemini-image-editing.ipynb">Image creation and editing with Gemini 2.0</a></p></li><li><p><a href="https://github.com/patrickloeber/genai-tutorials/blob/main/notebooks/gemma-3-1b-workout-summaries.ipynb">Create workout summaries with Gemma 3 1B</a></p></li></ul><p>The pace here is incredible, and moving forward, I plan to share <strong>more updates and insights</strong> into the exciting work I see at Google DeepMind (but note that I can't talk about unreleased products).</p><p>I know that my newsletter hasn't been very consistent, and with this new content shift, I completely understand if you decide to unsubscribe. Thank you all for your past engagement and support! And for those of you who will be staying, my goal is to make this <strong>new focus on AI research, product updates, and tutorials</strong> genuinely interesting and valuable.</p><p>Best,</p><p>Patrick</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://patrickloeber.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Patrick&#8217;s Substack! Subscribe for free to receive new posts</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Build a typing assistant with Ollama, Mistral 7B, and Python]]></title><description><![CDATA[Learn how to build an AI-powered locally running typing assistant.]]></description><link>https://patrickloeber.substack.com/p/build-a-typing-assistant-with-ollama</link><guid isPermaLink="false">https://patrickloeber.substack.com/p/build-a-typing-assistant-with-ollama</guid><dc:creator><![CDATA[Patrick Loeber]]></dc:creator><pubDate>Tue, 19 Mar 2024 12:23:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/IUTFrexghsQ" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi there&#128075; </p><p>It&#8217;s been a while, but now I&#8217;m back with a cool project and tutorial: Learn how to build an AI-powered locally running typing assistant with Ollama and Mistral 7B.</p><p>In this post, I'll show you how to do it.</p><p>It's a script with less than 100 lines of code that can run in the background and listen to hotkeys, then uses a Large Language Model to fix the text.</p><p>It&#8217;s inspired by <a href="https://twitter.com/karpathy/status/1725553780878647482">this tweet</a>:</p><blockquote><p> "GPT is surprisingly good at correcting minor typos, so you can write really really fast, ignore mistakes and keep going, and it comes out just fine." - Andrej Karpathy</p></blockquote><p>The full code is on GitHub: <a href="https://github.com/patrickloeber/ai-typing-assistant">https://github.com/patrickloeber/ai-typing-assistant</a></p><p>And here's a demo and a step-by-step coding tutorial if you prefer video content:</p><div id="youtube2-IUTFrexghsQ" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;IUTFrexghsQ&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/IUTFrexghsQ?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h2>Project setup:</h2><p>Ollama Installation: <a href="https://github.com/ollama/ollama">https://github.com/ollama/ollama</a>. Then run</p><pre><code><code>ollama run mistral:7b-instruct-v0.2-q4_K_S</code>.</code></pre><p>I found that Mistal 7B Instruct (quantized) works well for this task, but feel free to try other models, too :)</p><p>It relies on those dependencies:</p><p>- <a href="https://pynput.readthedocs.io/en/latest/">pynput</a>: To listen to hotkeys and control the keyboard</p><p>- <a href="https://github.com/asweigart/pyperclip">pyperclip</a>: Clipboard functions to copy and paste text</p><p>- <a href="https://github.com/encode/httpx/">httpx</a>: To send a POST request to Ollama running on your localhost</p><p>Install the dependencies with <code>pip</code>:</p><pre><code><code>pip install pynput pyperclip httpx</code></code></pre><p>Everything should work cross-platform, only the shortcuts need to be adapted for your system.</p><h2>Hotkey listener in Python</h2><p>This is how you can write a Hotkey listener with Python and <code>pynput</code>:</p><pre><code>from pynput import keyboard

def on_f9():

    fix_current_line()


def on_f10():

    fix_selection()


with keyboard.GlobalHotKeys({"&lt;101&gt;": on_f9, "&lt;109&gt;": on_f10}) as h:

    h.join()</code></pre><p>This runs endlessly in a separate thread until you stop the script.</p><h2>Modify lines and selected text with Python</h2><p>To modify selected lines, we only need the functionality to copy and paste text (= <code>Cmd+C</code> and <code>Cmd+V</code>), and to access and modify the clipboard with Python. For this, set up a keyboard controller with pynput, and use pyperclip for the clipboard functions:</p><pre><code>import time

from pynput.keyboard import Key, Controller

import pyperclip


controller = Controller()


def fix_current_line():

    # macOS short cut to select current line: Cmd+Shift+Left

    controller.press(Key.cmd)

    controller.press(Key.shift)

    controller.press(Key.left)

    controller.release(Key.cmd)

    controller.release(Key.shift)

    controller.release(Key.left)


    fix_selection()


def fix_selection():

    # 1. Copy selection to clipboard

    with controller.pressed(Key.cmd):

        controller.tap("c")


    # 2. Get the clipboard string

    time.sleep(0.1)

    text = pyperclip.paste()


    # 3. Fix string

    if not text:

        return

    fixed_text = fix_text(text)

    if not fixed_text:

        return


    # 4. Paste the fixed string to the clipboard

    pyperclip.copy(fixed_text)

    time.sleep(0.1)


    # 5. Paste the clipboard and replace the selected text

    with controller.pressed(Key.cmd):

        controller.tap("v")</code></pre><h2>Use Ollama and Mistral 7B to fix text</h2><p>Ollama comes with a REST API that's running on your localhost out of the box. So after the installation and downloading of the model, we only need to implement logic to send a POST request.</p><p>We also use a simple prompt that tells the model to fix all typos, casing, and punctuation:</p><pre><code>import httpx

OLLAMA_ENDPOINT = "http://localhost:11434/api/generate"

OLLAMA_CONFIG = {

    "model": "mistral:7b-instruct-v0.2-q4_K_S",

    "keep_alive": "5m",

    "stream": False,

}


PROMPT_TEMPLATE = Template(

    """Fix all typos and casing and punctuation in this text, but preserve all new line characters:

$text

Return only the corrected text, don't include a preamble.

"""

)


def fix_text(text):

    prompt = PROMPT_TEMPLATE.substitute(text=text)

    response = httpx.post(

        OLLAMA_ENDPOINT,

        json={"prompt": prompt, **OLLAMA_CONFIG},

        headers={"Content-Type": "application/json"},

        timeout=10,

    )

    if response.status_code != 200:

        print("Error", response.status_code)

        return None

    return response.json()["response"].strip()</code></pre><h2>Run the typing assistant</h2><p>Put everything together and start the assistant:</p><pre><code>python main.py</code></pre><p>Hotkeys you can then press:</p><p>- F9: Fixes the current line (without having to select the text)</p><p>- F10: Fixes the current selection</p><p><strong>Note</strong>: The code works on macOS. The underlying shortcuts in the code like Cmd+Shift+Left, Cmd+C, Cmd+V might have to be changed for Linux &amp; Windows (e.g. <code>Key.cmd</code> -&gt; <code>Key.ctrl</code>).</p><h2>Customize</h2><p>The hotkeys, prompt, and Ollama config can be easily customized and extended in the code.</p><p>You can easily add hotkeys that summarize or generate new text.</p><p>For example, here are some fun other prompt templates you can try:</p><pre><code>from string import Template


PROMPT_TEMPLATE_FIX_TEXT = Template(

    """Fix all typos and casing and punctuation in this text, but preserve all new line characters:

$text

Return only the corrected text."""

)


PROMPT_TEMPLATE_GENERATE_TEXT = Template(

    """Generate a snarky paragraph with 3 sentences about the following topic:

$text

Return only the corrected text."""

)


PROMPT_TEMPLATE_SUMMARIZE_TEXT = Template(

    """Summarize the following text in 3 sentences:

$text

Return only the corrected text."""

)</code></pre><p>Have fun with it!</p>]]></content:encoded></item><item><title><![CDATA[Python News, Tutorials, and a new programming language for AI]]></title><description><![CDATA[Python news and tutorials from last month]]></description><link>https://patrickloeber.substack.com/p/python-news-tutorials-and-a-new-programming</link><guid isPermaLink="false">https://patrickloeber.substack.com/p/python-news-tutorials-and-a-new-programming</guid><dc:creator><![CDATA[Patrick Loeber]]></dc:creator><pubDate>Wed, 07 Jun 2023 11:58:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lEtc!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f9563b-11eb-475b-95c9-ffa623c1782a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi friends,</p><p>Welcome to another edition of my monthly newsletter. Let&#8217;s dive right in:</p><h4>&#10067;What can you expect?</h4><p>This newsletter features <strong>tutorials, news, cool repos, and educational nuggets related to Python &amp; AI.</strong></p><h4>&#9889;&#65039;Sponsor</h4><p>Build a software business faster in pure Python <a href="https://www.python-engineer.com/go/pysaas">with PySaaS</a>. PySaaS a boilerplate Python codebase that takes care of the fundamental structure and components standard to all SaaS applications such as accepting payments, authentication, an integrated blog, and a nice landing page.</p><h4>&#128250;&#128218;Tutorials</h4><p>Here&#8217;s a short selection of interesting tutorials from the last weeks that are worth watching:</p><ul><li><p>Harvard CS50&#8217;s <a href="https://youtu.be/nLRL_NcnK-4">Introduction to Programming with Python</a> is now available for free on freeCodeCamp&#8217; YouTube channel.</p></li><li><p><a href="https://youtu.be/ZzgUqFtxgXI">Master PDF Chat with LangChain</a> from Sam Witteveen.</p></li><li><p><a href="https://youtu.be/dN0lsF2cvm4">Vector Databases simply explained in 5 minutes</a>. A video I created for the AssemblyAI channel.</p></li><li><p><a href="https://youtu.be/mop6g-c5HEY">The ultimate introduction to modern GUIs in Python with tkinter</a>. An extensive 18h course from Clear Code.</p></li><li><p>DeepLearning.AI launched 3 new courses that are available for free for a limited time: <a href="https://www.deeplearning.ai/short-courses/">LangChain for LLM Development, How Diffusion Models Work, and Building Systems with the ChatGPT API</a></p></li><li><p>Article: <a href="https://www.python-engineer.com/posts/split_list_in_chunks/">How to split a List into equally sized chunks in Python</a>. Python 3.12 will get a cool new method to do this for you!</p></li></ul><h4>&#128013; News from the Python Ecosystem</h4><ul><li><p>Chris Lattner announced a new programming language called <a href="https://www.modular.com/mojo">Mojo&#128293;</a>, which builds on top of Python and is designed specifically for AI applications. They claim it&#8217;s up to 35000 times faster than Python. I made a video about it <a href="https://youtu.be/-ogEkqeDEPg">here</a>.</p></li><li><p>PyPI was subpoenaed. They published a blog post about it <a href="https://blog.pypi.org/posts/2023-05-24-pypi-was-subpoenaed/">here</a> for transparency. They also announced that <em>every</em> account that maintains any project or organization on PyPI will be required to <a href="http://every account that maintains any project or organization on PyPI will be required to enable 2FA on their account by the end of 2023.">enable 2FA on their account</a> by the end of 2023.</p></li><li><p>In April, the&nbsp;pip&nbsp;team&nbsp;<a href="https://pip.pypa.io/en/stable/news/#v23-1">released Pip version 23.1</a>&nbsp;which solves dependencies much faster thanks to an improved <a href="https://reddit.com/r/Python/comments/12n5lai/pip_231_released_massive_improvement_to/">backtracking algorithm</a>. I recommend upgrading to the newest version with <code>python -m pip install --upgrade pip.</code></p></li><li><p>The open source library <a href="https://medium.com/@jerryjliu98/building-the-data-framework-for-llms-bca068e89e0e">LlamaIndex raises $8.5M seed round</a> to build out the data framework for LLMs.</p></li></ul><h4>&#129309;Cool Repos</h4><ul><li><p><a href="https://github.com/Lightning-AI/Lit-Parrot">lit-parrot</a>: Hackable implementation of state-of-the-art open-source large language models such as StableLM and Falcon.</p></li><li><p><a href="https://github.com/mlc-ai/mlc-llm">mlc-llm</a>: a universal solution that allows any language models to be deployed natively on a diverse set of hardware backends and native applications.</p></li><li><p><a href="https://github.com/Vision-CAIR/MiniGPT-4">MiniGPT-4</a>: Enhancing Vision-language Understanding with Advanced Large Language Models</p></li><li><p><a href="https://github.com/bigcode-project/starcoder">starcoder</a>: StarCoder is a language model (LM) trained on source code and natural language text</p></li><li><p><a href="https://github.com/AssemblyAI/assemblyai-python-sdk/blob/master/assemblyai/api.py">assemblyai-python-sdk</a>: Finally an SDK from AssemblyAI that makes it super simple to transcribe and analyze audio files.</p></li></ul><h4>&#128161;Python Tip</h4><p>The print function can take additional arguments such as <code>sep</code>, <code>end</code>, and <code>file</code>:</p><pre><code><code># 1. sep defines the separator between all objects, default is a space

print("How", "are", "you", sep="-")
# How-are-you

# 2. end defines the character in the end, default is a new-line char

print("Hello", end="")
print("World")
# HelloWorld

# 3. file to write the output into a file instead of stdout

f = open("test.txt", "a")
print("This goes into a file", file=f)
f.close()</code></code></pre><p>I hope you enjoyed the read!</p><p>Patrick</p>]]></content:encoded></item><item><title><![CDATA[LangChain, PyScript, Auto-GPT, and more]]></title><description><![CDATA[Python news and tutorials from last month]]></description><link>https://patrickloeber.substack.com/p/langchain-pyscript-auto-gpt-and-more</link><guid isPermaLink="false">https://patrickloeber.substack.com/p/langchain-pyscript-auto-gpt-and-more</guid><dc:creator><![CDATA[Patrick Loeber]]></dc:creator><pubDate>Mon, 01 May 2023 14:26:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lEtc!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f9563b-11eb-475b-95c9-ffa623c1782a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi friends,</p><p>Welcome to another edition of my monthly newsletter. Let&#8217;s dive right in:</p><h4>&#10067;What can you expect?</h4><p>This newsletter features <strong>tutorials, news, cool repos, and educational nuggets related to Python &amp; AI.</strong></p><h4>&#128250;&#128218;Tutorials</h4><p>Here&#8217;s a short selection of interesting tutorials from last month that are worth watching. The first three videos are from me:</p><ul><li><p><a href="https://youtu.be/LbT1yp6quS8">LangChain Crash Course</a> - Build apps with language models. You can also find a written guide <a href="https://www.python-engineer.com/posts/langchain-crash-course/">here</a>.</p></li><li><p><a href="https://youtu.be/owopzp436jM">PyScript is officially here</a>! Build web apps with Python &amp; HTML</p></li><li><p><a href="https://youtu.be/jvpCvRSxXQI">Auto-GPT, BabyAGI, and 4 autonomous agents you must try</a></p></li><li><p><a href="https://youtu.be/IvEh7A308FU">5 Steps to Build a Question Answering PDF&nbsp;Chatbot</a></p></li><li><p><a href="https://youtu.be/RqTEHSBrYFw">Complete Docker Course</a> - From BEGINNER to PRO!</p></li></ul><h4>&#128013; News from the Python Ecosystem</h4><ul><li><p>The Python framework LangChain announced <a href="https://blog.langchain.dev/announcing-our-10m-seed-round-led-by-benchmark/">their $10M seed round</a></p></li><li><p><a href="https://discuss.python.org/t/pep-684-a-per-interpreter-gil/19583/42">PEP 684 has been accepted</a> which introduces a per-interpreter GIL in Python 3.12</p></li><li><p><a href="https://pandas.pydata.org/docs/whatsnew/index.html#release">Pandas 2.0 was released</a></p></li><li><p><a href="https://www.anaconda.com/press/anaconda-launches-pyscriptcom-democratizes-python-for-all/">Anaconda Launches PyScript.com</a><strong>,</strong> a new platform to build web apps with Python and HTML</p></li></ul><h4>&#129309;Cool Repos</h4><ul><li><p><a href="https://github.com/Significant-Gravitas/Auto-GPT">Auto-GPT</a>: Do I need to say something about this repo? 120K stars in 4 weeks&#129327;</p></li></ul><ul><li><p><a href="https://github.com/yoheinakajima/babyagi">babyagi</a>: An AI-powered task management system to solve tasks autonomously with the help of GPT-4. The code is intentionally kept minimal, so exploring the code is nice.</p></li><li><p><a href="https://github.com/jerryjliu/llama_index">llama-index</a>: A project that provides a central interface to connect your LLM's with external data.</p></li><li><p><a href="https://github.com/weaviate/weaviate">weaviate</a>: An open source vector database that stores both objects and vectors, allowing for combining vector search with structured filtering.</p></li><li><p><a href="https://github.com/Lightning-AI/lit-llama">lit-llama</a>: An independent implementation of LLaMA based on nanoGPT that is fully open source under the Apache 2.0 license.</p></li></ul><h4>&#128161;Python Tip</h4><p>Do you know about the built-in <a href="https://docs.python.org/3/library/functions.html#any">any()</a> function? <code>any()</code> returns True if any element of the iterable is true. Look at this example and how it can be used to refactor code:</p><pre><code><code>numbers = [-1, -2, -4, 0, 3, -7]

# manually looping
has_positives = False
for n in numbers:
    if n &gt; 0:
        has_positives = True
        break

# refactor using any()&#9989;
has_positives = any(n &gt; 0 for n in numbers)</code></code></pre><p>I hope you enjoyed the read!</p><p>Patrick</p>]]></content:encoded></item><item><title><![CDATA[March Madness for Python and AI]]></title><description><![CDATA[Crazy AI releases and cool Python tutorials and news from last month]]></description><link>https://patrickloeber.substack.com/p/march-madness-for-python-and-ai</link><guid isPermaLink="false">https://patrickloeber.substack.com/p/march-madness-for-python-and-ai</guid><dc:creator><![CDATA[Patrick Loeber]]></dc:creator><pubDate>Sun, 02 Apr 2023 09:18:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lEtc!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f9563b-11eb-475b-95c9-ffa623c1782a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi friends,</p><p>Welcome to another edition of my monthly newsletter. Let&#8217;s dive right in:</p><h4>&#10067;What can you expect?</h4><p>This newsletter features <strong>tutorials, news, cool repos, and educational nuggets related to Python &amp; AI.</strong></p><h4>&#128250;&#128218;Tutorials</h4><p>Here&#8217;s a short selection of interesting tutorials from last month that are worth watching:</p><ul><li><p><a href="https://youtube.com/playlist?list=PLcWfeUsAys2lpJzESyeRUVvJlU6ycjr-b">Python for AI developers</a>: A free course on YouTube from me and my colleague M&#305;sra that helps you to build with AI</p></li><li><p><a href="https://www.youtube.com/live/outcGtbnMuQ?feature=share">GPT-4 Developer Livestream</a> from OpenAI</p></li><li><p><a href="https://youtube.com/playlist?list=PLIUOU7oqGTLgBf0X_KzRlsqyM2Cs7Dxp9">Generative AI and LLMs</a> - Playlist from James Briggs</p></li><li><p><a href="https://youtu.be/vzGllw18DkA">Harvard CS50&#8217;s Web Programming with Python and JavaScript</a> &#8211; Full University Course available on freeCodeCamp&#8217;s YouTube channel</p></li></ul><h4>&#128013; News from the Python Ecosystem</h4><ul><li><p>PyTorch 2.0 is officially here. See the <a href="https://pytorch.org/blog/pytorch-2.0-release/">announcement</a>.</p></li><li><p><a href="https://lightning.ai/pages/releases/2.0.0/">PyTorch Lightning 2.0 is here</a>. Among other changes, the team is introducing <strong>Fabric</strong>, a<strong> </strong>fast and lightweight way to scale PyTorch models with just a few lines of code.</p></li></ul><ul><li><p><a href="https://pythoninsider.blogspot.com/2023/03/python-3120-alpha-6-released.html">Python 3.12.0 alpha 6 released</a> - In case you missed it, you can already play around with the next Python version.</p></li><li><p>Pandas 2.0 is almost here! Keep an eye out in the coming days. See the <a href="https://pandas.pydata.org/pandas-docs/version/2.0/whatsnew/v2.0.0.html">What&#8217;s New</a> blog post and watch the <a href="https://github.com/pandas-dev/pandas/releases">releases page</a>. </p></li></ul><h4>&#129302;AI Month</h4><p>This month was absolutely crazy in the AI space. I summarized the most important releases in this tweet:</p><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/patloeber/status/1636666130239725570&quot;,&quot;full_text&quot;:&quot;What a week for AI &#128640;\n\n- <span class=\&quot;tweet-fake-link\&quot;>@OpenAI</span> GPT-4\n- <span class=\&quot;tweet-fake-link\&quot;>@AnthropicAI</span> Claude\n- <span class=\&quot;tweet-fake-link\&quot;>@thukeg</span> ChatGLM\n- <span class=\&quot;tweet-fake-link\&quot;>@GoogleAI</span> PaLM API &amp;amp; MakerSuite\n- <span class=\&quot;tweet-fake-link\&quot;>@AssemblyAI</span> Conformer-1\n- Stanford Alpaca\n- Midjourney v5\n- Microsoft 365 Copilot\n\n- <span class=\&quot;tweet-fake-link\&quot;>@PyTorch</span> PyTorch 2.0\n- <span class=\&quot;tweet-fake-link\&quot;>@LightningAI</span> PyTorch Lightning 2.0\n\nExciting times!&quot;,&quot;username&quot;:&quot;patloeber&quot;,&quot;name&quot;:&quot;Patrick Loeber&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Fri Mar 17 09:49:47 +0000 2023&quot;,&quot;photos&quot;:[],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:105,&quot;like_count&quot;:466,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{},&quot;video_url&quot;:null,&quot;belowTheFold&quot;:true}" data-component-name="Twitter2ToDOM"></div><p>I won&#8217;t cover all the details in this newsletter, but if you want to follow a newsletter that is focused on AI only, I created a list of <a href="https://www.python-engineer.com/posts/15-best-ai-newsletters/">15 great AI newsletters here</a>. </p><h4>&#129309;Cool Repos</h4><ul><li><p><a href="https://github.com/patrickloeber/">python-github-action-template</a>: A template that lets you easily schedule a Python script with GitHub Actions</p></li><li><p><a href="https://github.com/hwchase17/langchain">langchain</a>: LangChain is a framework for developing applications powered by language models. It facilitates building applications with LLMs through composability.</p></li></ul><h4>&#128161;Python Tip</h4><p>Use more <a href="https://www.python-engineer.com/posts/dataclass-python/">dataclasses</a> in your Python code. Gets rid of so much boilerplate:</p><pre><code>from dataclasses import dataclass

@dataclass
class Student:
    age: int
    name: str

student = Student(22, "Anna")
print(student)
# Student(age=22, name='Anna')</code></pre><p>I hope you enjoyed the read!</p><p>Patrick</p>]]></content:encoded></item><item><title><![CDATA[Python Engineer is now on Substack]]></title><description><![CDATA[Welcome to my first email on Substack]]></description><link>https://patrickloeber.substack.com/p/python-engineer-is-now-on-substack</link><guid isPermaLink="false">https://patrickloeber.substack.com/p/python-engineer-is-now-on-substack</guid><dc:creator><![CDATA[Patrick Loeber]]></dc:creator><pubDate>Fri, 03 Mar 2023 15:42:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lEtc!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f9563b-11eb-475b-95c9-ffa623c1782a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey there &#128075;</p><p>This is Patrick writing to you from a new platform. You might be surprised to see a new email address since you probably subscribed on the Python Engineer website or on Revue. I moved my newsletter to Substack, so don&#8217;t worry, it&#8217;s still me.</p><h4>&#10067;What can you expect?</h4><p>This will be a newsletter featuring <strong>tutorials, news, trends, and educational nuggets related to Python &amp; AI</strong>. For the time being, I want to send out new issues every month.</p><h4>&#9889;&#65039;Thanks to our Sponsors who keep this Newsletter free</h4><p>This first issue is brought to you by <strong>Underfitted, </strong>another AI newsletter from my friend <a href="https://twitter.com/svpino">Santiago</a>. Every Friday, you'll get a short, exciting story about Artificial Intelligence that will inspire and make you smarter. And all of this in fewer than 500 words! Click <a href="https://underfitted.svpino.com/">here</a> to subscribe.</p><h4>&#128250;&#128218;Tutorials</h4><p>Tutorial from the past weeks you might have missed:</p><ul><li><p><a href="https://youtu.be/0H2miBK_gAk">How to create a great dev environment with Docker</a></p></li><li><p><a href="https://youtu.be/M1gu9MDucMA">How to automate Notion with Python | Notion API Tutorial</a></p></li></ul><p>Not from me but really awesome:</p><ul><li><p><a href="https://youtu.be/kCc8FmEb1nY">Andrej Karpathy: Let's build GPT from scratch</a></p></li><li><p><a href="https://youtu.be/wuSQpLinRB4">freeCodeCamp: AlphaZero from Scratch</a></p></li></ul><h4>&#128013; News from the Python Ecosystem</h4><ul><li><p>Pydantic, the popular Open-Source data validation framework is <a href="https://pydantic.dev/announcement/">starting a company</a></p></li><li><p>A new solution for packaging in Python? <a href="https://pyfound.blogspot.com/2023/02/python-packaging-strategy-discussion.html">Python Packaging Strategy Discussion</a></p></li></ul><h4>&#129309;Cool Repos</h4><ul><li><p><a href="https://github.com/jaymody/picoGPT">picoGPT: An unnecessarily tiny implementation of GPT-2 in NumPy</a></p></li><li><p><a href="https://github.com/jaymody/picoGPT">paper-qa: question and answering from PDFs or text files</a></p></li></ul><h4>&#128161;Python Tip</h4><p> How to pad zeros to a String: zfill, rjust, or String formatting:</p><pre><code>"42".zfill(5)         # '00042'
"-42".zfill(5)        #'-0042'

"42".rjust(5)         # '   42'
"42".rjust(5, "0")    # '00042'
"-42".rjust(5, "0")   # '00-42'

n = 42
f'{n:05d}'            # '00042'
n = -42
f'{n:05d}'            #'-0042'</code></pre><p>I hope you enjoyed the read!</p><p>Patrick</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://patrickloeber.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Patrick&#8217;s Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Coming soon]]></title><description><![CDATA[This is Patrick&#8217;s Substack, a newsletter about Python and Machine Learning News.]]></description><link>https://patrickloeber.substack.com/p/coming-soon</link><guid isPermaLink="false">https://patrickloeber.substack.com/p/coming-soon</guid><dc:creator><![CDATA[Patrick Loeber]]></dc:creator><pubDate>Sun, 01 Jan 2023 11:02:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lEtc!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f9563b-11eb-475b-95c9-ffa623c1782a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>This is Patrick&#8217;s Substack</strong>, a newsletter about Python and Machine Learning News.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://patrickloeber.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://patrickloeber.substack.com/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item></channel></rss>