<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lynn Langit on Medium]]></title>
        <description><![CDATA[Stories by Lynn Langit on Medium]]></description>
        <link>https://medium.com/@lynnlangit?source=rss-8945742012d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JCyGL1nZ5hq6mjInmsP_mQ.png</url>
            <title>Stories by Lynn Langit on Medium</title>
            <link>https://medium.com/@lynnlangit?source=rss-8945742012d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 08:18:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lynnlangit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Lessons from a MCP Build]]></title>
            <link>https://lynnlangit.medium.com/lessons-from-a-mcp-build-204b1cf8f333?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/204b1cf8f333</guid>
            <category><![CDATA[google-antigravity]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Wed, 04 Mar 2026 01:12:32 GMT</pubDate>
            <atom:updated>2026-03-04T01:12:32.907Z</atom:updated>
            <content:encoded><![CDATA[<h4>A three-phase journey from local prototype to GCP Cloud Run — and the three bugs I didn’t see coming.</h4><h3>What I Was Trying to Do</h3><p>My <a href="https://github.com/lynnlangit/learning-ethical-ai">learning-ethical-ai</a> GitHub Repo is a curated collection of markdown files — case studies, frameworks, and analysis covering AI safety, agentic AI risks, and healthcare AI ethics. I wanted to connect that repository directly to Claude Desktop, so that Claude could read, reason over, and surface that content dynamically using MCP tools and resources.</p><p>Simple enough, right?</p><p>The goal was a fully remote, cloud-hosted MCP server running on Google Cloud Run, serving content fetched live from GitHub, accessible to Claude Desktop anywhere over the public internet.</p><p>Three phases. Three surprises.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aVc5zi4n7WbnSRSBXDApew.png" /><figcaption>MCP Server Development Phased Approach</figcaption></figure><h3>Phase 1: Fully Local</h3><p>I started building for my local filesystem using <a href="https://antigravity.google/">Google Antigravity</a> and Gemini 3.1. Using these tools, I was able to build a local mcp server in minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JYf7lVl9ESyZYjuPunb3Eg.png" /><figcaption>Quick start with Google Antigravity</figcaption></figure><p>The server ran via uv run server.py using Standard IO (stdio) transport. The data came from a local clone of the repo, recursively searched with Path.rglob(). First I used the Antigravity-included MCP Inspector tool to test the server code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VH-2NUoWiKRX74E6HKvg7A.png" /><figcaption>First test of the new server with the MCP Inspector Tool</figcaption></figure><h4>Test with Claude Desktop</h4><p><a href="https://code.claude.com/docs/en/desktop-quickstart">Claude Desktop</a> on macOS connected over that local stdio stream.<br>It worked. First try.</p><p>That’s the thing about local prototypes — they’re deceptively clean. No proxies. No network hops. No reverse engineering what Cloud Run is actually doing to your HTTP headers. When everything lives on one machine, complexity evaporates.</p><p>I took a screenshot (shown below) and decided to keep going with the build. Time to figure out how make it work faster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zSmFbrj_GjovAtGrSdiLjA.png" /><figcaption>Local testing of my new mcp server in Claude Desktop — it works!</figcaption></figure><h3>Phase 2: Remote Data, Local Execution</h3><p>Phase two was about detaching the data layer from the local filesystem. I swapped the Path.rglob() logic for live HTTPS fetches from raw.githubusercontent.com. The server still ran locally over stdio, but now it pulled markdown content from GitHub into an in-memory cache (which I built) with a 5-minute TTL.</p><p>Claude Desktop read that remote content as if it were local. The cache refresh was invisible. Everything passed cleanly through the local stdio stream.</p><p>The architecture was starting to feel real. The nest step: deploy the local server from my laptop into the public cloud.</p><h3>Phase 3: Fully Remote on GCP Cloud Run</h3><p>Cloud Run requires SSE (Server-Sent Events) transport instead of stdio. That&#39;s the first thing that changes. The second thing that changes is that your server is now behind GCP&#39;s reverse proxy — and that proxy has opinions about HTTP Host headers.</p><p>Here’s what broke, and how I fixed it.</p><h3>Bug 1: The Wrong FastMCP Package</h3><p>I started with mcp.server.fastmcp — the FastMCP submodule bundled natively inside the mcp SDK. On Cloud Run, it failed with &quot;Empty Error&quot; and HTTP 421 Invalid Host Header responses. Ugly, cryptic, and not at all obvious.</p><p>The fix was surprisingly specific: downgrade to the <strong>standalone </strong><strong>fastmcp==2.13.0 PyPI package</strong>. This version natively supports MCP_BASE_URL configuration, which tells the server how to construct its URLs when sitting behind a reverse proxy. The bundled submodule didn&#39;t.</p><p>One line in requirements.txt. It took quite a bit of time to debug to find it.</p><h3>Bug 2: Synchronous Threads Killing SSE Heartbeats</h3><p>My GitHub fetching logic used synchronous urllib.request calls. On startup, the server downloaded 24 markdown files — all of them, simultaneously, in synchronous threads.</p><p>Under that load, the Python event loop blocked for up to <strong>10 seconds</strong>. During that window, the FastMCP web server couldn’t send SSE heartbeats. Claude Desktop interpreted the silence as a dead connection and terminated.</p><p>Gemini (in Antigravity) to the rescue! It helped me to implement a key fix: rewrite everything async. httpx.AsyncClient for HTTP fetches, asyncio throughout all tool definitions. The event loop stayed unblocked. Heartbeats kept flowing. Claude Desktop stayed connected.</p><p>This is a common pattern I’ve seen in data pipeline work — synchronous I/O sneaking into async contexts and causing silent failures under load. It always looks fine in testing. It always breaks in production.</p><h3>Bug 3: The Wrong Proxy Tool</h3><p>To connect Claude Desktop to an SSE server, you need something to translate between SSE and stdio. I initially reached for the third-party mcp-proxy tool. It failed — couldn&#39;t parse the payload efficiently enough under real conditions.</p><p>The fix was switching to FastMCP’s own native proxy command:</p><pre>uvx fastmcp run [URL]</pre><p>One command. It wraps the remote SSE endpoint directly and handles the translation natively. No third-party dependency. No parsing overhead.</p><h3>Key Learnings</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hv5A2SAjfdvLY7KUTx21Xg.png" /><figcaption>Learnings from this build</figcaption></figure><p>Three bugs. Three phases. All of them taught me something I already “knew” but hadn’t fully internalized for MCP workloads specifically:</p><p><strong>Cloud deployment isn’t just a hosting change — it’s an architectural stress test.</strong></p><p>Reverse proxies, network latency, async event loops, and SSE heartbeat timing interact in ways that local stdio development hides completely. The prototype phase isn&#39;t wasted time. But it can lull you into confidence you haven&#39;t earned yet. Google Antigravity and Gemini helped me make my idea real on the cloud in just a few hours work too.</p><h3>What’s Next</h3><p>The server is live. Claude Desktop connects to it over the public internet. The learning-ethical-ai content — AI safety frameworks, agentic AI risk analysis, healthcare ethics case studies — is now dynamically accessible to me using Claude Desktop as a client as MCP tools and resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TkiF3eruWbk0Pa9buZ4hxQ.png" /><figcaption>Testing the local and remote mcp servers in Claude Desktop</figcaption></figure><p>The full development summary, including the architecture diagram and phased breakdown, lives in my repo: <a href="https://github.com/lynnlangit/learning-ethical-ai/tree/main/08-mcp-server">https://github.com/lynnlangit/learning-ethical-ai/tree/main/08-mcp-server</a></p><p>If you’re building MCP servers and planning to ship them to GCP Cloud Run I hope you can learn from the bugs above before you start. Happy building!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=204b1cf8f333" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gemini 3.1 Flash Image Review]]></title>
            <link>https://lynnlangit.medium.com/gemini-3-1-flash-image-preview-ace4080d3899?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ace4080d3899</guid>
            <category><![CDATA[ai-image-generator]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Thu, 26 Feb 2026 16:18:34 GMT</pubDate>
            <atom:updated>2026-02-26T16:39:01.825Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve spent the last decade architecting cloud-native data pipelines, and lately, my focus has shifted heavily toward what generative AI tools can actually do for your production practice — and the critical things they can’t. Recently, I tested out the latest iteration of Google’s image generation model gemini-3.1-flash-image-previewwhich was released <a href="https://blog.google/innovation-and-ai/technology/ai/nano-banana-2/">today</a>.</p><h3>The Evolution of Precision</h3><p>In my work with bioinformatics and healthcare, I prioritize precision over “hallucinations”. While image generation is often seen as a creative field, the technical progress in how these models follow specific constraints — like removing a single object or changing a garment while preserving identity — is a significant architectural milestone.</p><p>Here is a look at two recent test cases I ran through the model (the first using the Gemini Runway template), which transported my group from a casual outdoor setting to a formal, museum-grade editorial style — or, as I like to call it <em>“we dress up via AI magic!”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhTBHPqy9n2viAD85wivaQ.jpeg" /><figcaption>Original photo — Me and friends at a casual brunch</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMy1qPDroiSnqmb55C7N2Q.jpeg" /><figcaption>Apply the Gemini Runway style (plus a couple of prompts) and we are ready for a formal event!</figcaption></figure><p>The entire prompt that I used to generate the image above was this: ‘<em>Just the people — remove the entire table and all of the food. I am in the center — remove my hat. Put me in a kelly green gown.’</em></p><p>Shown below are the template styles you can choose from in the Gemini app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7etqX0Odj6nvCM2msvj22w.png" /><figcaption>You can apply styles to your uploaded photos and also text to guide the image generation.</figcaption></figure><h3>Why This Matters for Cloud Architects</h3><p>When I build documentation, I often use diagrams and visual aids because readers process images faster than text. The ability to rapidly generate high-fidelity, stylistically consistent visuals — see another complex group example in my test below — allows for a higher level of creativity (and professional polish) in technical documentation without requiring a full creative suite. Did I mention it’s fun as heck too?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qeG6-H0wKTkSApIr59tIgA.jpeg" /><figcaption>Here’s a team I collaborated with at a recent video shoot.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_-GD0Jf_8JyRvT1fFcSURg.jpeg" /><figcaption>Apply the Gemini Mythic Fighter template + a prompt and voilá — we are in all in fine fighting form!</figcaption></figure><p>The prompt I used here is this: <em>“Put me in the front with a bow and arrow (I am the woman wearing glasses).”</em></p><p>Look closely at the before and after in each of the examples and consider the significance of the minimal prompt that was needed. The complexity of generating new images of all of the people in each photo in completely different positions, lighting and clothing is very significant and demonstrates the power of this new image model.</p><p>Also, all images generated by Google AI contain an invisible watermark which can be <a href="https://support.google.com/gemini/answer/16722517">identified using their SynthID tool</a> (see usage example below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TywAW3qT8Ezr5lKxZrLgxA.png" /><figcaption>Using the the Google SynthID tool in Gemini</figcaption></figure><h3>Final Thoughts</h3><p>As with all tools I use for helping my clients visualize Cloud AI Architectures, I evaluate image models based on their repeatability and precision. The gemini-3.1-flash-image-preview model shows a marked improvement in following complex, multi-step instructions (like <em>&quot;remove the hat&quot; </em>and <em>&quot;change the gown color&quot;)</em> while maintaining the integrity of the subjects.</p><p>As you experiment with this powerful and fun new image model, I’d love to hear how it handles your specific use cases. Stop installing stuff on your laptop and start testing in the cloud!</p><p><em>Social Disclosure: I was invited by Google DeepMind / Google to provide feedback on this model during early access. #earlyAccess</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ace4080d3899" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Racing at the Edge: Validating Real-Time Agentic AI at 150 MPH]]></title>
            <link>https://lynnlangit.medium.com/racing-at-the-edge-validating-real-time-agentic-ai-at-150-mph-c9298f9d1ee5?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9298f9d1ee5</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[gemini]]></category>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 20:31:00 GMT</pubDate>
            <atom:updated>2026-01-05T20:31:00.440Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve spent a lot of time architecting systems for healthcare and bioinformatics — domains where precision is critical and “hallucinations” are non-negotiable. Last December, I joined a group of 10 Google Developer Experts to work on a project that traded a traditional microscope for a one of a different kind: a race car telemetry system.</p><blockquote>We called it the <strong>High-Velocity AI Field Test.</strong></blockquote><p>The mission was audacious: validate Google’s new <strong>Gemini 3.0</strong> and <strong>Antigravity</strong> stack by putting an AI “Crew Chief” in the passenger seat of a race car. The goal wasn’t just to build a chatbot that can talk about cars; it was to build an agentic system that can ingest high-frequency sensor data, analyze driving lines in real-time, and offer coaching advice safe enough to trust at speed of up to 150 MPH.</p><p>Here is part of what our team of GDEs built, some of the architectural patterns we discovered, and why this matters for more than just racing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZHQeLZ5GDtUKbHl_I0Cleg.jpeg" /><figcaption>10 GDEs + Gemini + 1 car &amp; driver — ready to test on the track!</figcaption></figure><h3>The Problem: Latency vs. Reasoning</h3><p>In cloud architecture, we often talk about the trade-off between speed and depth. In a race car, this trade-off is physical.</p><ul><li><strong>Reaction (The Hot Path):</strong> If the car loses traction, the driver needs to know in &lt;50ms.</li><li><strong>Reasoning (The Warm Path):</strong> If the driver is consistently braking too early for Turn 1, they need thoughtful, context-aware coaching, which takes 1–2 seconds to synthesize.</li></ul><p>A single Large Language Model (LLM) cannot do both. If you ask a cloud-based model to analyze G-force vectors for a safety alert, the car has already crashed by the time the token stream returns.</p><h3>The Solution: The “Gemini Squad” Architecture</h3><p>We moved away from the idea of a single “AI Assistant” and adopted a multi-agent pattern we call the <strong>Gemini Squad</strong>. This isolates responsibilities across the edge and the cloud.</p><h4>1. The Hot Path: Gemini Nano (Edge TPU)</h4><p>Running locally in the browser (simulating an Edge TPU), we implemented a “reflexive” layer. This isn’t generating poetry; it’s monitoring raw physics at 20Hz. It looks for specific thresholds — “Threshold Braking Limit,” “Max Lateral G” — and triggers immediate, visual-only alerts. It doesn’t ask “why”; it just yells “now.”</p><h4>2. The Warm Path: Gemini 2.5/3.0 (Cloud)</h4><p>This is where the reasoning happens. We stream the telemetry to the cloud, where the model acts as a synthesizer. But here’s the key: we don’t just dump data into the prompt. We use <strong>Persona-Based Routing</strong>.</p><ul><li><strong>AJ (Crew Chief):</strong> Aggressive, strategic. Focuses on lap times and line correction.</li><li><strong>Ross (Telemetry):</strong> Technical, calm. Reports on mechanical states like tire temps and brake pressure.</li></ul><p>The system prompt autonomously selects which agent speaks based on the data context. If the car is overheating, Ross speaks. If the driver is being tentative, AJ steps in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yn0Ikd2up3mCV_sE7WTngw.png" /><figcaption>App protoype — the ‘Gemini Coach Sqaud’ in action</figcaption></figure><h3>Injecting Expert Memory (Without RAG)</h3><p>One of the biggest challenges with LLMs is trust. How do we ensure the AI gives professional racing advice and not just generic “drive faster” hallucinations?</p><p>So that we could iterate rapidly, we implemented a <strong>Pedagogical Vector Retrieval</strong> pattern — but without the complexity of an external vector database. We embedded a “Simple Pedagogy” JSON structure directly into the system prompt. We simply ‘dropped in’ examples of correctness (text transcripts, device manual, etc…) into Gemini 3.0 and used Gemini Canvas to rapidly generate prototypes for driver validation. Each version of the POC app contained Gemini-extracted specific, expert-verified concepts:</p><pre>{&quot;id&quot;: &quot;NOV_01&quot;, &quot;concept&quot;: &quot;Track Usage&quot;, &quot;trigger&quot;: &quot;lat_g_drop_early&quot;, &quot;advice&quot;: &quot;Unwind the wheel and let the car run free...&quot;}</pre><p>Now, when the telemetry shows a specific pattern (like an early drop in lateral G-force), the model didn’t invent advice. It “queried” this injected memory and delivered the exact, verified coaching cue. It made the system deterministic enough for safety, but flexible enough for natural language.</p><h3>Optimizing for Cognitive Load</h3><p>Because the driver could only get audio feedback WHILE driving, during our simulation tests, we hit a wall: <strong>Driver Overload.</strong> The “Hot Path” (Nano) was triggering 10 times a second. The “Warm Path” (Cloud) was chattering constantly. It sounded like a chaotic Zoom call.</p><p>To fix this, we again used Gemini Canvas to rapidly implement strict safety protocols in code in the frontend:</p><ol><li><strong>Unified Voice Protocol:</strong> Switching between different text-to-speech voices (e.g., Male vs. Female) was jarring. We standardized on a single voice profile, differentiating agents only by subtle shifts in pitch and rate (AJ is faster/higher, Ross is slower/deeper).</li><li><strong>The Safety Buffer:</strong> We enforced a hard 3-second refractory period between messages.</li><li><strong>Priority Queue:</strong> Only “High Priority” safety warnings can break that buffer. If AJ wants to give a strategy tip, he has to wait for a quiet moment.</li></ol><p>The ‘app-in-progress’ in action is shown briefly below. During testing, we started with Gemini 2.5 Flash (as 3.0 wasn’t released yet), our dev team pivoted to using 3.0 downstream and got even better results with the newer version of the model.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHo21d39c2bY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHo21d39c2bY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHo21d39c2bY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c5428a7866d79165abdc868b032ae15/href">https://medium.com/media/2c5428a7866d79165abdc868b032ae15/href</a></iframe><p>POC Application architecture shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHnrddkwibI8Itu6Gdl2sg.png" /><figcaption>Application architecture for Gemini Squad</figcaption></figure><h3>The “Pit Lane Cloud” for CI/CD</h3><p>Another key piece of the puzzle was deployment. We took this (and other) prototype apps to a real race track for in car testing in December — of course, because the network speed was unknown until we arrived, we couldn’t rely on standard CI/CD pipelines.</p><p>So, for testing, we designed a <strong>“Local-First” Deployment Loop</strong>:</p><ol><li><strong>Engineer Station:</strong> A laptop in the pit lane acted as a local build server and static host.</li><li><strong>Validation Gate:</strong> Before any code hits the car, it automatically ran in a “Replay Mode” on the server, processed a known CSV dataset to ensure the Squad doesn’t crash.</li><li><strong>Air-Gapped Sync:</strong> When the car pits, it connected to a local mesh WiFi. We pushed the build directly from the station to the car’s laptop via a local IP. This allowed us to iterate on the AI’s logic between heat runs — coding in the pits, deploying in seconds, and testing at speed.</li></ol><p>Of course, hardware is hard, so the best laid plans have to be flexible… for more about what actually happened at the track, read GDE Vikram Tiwari’s account of ‘race day’ — <a href="https://vik-website.web.app/notes/generative-ai-universe/the-race-for-real-time.html">here</a>.</p><h3>From Race Cars to Hospitals</h3><p>Why does this matter? Because a race car is just a high-velocity proxy for other high-stakes environments.</p><p>The patterns we validated here — <strong>Hybrid Edge/Cloud Architecture</strong>, <strong>Pedagogical Context Injection</strong>, and <strong>Cognitive Load Management</strong> — are exactly what we need for the next generation of AI in healthcare, manufacturing, and aviation.</p><p>Whether it’s a driver managing tire grip or a clinician managing a patient’s vitals, the requirement is the same: the right data, at the right time, with zero distraction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZ3Hee3O7Jr5UDQiUbmBTQ.jpeg" /><figcaption>Our driver — ready for another track test of the Gemini Squad.</figcaption></figure><p><em>You can find the technical deep dive and the React code patterns for this project on my </em><a href="https://github.com/lynnlangit/High-Velocity-AI-Field-Test"><em>GitHub</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9298f9d1ee5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From POC to Patient: Validating AI-Orchestrated Bioinformatics with a Complete Cancer Case]]></title>
            <link>https://lynnlangit.medium.com/from-poc-to-patient-validating-ai-orchestrated-bioinformatics-with-a-complete-cancer-case-19b6af8fccf2?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/19b6af8fccf2</guid>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[cancer]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 23:57:26 GMT</pubDate>
            <atom:updated>2025-12-10T23:59:08.779Z</atom:updated>
            <content:encoded><![CDATA[<p>Part 2 of my MCP bioinformatics journey — this time with a synthetic patient, multi-modal data, and a path to production</p><p>A few weeks ago, I wrote about building <a href="https://medium.com/@lynnlangit/when-ai-meets-spatial-genomics-8899f883f3b2?sk=2ca68d923e878f64b84e9e8cc62c7722">eight MCP servers for spatial transcriptomics</a>. The response surprised me. Several researchers reached out asking the same question:</p><blockquote><em>“Does this actually work on a real analysis?”</em></blockquote><p>Fair point. Running FASTQ validation is one thing. Orchestrating a complete multi-modal cancer analysis — clinical data, genomics, spatial transcriptomics, proteomics, imaging — that’s something else entirely.</p><p>So I built patient-one.</p><h3>Meet Sarah Anderson</h3><p>Sarah Elizabeth Anderson doesn’t exist. She’s a synthetic patient I created to stress-test the architecture. But her case is biologically plausible, clinically realistic, and complicated enough to actually matter.</p><p>Unfortunately I have actual domain expertise here, as I was recently the lead patient advocate for a dear friend, not unlike Sarah, who was diagnosed with stage IV HGSOC Nov 2025. After many courses of standard treatment, she unfortunately, passed away August 2026.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HWzBqX908rdIjWVJvZuDbQ.png" /><figcaption>Patient-one Data</figcaption></figure><p>The clinical question driving everything: <em>How can we integrate multi-modal data to understand her resistance mechanisms and identify therapeutic options?</em></p><p>This isn’t a toy problem. Platinum resistance in ovarian cancer is one of the hardest challenges in gynecologic oncology. The answer requires synthesizing data across modalities that don’t usually talk to each other.</p><h3>Expanding the Server Ecosystem</h3><p>The original eight servers weren’t enough. For a complete patient analysis, I needed two more:</p><p><strong>mcp-multiomics</strong> — Integrates RNA, protein, and phosphorylation data. Runs HAllA (Hierarchical All-against-All) for cross-omics associations and Stouffer’s meta-analysis to combine p-values across modalities.</p><p><strong>mcp-pubmed</strong> — Literature search and full-text retrieval. Because every finding should connect to published evidence.</p><p>That brings us to ten specialized servers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3QwcoWlUR7XxKJHn1xTJ-A.png" /><figcaption>MCP Servers created for this scenario</figcaption></figure><p>Each still does one thing well. But now they can be orchestrated into something more than the sum of their parts.</p><h3>The Five-Test Methodology</h3><p>Here’s what I learned building patient-one: you can’t validate a complex system all at once. You need progressive complexity — each layer building on the previous, each test confirming assumptions before adding more.</p><p><strong>Test 1: Clinical Foundation</strong></p><p>Start with what you know. Query patient demographics, family history, BRCA1 status. Pull lab results and analyze the CA-125 tumor marker trajectory.</p><p>Sarah’s CA-125 tells the story: 1456 U/mL at diagnosis → 22 U/mL after platinum therapy (great response!) → 389 U/mL six months later (resistance). This is the classic platinum-resistant pattern that oncologists dread.</p><p>Parse the somatic variants: TP53 R175H (hotspot mutation), PIK3CA E545K (activating), PTEN loss of heterozygosity. Compare to TCGA-OV and confirm molecular subtype C1 (immunoreactive).</p><p><em>Servers used: mockepic, fgbio, tcga</em></p><p><strong>Test 2: Multi-Omics Integration</strong></p><p>Now layer in the omics data. RNA expression, proteomics, phospho-proteomics — three views of the same biology.</p><p>Run HAllA to find associations across modalities. Apply Stouffer’s method to combine statistical significance. The PI3K/AKT/mTOR pathway lights up across all three — consistent with the PIK3CA mutation we found in Test 1.</p><p><em>Servers used: multiomics, tcga</em></p><p><strong>Test 3: Spatial Context</strong></p><p>Expression data tells you <em>what</em>. Spatial data tells you <em>where</em>.</p><p>Process the 10x Visium data with quality filtering. Calculate Moran’s I for spatial autocorrelation — are the marker genes clustering spatially or distributed randomly?</p><p>EPCAM (epithelial marker): Moran’s I = 0.72. Strong spatial clustering. The tumor cells are spatially organized, not scattered.</p><p>CD3D (immune marker): Moran’s I = 0.45. Moderate clustering. Immune infiltration is present but not uniformly distributed.</p><p>This spatial heterogeneity matters for treatment planning. Some tumor regions are immune-hot, others are immune-cold.</p><p><em>Servers used: spatialtools, fgbio</em></p><p><strong>Test 4: Imaging Validation</strong></p><p>The molecular data says there’s heterogeneity. Can we see it?</p><p>Fetch the H&amp;E and immunofluorescence images. Run DeepCell for deep learning cell segmentation. Classify phenotypes: epithelial, stromal, immune.</p><p>The segmentation confirms what the spatial transcriptomics suggested — distinct tumor compartments with variable immune infiltration. The imaging provides ground truth for the molecular predictions.</p><p><em>Servers used: openimagedata, deepcell</em></p><p><strong>Test 5: Synthesis</strong></p><p>This is where it gets interesting. No new data — just integration.</p><p>Rank resistance mechanisms by evidence strength across modalities. Generate treatment recommendations with evidence levels. Create a monitoring strategy based on the specific markers that tracked with progression.</p><p>The output isn’t just a data dump. It’s a clinically actionable synthesis.</p><p><em>Servers used: All of the above, orchestrated</em></p><h3>What the Architecture Actually Produces</h3><p>Here’s the thing about bioinformatics: the analysis is only useful if someone can act on it.</p><p>Patient-one generates outputs for three audiences:</p><p><strong>For Developers:</strong> Complete audit trail. Every MCP server call, every parameter, every intermediate result. Reproducibility is non-negotiable.</p><p><strong>For Care Teams:</strong> Clinical summary with ranked findings, treatment options with evidence levels, suggested monitoring markers. Written in clinical language, not bioinformatics jargon.</p><p><strong>For Patients:</strong> Plain-language explanation of what the tests found and what it means. No jargon. No p-values. Just “here’s what we learned about your cancer and what we can do about it.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2yKJj9KrR-vlQ5IcwY3mLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pefFGYXuPeprgR0dptc18A.png" /><figcaption>Partial output for patient information</figcaption></figure><p>Same underlying analysis. Different presentations for different needs. Claude handles the translation.</p><h3>The Path to Production</h3><p>Shown below is a simplified architecture on GCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5zMsR2SFbq2pb_eutWxKjA.png" /><figcaption>Integrating MCP Servers with GCP A2A Protocol</figcaption></figure><p>Patient-one is validation, not deployment. For this to work in a real hospital, several things need to happen:</p><p><strong>HIPAA Compliance:</strong> mockepic is a simulation. Real EHR integration requires FHIR-compliant connectors, proper authentication, audit logging that meets regulatory requirements.</p><p><strong>Infrastructure:</strong> The servers need to run somewhere. I’m working on a GCP deployment pattern using Cloud Run for the MCP servers and Vertex AI for the orchestration layer.</p><p><strong>Agent-to-Agent Communication:</strong> Google’s A2A framework provides enterprise-scale agent orchestration. The MCP servers become tools that A2A agents can coordinate. This separates the bioinformatics logic (MCP) from the enterprise orchestration (A2A).</p><p><strong>Validation:</strong> Patient-one is synthetic. Before clinical deployment, we need validation against real cohorts with known outcomes. Does the system’s subtyping match pathologist assessment? Do the predicted resistance mechanisms correlate with actual treatment response?</p><p>I’m currently scoping this with a collaborator at a major US research hospital. After we validate it, we’ll have a template for conversational bioinformatics in clinical settings.</p><h3>What I Got Wrong the First Time</h3><p>Building patient-one taught me things that eight servers in isolation couldn’t:</p><p><strong>Integration is harder than analysis.</strong> Each individual server works fine. Making them work <em>together</em> coherently — that’s where the complexity lives. The orchestration prompts matter as much as the tool implementations.</p><p><strong>Synthetic data is an art.</strong> Patient-one’s data had to be biologically plausible, clinically realistic, and internally consistent across modalities. The CA-125 trajectory had to match the treatment timeline. The spatial patterns had to align with the imaging. Creating good synthetic data took longer than building some of the servers.</p><p><strong>Output format is not an afterthought.</strong> I originally focused entirely on the analysis. But a 50-page technical report doesn’t help a patient understand their situation. Building the multi-audience output generation was a significant extension to the original architecture.</p><h3>Try It</h3><p>The patient-one code is in the <a href="https://github.com/lynnlangit/spatial-mcp">spatial-mcp repository</a> under architecture/patient-one.</p><p>You’ll find:</p><ul><li>Synthetic data files (clinical, genomic, multi-omics, spatial, imaging)</li><li>Test prompts for all five workflow stages</li><li>Expected outputs for validation</li><li>Documentation for the two new servers (multiomics, pubmed)</li></ul><p>If you’re working on something similar — multi-modal integration, clinical AI, conversational bioinformatics — I’d like to hear about it. The field moves faster when we share what works (and what doesn’t).</p><p><em>Lynn Langit is an independent cloud architect specializing in genomic pipelines and bioinformatics platforms. She’s an AWS Community Hero, Google Cloud Developer Expert, and Microsoft Regional Director currently exploring AI orchestration for precision oncology.</em></p><p><em>This is part 2 of a series. Part 1: </em><a href="https://medium.com/@lynnlangit/when-ai-meets-spatial-genomics-8899f883f3b2?sk=2ca68d923e878f64b84e9e8cc62c7722"><em>When AI Meets Spatial Genomics</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19b6af8fccf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-world AI for Cloud Architects]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://lynnlangit.medium.com/real-world-ai-for-cloud-architects-89045e0bba1e?source=rss-8945742012d2------2"><img src="https://cdn-images-1.medium.com/max/1194/1*6LiySoHgBglq9rO0RwXobA.png" width="1194"></a></p><p class="medium-feed-snippet">A look at what generative AI tools can actually do for your cloud practice&#x200A;&#x2014;&#x200A;and the critical things they can&#x2019;t</p><p class="medium-feed-link"><a href="https://lynnlangit.medium.com/real-world-ai-for-cloud-architects-89045e0bba1e?source=rss-8945742012d2------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://lynnlangit.medium.com/real-world-ai-for-cloud-architects-89045e0bba1e?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/89045e0bba1e</guid>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 20:06:43 GMT</pubDate>
            <atom:updated>2025-11-11T20:06:43.406Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[When AI Meets Spatial Genomics]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://lynnlangit.medium.com/when-ai-meets-spatial-genomics-8899f883f3b2?source=rss-8945742012d2------2"><img src="https://cdn-images-1.medium.com/max/1448/1*6_nauRphLbiE6xjQ7WiquA.png" width="1448"></a></p><p class="medium-feed-snippet">Building a Bioinformatics Pipeline with Model Context Protocol</p><p class="medium-feed-link"><a href="https://lynnlangit.medium.com/when-ai-meets-spatial-genomics-8899f883f3b2?source=rss-8945742012d2------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://lynnlangit.medium.com/when-ai-meets-spatial-genomics-8899f883f3b2?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8899f883f3b2</guid>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Sat, 25 Oct 2025 19:40:01 GMT</pubDate>
            <atom:updated>2025-12-26T17:31:11.701Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Java to Rust: IS GC the Enemy?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://lynnlangit.medium.com/java-to-rust-gc-is-the-enemy-6e4a8183e068?source=rss-8945742012d2------2"><img src="https://cdn-images-1.medium.com/max/2192/1*Qs4-3Lhy9pNC8gtejmxlWg.png" width="2192"></a></p><p class="medium-feed-snippet">Speeding up the Agrona library by porting it with Claude Code</p><p class="medium-feed-link"><a href="https://lynnlangit.medium.com/java-to-rust-gc-is-the-enemy-6e4a8183e068?source=rss-8945742012d2------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://lynnlangit.medium.com/java-to-rust-gc-is-the-enemy-6e4a8183e068?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e4a8183e068</guid>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 02:33:06 GMT</pubDate>
            <atom:updated>2025-09-14T18:49:02.489Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Bioinformatics Building Blocks]]></title>
            <link>https://lynnlangit.medium.com/bioinformatics-building-blocks-65fb62222759?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/65fb62222759</guid>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Mon, 21 Oct 2024 17:26:37 GMT</pubDate>
            <atom:updated>2024-10-23T22:55:04.676Z</atom:updated>
            <content:encoded><![CDATA[<h4>Lessons from a Docker Container Build</h4><p>by Lynn Langit and David Haley</p><h3>Why Build a Docker Container?</h3><p>The task: Collaborate with a bioinformatician to enable the ability for her to be able to run a custom Nextflow workflow that she authored to be runnable on the public cloud. Currently she runs her workflow on an internal HPC cluster using Slurm. Google Cloud Platform (GCP) is the target cloud environment in this scenario. Core cloud services are Cloud Storage and the Google Batch API. Reference Architecture shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Kf_YikHFOkln3Tqv" /><figcaption>GCP Architecture for running Nextflow on Google Batch</figcaption></figure><p>While it is possible to run ‘raw scripts’ on Google Batch, generally one or more task containers would be used in this scenario. So, we needed to build a custom task container to meet our bioinformatician’s requirements.</p><h3>What We Learned</h3><p>This post includes our learnings from the process of building a new Docker container image for the scenario described above (i.e. to run Nextflow pipeline on Google Batch on GCP). Several of the techniques we used are general best practices for building containers.</p><p><em>Tip: For the basic structure of a Dockerfile and commonly used docker commands, see the Appendix at the end of this post.</em></p><h4>Determine Build Approach</h4><p>To get started, we decided to build one monolithic container for all of the required language runtimes and libraries for the workflow. Although it is normally most optimal to build one or more Docker container images that are as small as possible, (i.e. one container per tool, language or library), we decided to build one big container as a starting point and due to our bioinformatician’s work deadlines.</p><h4>Review Requirements</h4><p>Our list of required language runtimes and libraries was long, but not unusually so for a bioinformatics workflow. The full source code for our <a href="https://github.com/dimi-lab/SpaFlow">spaFlow Nexflow workflow is available on GitHub</a>. The initial list of 27 requirements (which was based on running on HPC) is shown below:</p><ol><li><strong>Nextflow</strong> 23.04.2</li></ol><ul><li>requires: bash, java 11 [or later, up to 21] git and docker</li></ul><p>2. <strong>Python</strong> 3.8 + Python libraries</p><ul><li>scimap 1.3.2, anndata 0.7.8, pandas 1.5.3</li><li>scanpy 1.9.6 + pandoc 3.1.2</li></ul><p>3. <strong>R </strong>4.2.2 + R libraries</p><ul><li>knitr 1.44, ggplot2 3.4.4, data.table 1.14.8d, dplyr 1.1.3</li><li>Seurat &gt;5.0, progressr 0.14.0, kableExtra 1.3.4, ComplexHeatmap 2.15.4</li><li>ggridges 0.5.4, clustree 0.5.0, pheatmap 1.0.12, plyr 1.8.9, pander 0.6.5</li><li>CELESTA 0.0.0.9000 + Rmixmod 2.1.9, spdep 1.3–3, reshape2 1.4.4, zeallot 0.1.0</li></ul><h3>Run and Test Locally First</h3><p>To simplify and to speed up development iteration cycles, we built and ran the Nextflow workflow with our evolving custom Docker container running <strong>locally</strong> before we attempted to run our solution in the cloud.</p><p>Because we needed to build a large/complex container, we first started the container locally and attempted to run the workflow from <strong>within</strong> the running container to have visibility into the ‘guts’ of what is installed correctly as we were iteratively building. Example commands are shown below.</p><pre>#build and tag<br>docker build -f deployment/Dockerfile . -t spaflow:latest<br><br># run interactively<br>docker run -it spaflow:latest<br><br># from within the container<br>nextflow run main.nf</pre><p>We built our container image frequently as we added functionality to it. We also tested end-to-end by attempting to run the associated Nextflow workflow using the Nextflow local docker profile from the Nextflow workflow config file. We iterated and added additional required libraries on each workflow test run failure.</p><pre>nextflow run main.nf -c nextflow.config -profile docker</pre><p>Tip: We automated the deletion of intermediate files (from the Nextflow <em>`\work`</em> dir) to keep our workspace tidy during this build phase.</p><h3>Use Docker Build Caching</h3><p>We used Docker’s default build caching feature to significantly speed up test iterations. This builds the new container while reusing the previous container’s layers when possible. See <a href="https://docs.docker.com/build/cache/">Docker docs on caching</a>. This feature was particularly useful for our growing mono-container (eventually growing to 2000+ libraries!). It was important to order the build commands according to what was changing the most.</p><pre>docker build . -t &lt;image&gt;</pre><p>You can also instruct Docker to pull from a remote image, using — cache-from registry/image . We used this feature with Google Cloud Build, syntax is shown below.</p><pre>docker build -t &lt;image&gt; \<br> - cache-to type=local,dest=path/to/local/dir[,parameters…] \<br> - cache-from type=local,src=path/to/local/dir .</pre><h4>Phase 1: Pick the Best Fit Base Container</h4><p>To start, we located the smallest-sized language-appropriate base container image to test. We tried a number of different base container images to find the best fit between simplicity and usefulness. We eventually selected an R-language based container image due to the number of R libraries required for this use case. Shown below are the top lines from our DOCKERFILE:</p><pre># Base image with Java, R, and Python<br>FROM rocker/r-ver:4.4.1</pre><h4>Phase 2: Building: Python First</h4><p>Because our custom container requirements included multiple languages, we decided to start by building for the Python requirements. We started here because there are more known Python container building patterns and we are more familiar with this language and libraries management processes than we are for R. We built modularly — i.e. base image, tools, first the language (Python) and then its associated required libraries (including required versions).</p><p>The Python build was made complicated only by the need to lock versions of Python and associated libraries. Shown below is that section of our DOCKERFILE:</p><pre># Add the deadsnakes PPA to get Python 3.8<br>RUN apt-get update &amp;&amp; apt-get install -y software-properties-common &amp;&amp; \<br>add-apt-repository ppa:deadsnakes/ppa &amp;&amp; \<br>apt-get update<br>RUN apt-get install -y \<br>apt-utils \<br>curl \<br>git \<br>libcurl4-openssl-dev \<br>libfontconfig1-dev \<br>libgdal-dev \<br>libhdf5-serial-dev \<br>libssl-dev \<br>libudunits2-dev \<br>libxml2-dev \<br>libxt-dev \<br>openjdk-17-jdk \<br>pandoc \<br>pkg-config \<br>python3.8 python3.8-dev python3.8-distutils python3-pip \<br>vim \<br>zlib1g-dev<br><br># Set system default python to 3.8 (10 == priority, not sure this matters much)<br>RUN update-alternatives - remove python /usr/bin/python2<br>RUN update-alternatives - install /usr/bin/python python /usr/bin/python3.8 10<br><br># Python Packages<br>RUN python -m pip install &#39;scimap==1.3.2&#39; &#39;anndata==0.7.8&#39; &#39;pandas==1.5.3&#39; &#39;scanpy==1.9.6&#39;</pre><h4>Phase 3: Continuing the Build: Nextflow</h4><p>Building the Nextflow requirement was simple, because we selected a base image that included the required version of Java for Nextflow. So we just had to make sure Nextflow itself was available in our container. Shown below is that line from our DOCKERFILE:</p><pre># Install Nextflow<br>RUN curl -s https://get.nextflow.io | bash &amp;&amp; mv nextflow /usr/local/bin</pre><h4>Phase 4: Continuing the Build: R Challenges!</h4><p>Building the R requirements proved considerably more daunting due to the number of libraries and interrelated dependencies. Also building on a Mac and then later attempting to build for a Linux (Cloud OS), resulted in some inconsistencies during R library installation. We discovered and used a powerful tool to ‘see into’ exactly what was being installed during the container build, the tool (R:env) and how we used it, is described in the next paragraphs.</p><p>We used the <a href="https://docs.posit.co/ide/user/ide/guide/environments/r/renv.html">R:env tools</a> to snapshot installed R library versions in our container when we built on various base OS’s. We followed the renv tools process as described below to find and fix discrepancies in R library dependency versions.</p><p>From the renv documentation —<em> <br>“The general workflow when working with renv is:</em></p><ol><li><em>Call </em><a href="https://rstudio.github.io/renv/reference/init.html"><strong><em>renv::init()</em></strong></a><em> to initialize a new project-local environment with a private R library,</em></li><li><em>Work in the project as normal, installing and removing new R packages as they are needed in the project,</em></li><li><em>Call </em><a href="https://rstudio.github.io/renv/reference/snapshot.html"><strong><em>renv::snapshot()</em></strong></a><strong><em> </em></strong><em>to save the state of the project library to the </em><strong><em>lockfile</em></strong><em> (called</em><strong><em> renv.lock</em></strong><em>),</em></li><li><em>Continue working on the project, installing and updating R packages as needed.</em></li><li><em>Call </em><a href="https://rstudio.github.io/renv/reference/snapshot.html"><em>renv::snapshot()</em></a><em> again to save the state of the project library if the attempts to update R packages were successful, or call </em><a href="https://rstudio.github.io/renv/reference/restore.html"><strong><em>renv::restore()</em></strong></a><em> to revert to the previous state as encoded in the lockfile if the attempts to update packages introduced some new problems.”</em></li></ol><p>Using this tool we were able to build a functional container for the workflow. However, as the DOCKERFILE code below shows, our implementation was in no way elegant. Refactoring this section of the DOCKERFILE to fix and remove redundant library installs is high on our ‘next steps’ to improve this container.</p><pre># Install R packages (ensuring dependencies are handled)<br>RUN R - quiet -e &quot;install.packages(c(&#39;knitr&#39;, &#39;ggplot2&#39;, &#39;data.table&#39;, &#39;dplyr&#39;))&quot;<br><br># Notes on R dependencies:<br># If we remove the 1st Seurat install, the container fails.<br># If we remove the redundant installs for kableExtra, ComplexHeatmap, clustree, the container fails.<br># We aren&#39;t 100% sure why this is … but … this works, so we&#39;re keeping it.<br>RUN R - quiet -e &quot;install.packages(&#39;Matrix&#39;, repos = &#39;https://cloud.r-project.org&#39;, version=&#39;&gt;= 1.6–4&#39;)&quot;<br>RUN R - quiet -e &quot;install.packages(&#39;Seurat&#39;, repos = &#39;https://cloud.r-project.org&#39;)&quot;<br>RUN R - quiet -e &quot;install.packages(c(&#39;progressr&#39;, &#39;kableExtra&#39;, &#39;ComplexHeatmap&#39;, &#39;ggridges&#39;, &#39;clustree&#39;, &#39;pheatmap&#39;, &#39;plyr&#39;))&quot;<br>RUN R - quiet -e &quot;install.packages(c(&#39;pander&#39;, &#39;CELESTA&#39;, &#39;Rmixmod&#39;))&quot;<br>RUN R - quiet -e &quot;install.packages(c(&#39;spdep&#39;, &#39;reshape2&#39;, &#39;zeallot&#39;))&quot;<br>RUN R - quiet -e &quot;install.packages(c(&#39;leiden&#39;, &#39;reticulate&#39;, &#39;SeuratObject&#39;))&quot;<br>RUN R - quiet -e &quot;install.packages(c(&#39;systemfonts&#39;, &#39;ggforce&#39;, &#39;ggraph&#39;))&quot;<br>RUN R - quiet -e &quot;install.packages(c(&#39;png&#39;))&quot;<br>RUN R - quiet -e &quot;install.packages(&#39;Seurat&#39;)&quot;<br>RUN R - quiet -e &quot;install.packages(&#39;BiocManager&#39;)&quot;<br>RUN R - quiet -e &quot;BiocManager::install(&#39;ComplexHeatmap&#39;)&quot;<br>RUN R - quiet -e &quot;install.packages(&#39;clustree&#39;)&quot;<br>RUN R - quiet -e &quot;install.packages(&#39;kableExtra&#39;)&quot;<br>RUN R - quiet -e &quot;install.packages(&#39;Matrix&#39;)&quot;<br>RUN R - quiet -e &quot;install.packages(&#39;remotes&#39;)&quot;<br>RUN R - quiet -e &quot;remotes::install_github(&#39;plevritis-lab/CELESTA&#39;)&quot;</pre><h3>Finishing Up</h3><p>To complete the custom container, we added lines to the DOCKERFILE which run a general cleanup to reduce the container image size, to set the application working directory and to copy the application files into our container. We also copied in a generic Nextflow config file and a sample input data file for ease of testing.</p><pre># Cleanup to reduce image size<br>RUN apt-get clean &amp;&amp; rm -rf /var/lib/apt/lists/*<br><br># Set working directory<br>WORKDIR /app<br>COPY data/ /app/data<br>COPY modules/ /app/modules<br>COPY scripts/ /app/scripts<br>COPY main.nf /app/main.nf<br>COPY nextflow.config /app/nextflow.config<br>COPY celesta_prior_matrix.csv /app/celesta_prior_matrix.csv</pre><h3>What We Learned and Next Steps</h3><p>This container was daunting to build, due to the complexity and number of dependencies.</p><blockquote>We spent <strong>over 40 work hours</strong> to design, build and test to produce a working 75-line DOCKERFILE.</blockquote><p>While the initial list of requirements was already long with 27 items, the final container included over 2,000 libraries due to dependencies! Our <a href="https://github.com/dimi-lab/SpaFlow/blob/main/deployment/Dockerfile">final DOCKERFILE for spaFlow</a> is on Github.</p><p>To understand what changes we made to the spaFlow Nextflow configuration settings and files to be able to run on Google Batch, see the <a href="https://seqera.io/blog/nextflow-from-hpc-to-cloud">associated article on the Nextflow blog</a> which explains how we ran our custom container on GCP.</p><p>As mentioned, the R section is our top candidate for refactoring, so we’ll work on improving that in the next iteration. Then we may also attempt to create two containers — one for the Python + libraries and another one for the R + libraries. As mentioned previously, container modularity was not a focus at this time in our build cycle due to project deadlines.</p><p>Additionally, during the build process we reduced scanned security vulnerabilities from 1308 to 514 (mostly by thoughtfully selecting our base container). We will next be addressing (and fixing) vulnerabilities identified by our container scanning tool as ‘critical’ by updating library (or dependent library) versions and iterating through our test cycle to ensure our container still functions properly. We used Google Cloud Artifact Registry scanning to identify vulnerabilities (screenshot shown below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VSpiQkZMFnQh7YYK" /><figcaption>GCP Artifact Registry Container Security Vulnerability Scan Results</figcaption></figure><h4>Appendix: DOCKERFILE Commands</h4><p>Quick guide to key docker terminologies.</p><h4><strong>Base DOCKERFILE Instructions:</strong></h4><p>Listed below are common DOCKERFILE commands used during the container building lifecycle.</p><pre>FROM: Specifies the base image to start from.<br><br>RUN: Executes commands within the image during the build process.<br><br>COPY: Copies files/directories from your host machine to the image.<br><br>ADD: Similar to COPY, but can also handle archives and URLs.<br><br>WORKDIR: Sets the working directory for subsequent instructions.<br><br>ENV: Sets environment variables within the image.<br><br>EXPOSE: Exposes ports for the application running in the container.<br><br>CMD: Specifies the default command to run when the container starts.</pre><h4><strong>Core Docker Commands:</strong></h4><p>Listed below are common docker commands used during the container building lifecycle.</p><pre># docker tag (tags an image) <br>docker tag my-custom-image my-registry/my-custom-image:latestdocker build (builds an image) - docker build -t my-custom-image .<br><br># docker images (lists images)<br>docker images<br><br># docker run (runs a container) <br>docker run -it my-custom-image bash<br><br># docker exec (executes a command in a container) <br>docker exec -it my-container-name ls -l<br><br># docker ps (lists running containers) <br>docker ps or docker ps -a (all containers)<br><br># docker stop (stops a container) <br>docker stop my-container-name<br><br># docker rm (removes a container) <br>docker rm my-container-name<br><br># docker push (pushes an image to a registry) <br>docker push my-registry/my-custom-image:latest<br><br># docker history (shows history) <br>docker history my-custom-image</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65fb62222759" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-World Nextflow on GCP]]></title>
            <link>https://lynnlangit.medium.com/real-world-nextflow-on-gcp-c27c87e100d6?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c27c87e100d6</guid>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[batch]]></category>
            <category><![CDATA[nextflow]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Thu, 04 Jul 2024 19:02:22 GMT</pubDate>
            <atom:updated>2024-07-04T19:02:22.023Z</atom:updated>
            <content:encoded><![CDATA[<p>Adding to the QuickStart for Google Batch</p><p>One of my bioinformatics clients needs me to help her migrate her HPC-based custom Nextflow workflow to Google Cloud. To be able to guide her, I started by running the GCP Nextflow on Google Batch <a href="https://cloud.google.com/batch/docs/nextflow">quickstart</a>. Google’s example <em>“runs a sample </em><a href="https://github.com/nextflow-io/rnaseq-nf"><em>bioinformatics pipeline</em></a><em> that quantifies genomic features from short read data using </em><a href="https://en.wikipedia.org/wiki/RNA-Seq"><em>RNA-Seq</em></a><em>.”</em></p><p>While I was able to successfully run the sample as written, using <a href="https://cloud.google.com/shell/docs/using-cloud-shell">Google cloud shell</a> as my client, I found myself wanting to test out more available Google Batch features that I believe will provide value for my Nextflow production situation. Also I drew a diagram (shown below) of my understanding of what I was testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jPIsDYgXRjy6-4BU-cxbjg.png" /><figcaption>Testing Nextflow on Google Cloud Batch</figcaption></figure><p>Conveniently, Google cloud shell includes the Google Cloud SDK, docker binaries and the JVM (Java) runtime which are all required to run this test, so I installed nothing other than Nextflow in cloud shell.</p><p>I successfully ran the basic sample using the supplied profile parameter using this command in cloud shell: <br>../nextflow run nextflow-io/rnaseq-nf -profile gcb</p><h4>More Configs</h4><p>The example uses a profile configuration for Google Cloud Batch (aliased as gcb) in a stanza in the Nextflow-required nextflow.config file as shown below.</p><pre>gcb {<br>  params.transcriptome = &#39;gs://rnaseq-nf/data/ggal/transcript.fa&#39;<br>  params.reads = &#39;gs://rnaseq-nf/data/ggal/gut_{1,2}.fq&#39;<br>  params.multiqc = &#39;gs://rnaseq-nf/multiqc&#39;<br>  process.executor = &#39;google-batch&#39;<br>  process.container = &#39;quay.io/nextflow/rnaseq-nf:v1.1&#39;<br>  workDir = &#39;gs://BUCKET_NAME/WORK_DIRECTORY&#39;<br>  google.region  = &#39;us-central1&#39;<br>}<br>...</pre><p>I created a list of Google Batch parameters that I commonly used with <em>‘raw Batch’</em> (i.e. not using Nextflow) bioinformatics workloads and wondered which of these parameters would be supported by Nextflow for Google Batch. Here’s my initial shortlist:</p><ul><li>Set <strong>`Project Name`</strong> (obvious, but curiously not listed in the sample)</li><li>Use GCE <strong>`SPOT`</strong> VM instances for worker nodes (<a href="https://cloud.google.com/compute/docs/instances/spot">Up to 90% cheaper</a> than on-demand instances, so key for this scenario!)</li><li>Configure <strong>`maxRetries`</strong> for tasks using SPOT instances (to retry rather than fail the task/job if a worker VM node is preempted)</li><li>Upload the reference container my <strong>Artifact Registry</strong> and use (see detail in the last section). To start I just used the public container for rnaseq hosted in quay.io .</li></ul><p>Shown below is my updated nextflow.config profile stanza. My test job runs ok, EXCEPT if a worker node gets preempted. Initially, I didn’t set maxRetries and I had a task and job failure on node preemption.</p><pre>gcb {<br>      params.transcriptome = &#39;gs://rnaseq-nf/data/ggal/transcript.fa&#39;<br>      params.reads = &#39;gs://rnaseq-nf/data/ggal/gut_{1,2}.fq&#39;<br>      params.multiqc = &#39;gs://rnaseq-nf/multiqc&#39;<br>      process.executor = &#39;google-batch&#39;<br>      process.container = &#39;&lt;MY_ARTIFACT_REGISTRY&gt;/images/rnaseq:1.0&#39;<br>      process.label = &#39;rnalangit&#39;<br>      process.maxRetries = 3 <br>      workDir = &#39;gs://batch-demo-data-compute/nf-rnaseq-spot-results&#39; <br>      google.region  = &#39;us-central1&#39;<br>      google.project = &#39;&lt;MY_PROJECT_NAME&gt;&#39;<br>      google.batch.spot = true<br>  }</pre><h4>Nodes Matter</h4><p>I was happy to see that (shown below) my test job used are the GCE (Compute Engine) VM worker <strong>SPOT</strong> nodes. Of note is that the machine family isn’t configured and the selected type is g1-small .</p><p>In my experience, paying attention to workload requirements and manually configuring the <a href="https://cloud.google.com/compute/docs/machine-resource#recommendations_for_machine_types">best-fit machine family</a> (and type) yields best value results in scaling bioinformatics analysis jobs.</p><ul><li>If the nodes are <strong>too small</strong>, the tasks take too long and have a greater likelihood of getting preempted, which makes tasks take even longer</li><li>If the nodes are <strong>too big</strong>, there are fewer available (and in the SPOT pool), so task startup can take longer. Also if nodes are under-utilized, then you are literally overpaying for compute resources.</li><li>If the nodes are <strong>too obscure</strong>, there are fewer available (and in the SPOT pool), so task startup can take longer. Also if nodes are under-utilized, then you are literally overpaying for compute resources.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHiUYP_c_U9cw_a1ZTiQ3g.png" /><figcaption>Using GCE SPOT (preemptible) VMs for the NF-on-Batch test</figcaption></figure><h4>Reading the Docs</h4><p>Next I read the Nextflow on Google Batch documentation, which includes more extensive information about support for Google Batch parameters.</p><p><em>“The integration with Google Batch is a developer preview feature. Currently, the following Nextflow </em><a href="https://www.nextflow.io/docs/latest/google.html#supported-directives"><em>directives are supported</em></a><em>:”</em></p><ul><li><a href="https://www.nextflow.io/docs/latest/process.html#process-accelerator">accelerator</a></li><li><a href="https://www.nextflow.io/docs/latest/process.html#process-container">container</a></li><li><a href="https://www.nextflow.io/docs/latest/process.html#process-containeroptions">containerOptions</a></li><li><a href="https://www.nextflow.io/docs/latest/process.html#process-cpus">cpus</a></li><li><a href="https://www.nextflow.io/docs/latest/process.html#process-disk">disk</a></li><li><a href="https://www.nextflow.io/docs/latest/process.html#process-executor">executor</a></li><li><a href="https://www.nextflow.io/docs/latest/process.html#process-machinetype">machineType</a></li><li><a href="https://www.nextflow.io/docs/latest/process.html#process-memory">memory</a></li><li><a href="https://www.nextflow.io/docs/latest/process.html#process-time">time</a></li></ul><h4>Next Steps</h4><p>What I want/need to do next is to update my nextflow.config file to use the Google Batch features that my client needs for her workload. These include the following:</p><ul><li>Configure <strong>retry behavior</strong> if worker node SPOT is preempted</li><li>Configure <strong>machine type families</strong> or instance template including GPU families</li><li>Test <strong>task-level configuration </strong>syntax (CPU, RAM…)</li><li>Configure <strong>OS disk and working disks </strong>— types and sizes</li></ul><p>Figuring out valid configuration files, is, however, only part of the work involved in guiding my research colleague to migrating her NF-based workload from HPC to Google Batch. In the next section, I highlight top enterprise considerations that will also apply here.</p><h4>Enterprise Considerations</h4><p>In production, I’ll need to configure NF-on-Batch to use a named <strong>GCP IAM service account</strong> (rather than the default compute engine service account) and also verify associated role-based IAM permissions.</p><p>From Google’s docs…</p><p><em>“To get the permissions that you need to complete this tutorial, ask your administrator to grant you the following IAM roles:</em></p><ul><li><a href="https://cloud.google.com/iam/docs/understanding-roles#batch.jobsEditor"><em>Batch Job Editor </em></a><em>(</em><em>roles/batch.jobsEditor) on the project</em></li><li><a href="https://cloud.google.com/iam/docs/understanding-roles#iam.serviceAccountUser"><em>Service Account User </em></a><em>(</em><em>roles/iam.serviceAccountUser) on the job&#39;s service account, which for this tutorial is the </em><a href="https://cloud.google.com/batch/docs/compute/docs/access/service-accounts#default_service_account"><em>Compute Engine default service account</em></a></li><li><a href="https://cloud.google.com/iam/docs/understanding-roles#storage.objectAdmin"><em>Storage Object Admin </em></a><em>(</em><em>roles/storage.objectAdmin) on the project”</em></li></ul><p>I’ll also need to set allowExternalIP to false for the worker nodes. And I’ll need to specify a <strong>named GCP project network and subnet</strong>, rather than using the default values for testing.</p><p>I tested using the public docker rnaseq container image (hosted in quay.io), referenced in the sample. I also pulled, tagged and pushed a version of this container to my GCP Artifact Registry. As is is typical with open source containers, the container I found, included a number of critical security vulnerabilities. So, I’ll need to build a process to <strong>scan and remediate open source tool containers</strong> for my client. Shown below are my GCP Artifact Registry scanning results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RjQ1l3b0kg4ghA155wePYQ.png" /><figcaption>Scanning a demo rnaseq container in my GCP Artifact Registry reveals a number of serious security vulnerabilities</figcaption></figure><p>Finally, I’ll want to verify that the <a href="https://cloud.google.com/docs/quotas/overview">GCP service quotas</a> are adequate for my client to be able to scale her workload to meet her analysis needs. I’ve noticed that workloads that need <strong>GPUs</strong> need real-world scale testing and quota increases most often.</p><p>So, I will work next to translate the NF docs into a <strong>more extensive working sample</strong>. I will publish/update this work on my <a href="https://github.com/lynnlangit/gcp-for-bioinformatics/tree/master/2_Virtual_Machines_%26_Docker_Containers/Workflow_Script_Examples/Nextflow-NF">GitHub Repo</a> as an evolving sample set of configuration example files.</p><h4>Results</h4><p>In case you are wondering the example rnaseq Nextflow-on-Batch example runs a multi-step workflow and produces several outputs, including a MultiQC html report. Sample shown below. I find it helpful to ‘begin with end in mind’ and I like to see what my bioinformatics colleagues want as output to the processes we build together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iw4NAEie82_1JpPDg_4KBg.png" /><figcaption>One (of many) output report from the example rnaseq test job run with Nextflow on Google Batch</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c27c87e100d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Reality]]></title>
            <link>https://lynnlangit.medium.com/ai-reality-c1335e677d31?source=rss-8945742012d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1335e677d31</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Lynn Langit]]></dc:creator>
            <pubDate>Sat, 22 Jun 2024 03:55:33 GMT</pubDate>
            <atom:updated>2024-06-22T03:56:25.079Z</atom:updated>
            <content:encoded><![CDATA[<h3>GenAI Reality</h3><p>The Good, The Bad and The Interesting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*ScF7f5BxGjOBNsmVvJ8bRw.png" /><figcaption>Real World vs AI World by Google Photos</figcaption></figure><p>My phone suggests sprinkling AI (magic?) in place of my photos. A typical result is shown above. While the generated image on the right is interesting, I still prefer the real thing. Yet, GenAI has some utility, so what is it good for <strong>right now</strong>?</p><h4>The Good: It Accelerates</h4><p>Not only does using some sort of GenAI tool daily accelerate my work, creativity and general thinking, but also improved AI literally accelerates me (well, my car anyway).</p><p>I recently got a new car and am re-learning how to drive with assistance of the included multi-camera AI system. My dashboard is shown below. Of note, is that the system ‘sees’ whether or not I am staying in my lane, if I stray, the system warns, i.e. <em>“put your hands on the wheel”</em>, so it’s <strong>not</strong> a self-driving capability — by design. I set the number of car lengths and the cameras control the car speed to keep me that defined distance from any car that the system “sees” in front of my car by slowing my car down to maintain the observed distance between cars.</p><p>I can adjust the top speed with a up/down button on the steering wheel if/when conditions or requirements warrant speed changes.</p><p>Also, moving the steering wheel is made slightly stiffer when I set the car in ‘active’ mode, as a haptic cue to me that I am driving in this camera-assisted mode.</p><p>To stop the active mode, I tap the brake or gas pedal -or- click the button on the steering wheel. The system provides automation with feedback and multiple methods of human intervention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qPjrIyp4-ZiFqNbHDM6mA.jpeg" /><figcaption>Active, camera-based, AI-style driving</figcaption></figure><p>Here’s a list of what I am doing daily with GenAI LLM tools:</p><ul><li>ChatGPT/Gemini: Validating technical approaches to cloud solutions by having contextual threaded ‘discussions’ with a virtual cloud architect colleague</li><li>GitHub CoPilot: Quickly creating starter code samples for POCs in a variety of application and infrastructure scripting languages</li><li>Gemini: Fixing code bugs faster than by Googling error messages and/or reading StackOverflow threads</li><li>DiagramsGPT: Generating starter diagrams, often flowcharts to clarify my thinking and/or create documentation of requirements or processes</li><li>DataAnalysisGPT: Quickly summarizing data from files such as CSV, JSON or VCF.</li><li>Gemini for BigQuery: Generating starter SQL code dataset queries from English prompts.</li><li>Subaru Active Mode: Driving safer.</li></ul><h4>The Bad: It Hallucinates</h4><p>Actually I find the endless discussions (whining) about the ‘hallucinations’ of various GenAI tools boring. Of course, GenAI LLMs make stuff up, why is this surprising? They are PREDICTIVE non-deterministic tools.</p><blockquote>In what world is a machine learning approach expected to be deterministic?</blockquote><p>I amuse myself by asking GenAI tools ridiculous questions and then considering how and why the answers were generated. I consider this playful <strong>experimentation </strong>to be<strong> </strong>part of acquiring an intuition for the capabilities of a particular GenAI tool. I am looking more to understand <strong>what it does do</strong> rather than what it can or cannot do.</p><p>LLMs are based on human language and I am a linguist by training. Learning the culture and vernacular of a GenAI tool feels like visiting a foreign country — try to chat up the locals to learn a bit about the place.</p><p>Just like there are many dialects in a language, i.e. German has high German, low German, Swiss German, etc…. LLMs have chat tools, APIs, ensemble tools, etc… so the same model can and will answer differently depending on from which tool or interface you are working with it.</p><p>Shown below is the response to my prompt <em>‘Who’s the baddest MOFO LLM and why?’</em> from ChatGPT 4o, Claude and the OpenGPT 4o LLMs. Based on the responses, which LLM is the <em>‘stick in the mud’</em>? Which one is the <em>‘know it all’?</em> Which one is the <em>‘entertainment expert’?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7SZ5i5BUGeUYnIdAK61P-g.png" /><figcaption>Pick your poison, GenAI in a non-deterministic world</figcaption></figure><h4>The Interesting: Real Productivity</h4><p>The most interesting (and useful) GenAI implementation I’ve been testing lately is the <a href="https://github.com/features/copilot">GitHub Copilot</a> Workspace set of integrated GenAI capabilities.</p><p>To understand why it’s great, I’ll shown a simple example of Copilot Workspace in action. Navigate to a repo, click ‘&lt; &gt; Code’ and then fill in a task in the ‘Copilot’ pop up window. When you start with your task, GitHub Copilot captures the context — by analyzing the data in the associated Repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-O8phbSOSuK9mKCdzpjj4g.png" /><figcaption>Start with a prompt — context is provided.</figcaption></figure><p>Next feedback is provided on what the LLM ‘sees’ as context. This is shown in the form of a human-readable generated Specification. The Spec include relevent (‘noticed’) current information and also proposed updates. Items can be manually added if important context was missed in the LLM-based analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ADJlmI88UtVYaSvhspw1Q.png" /><figcaption>See the noticed context, review and add more if needed.</figcaption></figure><p>Then a proposed plan is generated, again with the ability to add more context, in case the LLM missed something important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AQo8TT1KY8Rib4XKY1sJ-A.png" /><figcaption>The generated Plan is shown and can be augmented manually if needed</figcaption></figure><p>After that the changes are implemented by generating code. File diffs are automatically opened for review. You are provided with several options to integrate the proposed changes. The default is to ‘create a pull request’. However other options are available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2dM4juYceJX4FvTbwT-sjQ.png" /><figcaption>Review the generated changes and choose how to integrate</figcaption></figure><p>After you select your integration method, (I selected ‘Push to current branch’), then the LLM generates a commit message and extended description for your review.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQhObmI-eyuMthLZIBb2SQ.png" /><figcaption>Commit messages, descriptions are automatically generated for review.</figcaption></figure><p>The reason I showed this longer example is to illustrate what I have found to be a state-of-the-art implementation of tuned LLMs as part of a application. The customization of prompts, output and general excellence of the UI is key to usability AND human review and feedback at multiple points in the workflow.</p><p>At each step model output is provided in an expected format — human review is made <strong>easy to implement</strong>.</p><h4>The Takeaway: Human in the Loop</h4><p>As fully AI-managed self-driving cars are currently <a href="https://www.nstlaw.com/autonomous-vehicle-statistics/">dangerous</a>, relying on generated information from <strong>unreviewed</strong> LLMs for medical advice, doing math or anything else that is mission critical is silly at best and <a href="https://www.oliverwymanforum.com/global-consumer-sentiment/how-will-ai-affect-global-economics/risk.html">potentially dangerous in a number of ways</a>.</p><p>However…</p><blockquote>Applications that facilitate natural human-in-the-loop review at multiple phases of the generated information (whether camera-assisted active driving or coding CoPilots) are remarkably safe and useful.</blockquote><p>Auto insurance companies don’t discount rate without very good data; Github CoPilot <a href="https://aibusiness.com/companies/one-year-on-github-copilot-adoption-soars">adoption velocity</a> tells the real story too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1335e677d31" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>