<?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 Plawan Rath on Medium]]></title>
        <description><![CDATA[Stories by Plawan Rath on Medium]]></description>
        <link>https://medium.com/@plawanrath?source=rss-1ab97931ed01------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AeOItipnz26ucJNtzu0Pqg.jpeg</url>
            <title>Stories by Plawan Rath on Medium</title>
            <link>https://medium.com/@plawanrath?source=rss-1ab97931ed01------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 14:41:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@plawanrath/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[Case Study: Building a Multi-Agent Research Assistant with A2A Protocol]]></title>
            <link>https://medium.com/@plawanrath/case-study-building-a-multi-agent-research-assistant-with-a2a-protocol-0df1d6eb71c3?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/0df1d6eb71c3</guid>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[agentic-workflow]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Mon, 19 May 2025 01:55:23 GMT</pubDate>
            <atom:updated>2025-05-20T15:55:14.812Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1j6G_cbwo5kukruNtfeuQ.png" /></figure><h3>Introduction</h3><p>The Agent-to-Agent (A2A) Protocol is an open standard designed to enable autonomous AI agents to communicate, collaborate, and coordinate across different systems. It was introduced by Google DeepMind in early 2024 to support scalable, multi-agent ecosystems. A2A uses a structured message format that allows agents to negotiate tasks, share tools, and delegate responsibilities securely and efficiently. By promoting interoperability, it lays the groundwork for complex, modular AI workflows across diverse platforms.</p><p>To ground these concepts, let’s walk through how I built a <strong>multi-agent research assistant</strong> — essentially an AI system that autonomously fetches the latest research papers on a topic, summarizes and analyzes them, and presents results to the user. This project serves as a <strong>proof-of-concept</strong> for an A2A-style architecture. In this article I’ll focus on the high-level design and how the agents interact, rather than the low-level code (<em>all implementation details are available in the linked repo at the end</em>).</p><p>If you want to take a deeper dive into A2A altegother <a href="https://medium.com/@plawanrath/a-look-at-googles-agent-to-agent-a2a-protocol-for-multi-agent-ai-systems-2e876a14604b">here</a> is an article I wrote talking about A2A more broadly.</p><h3>Overview of the Application</h3><p><strong>Goal:</strong> The research assistant automates an academic literature review for a given topic. A user provides a topic (e.g. “AI safety” or “quantum computing”) and some parameters like a date range. The system will then:</p><ol><li><strong>Fetch</strong> recent papers related to that topic.</li><li><strong>Summarize</strong> each paper (producing a concise abstract).</li><li><strong>Critique/Score</strong> each paper on certain dimensions (novelty, relevance, etc.).</li><li><strong>Analyze Trends</strong> across the papers (find emerging topics).</li><li><strong>Plan a Reading List</strong> of the top papers and generate a summary report for the user.</li></ol><p>This pipeline naturally breaks down into different tasks — perfect for different agents to handle. I implemented the following agents (each as an independent component of the system):</p><ul><li><strong>Fetcher Agent:</strong> Searches external resources for new papers on the topic (in my example I query the arXiv API and Semantic Scholar API). It compiles a list of papers (title, authors, publication date, a PDF URL, and an ID like DOI or arXiv ID) and filters out any that were already seen in previous runs. The Fetcher then returns this list of paper metadata as its output, and also stores the metadata in a local database for persistence. This agent essentially acts as a bridge to external data sources — a good example of one agent using tools (HTTP APIs) and then passing the result to others.</li><li><strong>Summarizer Agent:</strong> This agent takes each paper’s PDF (using the URL from the Fetcher) and produces a <strong>5-line summary abstract</strong> of the paper and <strong>future improvement ideas</strong>. This is a heavy-lifting agent because it may need to download and read PDFs that are dozens of pages long. I built in a lot of <strong>robustness</strong> here. The Summarizer attempts to download the PDF and extract text; if the PDF is too large, it splits the text into chunks and uses an iterative summarization approach to condense it gradually. This handles the token overflow problem by chunking and “recursively summarizing” until the content fits within a prompt window. If the PDF download or parsing fails (which happens e.g. due to format issues or network errors), the Summarizer falls back to alternative strategies: it will try to fetch an official abstract from an API (arXiv or Semantic Scholar) <strong>in parallel</strong> with asking an LLM to generate a summary from just the title. Whichever returns first (the abstract or the LLM’s guess) is used as surrogate content, which it then summarizes with the same method. This ensures we <strong>don’t get stuck</strong> on a single paper — every paper yields at least some summary unless all methods fail. Additionally, the Summarizer agent asks the LLM to suggest <strong>3–5 “future improvement ideas”</strong> or research directions based on the paper’s content. These ideas (possible follow-up work or unresolved questions from the paper) are saved to the database for later use, but are not part of the main output passed to the next agent (they’re more like a side artifact we wanted to capture for the user’s benefit).</li><li><strong>Critic Agent:</strong> Reviews each paper’s summary and gives it three scores — for <strong>novelty</strong>, <strong>methodological soundness</strong>, and <strong>relevance</strong> to the chosen topic — each on a 0–10 scale, along with a short textual critique. The Critic essentially plays the role of a peer reviewer. Under the hood, it prompts an LLM with a fixed instruction to rate the summary on those criteria and output a JSON with the scores and a critique sentence. The agent then parses that JSON and attaches the scores and critique to each paper’s record. It also updates the database so that the paper entry now contains these scores and critique for persistence. The Critic agent thus transforms a list of paper summaries into a list of <strong>scored</strong> papers. Separating this from summarization, follows single-responsibility: if I want to change how scoring is done or add a new metric, I can just modify this agent independently.</li><li><strong>Trend Analyzer Agent:</strong> Looks at the collection of papers (particularly their summaries and publication dates) and identifies emerging trends or clusters of research. This agent operates on the whole set rather than individual papers. It works by embedding each paper’s summary into a vector (using an embedding model) and clustering the vectors to find groups of related papers. Then, for each cluster, it computes if that topic is “trending” by comparing how many papers in that cluster appeared in the last week versus the previous week. It labels each cluster with some representative keywords (using a TF-IDF on the summaries) for interpretability. Finally, it picks the top 5 clusters with the greatest growth and saves these as “trends” in the database. For example, it might output that <em>“Graph Neural Networks”</em> is a cluster with 3 papers this week vs 1 last week (growth +200%), whereas other topics are stagnant. The Trend agent’s output isn’t directly needed by the next agent in the pipeline (I treat it as a side-effect that populates a trends table). In A2A terms, it’s like a remote agent that mostly does internal work and logs an artifact for the user, without returning a structured result to the caller (aside from a success flag). I still included it in the workflow so that by the end, trend data is ready for presentation.</li><li><strong>Planner Agent:</strong> This is the final agent that takes the scored papers and produces a <strong>Reading Plan</strong> for the user. It selects the top few papers to prioritize and generates a nicely formatted summary of them. The Planner in this system implements a simple strategy: it computes an overall score for each paper and picks the top 5 papers from the last ~2 weeks. It then prompts an LLM to write a short introduction and an ordered list of those top papers as a suggested “reading queue”. Essentially, it asks the LLM to take the list of best papers (with their titles) and make a friendly recommendation blurb (e.g. “<strong>1. Paper Title</strong> — this paper explores XYZ…”). The output of Planner is a final <strong>plan text</strong> — a few paragraphs and bullet points of recommendations. The agent saves this plan to a database table and doesn’t pass anything downstream (since it’s the last step). In an A2A context, you can think of the Planner as producing the ultimate artifact that the user cares about.</li></ul><p>All these agents run sequentially to complete one full pipeline. I orchestrated them using a lightweight framework (LangChain’s LangGraph library) that lets you define a directed acyclic graph of tasks. The flow was: <strong>Fetcher → Summarizer → Critic → Trend → Planner</strong>, where each takes the previous output (or shared state) and I defined edges accordingly. This could have been done with explicit A2A HTTP calls between independent services, but for simplicity I ran them in-process and in sequence (passing Python data structures). However, the design mirrors A2A: each agent class had a uniform run(input, state) -&gt; (output, state) interface, akin to handling a task message and returning an artifact. This made it conceptually easy to swap implementations or even imagine each agent as a microservice.</p><h3>Handling Long Tasks and Asynchronous Execution</h3><p>One of the challenges was that the entire pipeline can take quite a while — especially if it fetches, say, 20 papers and has to summarize all of them (each requiring multiple LLM calls). Running this synchronously on a web request would be impractical (it could take minutes). This is where we applied A2A’s principle of <strong>supporting long-running tasks</strong> by integrating a background task queue.</p><p>I used <strong>Celery</strong> (a distributed task queue) to run the multi-agent pipeline in a worker process, separate from the user-facing interface. In practice, when a user kicks off a job (through the UI or API), the system enqueues a Celery task that will execute the Fetcher→…→Planner sequence in the background. This decoupling has several benefits aligned with A2A philosophy:</p><ul><li>The user (or the client agent, in A2A terms) doesn’t have to hang waiting for the result. Instead, it can poll for status or be notified when done. I implemented a polling mechanism (the UI checks the job status every few seconds) similar to how one might use A2A’s polling or push notification approach to handle a long task asynchronously.</li><li>I can scale the worker horizontally. If multiple users start research jobs, Celery can handle them concurrently on multiple workers. Each worker still goes through the agent pipeline sequentially for a job, but different jobs don’t block each other. This mirrors an A2A scenario where multiple instances of an agent could handle tasks in parallel.</li><li>If the process crashes or needs to be retried, Celery can restart the task or mark it failed without breaking the frontend. I also implemented checkpointing in a sense — after each agent, results were written to the database. So even if something went wrong mid-pipeline, partial data (e.g., fetched papers) was not lost. This is analogous to an agent sending interim progress messages or artifacts in A2A.</li></ul><p>A2A’s spec outlines that long tasks can be handled via status updates and final artifact delivery. In my case, the Celery worker writes <strong>log entries</strong> to a database table for each significant event (e.g., “Fetcher found 18 papers”, “Summarizer completed 17/18 papers, 1 skipped”) and marks the job as finished when done. The client side polls these logs to show a live progress feed to the user. This pattern is very much in the spirit of A2A (though we rolled our own solution): it provides real-time feedback during a lengthy operation, keeping the user informed.</p><h3>State Persistence and Data Sharing</h3><p>I chose to use a simple SQLite database as a shared state store for the agents. Each agent, as noted, writes its outputs to the DB: the Fetcher adds new records to a papers table, the Summarizer updates those records with summaries (and creates entries in a future_ideas table), the Critic updates scores in the papers table, Trend writes to a trends table, and Planner writes the final plan to a plans table. This persistent state serves multiple purposes:</p><ul><li><strong>Memory between agents:</strong> Because I didn’t implement in-memory agent-to-agent calls, the database ensured that even if the process was distributed, another agent could pick up the data. For example, the Critic doesn’t need to receive a Python list of papers from the Summarizer directly; it could query the papers table for all papers that have a summary but no scores yet. In this single-process pipeline I didn’t need to do that, but having the DB allowed flexibility (and indeed the Planner actually queries the DB for the top papers rather than relying on in-memory data passed, to ensure it has the latest scores).</li><li><strong>Result snapshots:</strong> After a job finishes, I create a snapshot of the key results (reading plan, all trends, all papers with summaries and scores, all future ideas) in a separate results table as one JSON bundle. This is purely to make it quick to fetch everything the frontend needs in one go. The snapshot approach is handy for <em>post-mortem analysis</em> too — one can inspect old results without rerunning the pipeline. This is analogous to the final artifact in an A2A task lifecycle — I bundle all artifacts into one package. I even include the agent logs in the job record. This proved invaluable for debugging and for allowing the UI to display past results without recomputation.</li><li><strong>Failure recovery:</strong> If something went wrong partway (say the LLM service was down during summarization), I could potentially restart the job and the Fetcher agent would know not to duplicate papers it already logged, etc., because the DB state is still there (I implemented an “idempotency” check so the fetcher skips papers already in the DB by ID). Having a persistent store means the agent system can be <strong>stateful</strong> across runs, which is important for continuous or iterative agents. (One could imagine an agent that continuously monitors new papers daily — it would rely on the stored state to know what’s new.)</li></ul><p>The trade-off is that using a database introduces coupling (all agents share the DB schema). In a pure A2A architecture, you might instead have the client agent pass all needed data through messages to the next agent. I chose a DB for practicality and transparency — it was easier to inspect data and ensured nothing gets lost if a service restarts. In an enterprise A2A deployment, one might do similar or use an event store for agent communication. The key is that <strong>state persistence improved reliability</strong>, at the cost of some additional complexity.</p><h3>Frontend Integration via <strong>Streamlit</strong></h3><p>I built a simple <strong>Streamlit web application</strong> as the user interface. An important design decision was to make the frontend communicate with the backend <strong>exclusively through REST API calls</strong>, never directly invoking the agents or database. This decoupling mirrors the idea that the UI (or a human user) could be considered another agent or client in the A2A ecosystem, interacting only via standardized interfaces.</p><p>The backend provides endpoints for: starting a new job, checking job status/logs, retrieving results, and clearing data. When the user enters a topic and hits “Run”, the Streamlit app does an HTTP POST to the backend’s /jobs endpoint with the parameters. The backend (a FastAPI app) then creates a job record and triggers the Celery task to run the pipeline. The response immediately returns a job ID (HTTP 202 Accepted) which the frontend uses to poll.</p><p>While the job is running, the frontend periodically GETs /jobs/&lt;id&gt; to fetch the latest status and logs. The backend API accumulates log lines from the database (or in-memory queue) and returns them as a text blob along with a status field (“queued”, “running”, “done”, or “failed”). The Streamlit app displays those logs in a text area so the user can see a live feed of what each agent is doing (e.g. “SummarizerAgent: processing paper 3/10…”). This is analogous to an A2A client using <strong>Server-Sent Events</strong> to get real-time updates — in our case we polled every few seconds which is simpler but conceptually similar.</p><p>Once the job status becomes “done”, the frontend makes a GET request to /jobs/&lt;id&gt;/result to fetch the final results package. The backend returns the JSON snapshot from the database (the reading plan, the trends list, papers list, etc.). The Streamlit app then renders these results for the user:</p><ul><li>It shows the <strong>Suggested Reading Queue</strong> (the plan) as a formatted markdown section.</li><li>It shows <strong>Trending Topics</strong> with an expander for each cluster, listing the papers in that cluster. The user can click to toggle details for each paper — thanks to the stored data, we can display the paper’s summary, critique scores, and even a direct PDF link. This interactivity is all using the data that the agents produced.</li><li>It shows <strong>Future Improvement Ideas</strong> for each paper in a separate section, grouped by paper, so the user can read the brainstormed research directions.</li><li>Finally, it lists all papers in a table for reference.</li></ul><p>All of these UI elements are constructed from the JSON result — no agent is called at view time. This means the frontend is entirely agnostic to how the data was produced; it only knows the schema of the result. I could even build a completely different UI (say a CLI tool or a chat interface) that hits the same endpoints and gets the same data. This <strong>separation of interface and implementation</strong> is a core benefit of the A2A style. The UI doesn’t need to embed an LLM or agent logic; it just requests a task (topic search) and later receives an artifact (the research summary package).</p><p>By interacting over REST, I also make it easier to later swap the Streamlit UI for something else, or let external applications call our research assistant as a service. In effect, I treated the whole pipeline as one composite agent that exposes a REST API (the client agent for the user), which internally coordinates with specialist agents (Fetcher, Summarizer, etc.). This is aligned with the A2A vision: you could expose an agent via an API and behind that single agent could be an army of sub-agents working together via A2A. The outside world doesn’t need to know the details.</p><h3>Lessons Learned and Future Improvements</h3><p>Building this multi-agent system taught me several lessons about applying A2A principles in practice:</p><ul><li><strong>Designing for Failure from the Start:</strong> In a multi-agent pipeline, you have to assume some part will eventually fail or produce unexpected output. I experienced failures like PDF downloads timing out, or the LLM returning too much text or malformed JSON. Our solution was to build fallback mechanisms at critical points (especially in the Summarizer). This significantly improved the robustness. The takeaway is: <strong>each agent should handle errors gracefully and communicate an actionable result whenever possible</strong>. If one agent can’t complete its task fully, maybe it returns a partial result or a flag that it skipped something, so the downstream agent or the orchestrator can decide what to do. A2A’s structured approach makes it easier to encode such flags (e.g., an agent could return an artifact with an “error” field). I used database entries and logs for this purpose. Future versions could make agents even more self-monitoring — e.g., the Critic could notice if a summary was missing and alert the orchestrator to re-run summarization for that paper.</li><li><strong>Iterating and Adding Capabilities:</strong> The modular setup made it relatively easy to extend the system. For instance, the <strong>“Future Improvements” ideas generation</strong> was not in our initial prototype. I added it after the main pipeline was working, as an extra feature to provide more value to the user. Because it was conceptually a separate concern (brainstorming ideas for each paper), I had a choice: implement it as another agent or integrate it into an existing agent’s workflow. I chose to integrate into the Summarizer agent (to avoid an extra full pass over all papers), but isolated the logic in separate helper functions. This addition did not require changing the Critic, Trend, or Planner agents at all — those didn’t even need to know it exists. This experience underscores how <strong>new capabilities can be slotted in without upheaval</strong>. In an A2A architecture, I could just as well spawn a new “IdeasAgent” that subscribes to an event when a summary is created and outputs to a future_ideas artifact. The difference is mostly implementation detail. The key point is that modular agents and a shared communication standard mean the system is extensible.</li><li><strong>Monitoring and Transparency:</strong> I found it extremely useful to log each agent’s actions and maintain results in a database for inspection. During development, this helped pinpoint where things went wrong (e.g., I could see that one paper’s summary was empty due to an edge-case in PDF parsing). For users, exposing the logs in real-time built trust — they could see exactly what the AI was doing (“why is it taking so long? oh, it’s summarizing a 30-page paper now.”). In a multi-agent world, <strong>transparency is vital</strong>; otherwise it can feel like a mysterious black box. I recommend designing your agents to produce meaningful logs or trace info and aggregating that for display. A2A doesn’t mandate how to do it, but the protocol’s philosophy of structured messages can be extended to structured logs or trace events.</li><li><strong>Balancing Granularity of Agents:</strong> One design decision was how big or small to make each agent’s scope. Too fine-grained (e.g., a separate agent for downloading PDFs, another for splitting text, another for summarizing) would introduce a lot of overhead. Too coarse (one agent does everything from fetch to plan) defeats the purpose. I think my breakdown was effective, but there’s room to experiment. For example, one could merge Critic and Planner into a single “Analyzer Agent” that both scores and picks top papers (since those tasks are related). I kept them separate to allow possibly swapping out the scoring mechanism independently. This is a general lesson: <strong>decide agent boundaries based on independent deployability and expertise</strong>. If two tasks always need the same context and are simpler together, they might be one agent. If a task might be reused in other workflows (like “Critique a paper” could be useful standalone), it should be its own agent. A2A gives you the freedom to refactor these boundaries as you learn more, much like one refactors microservices.</li><li><strong>Performance vs. Accuracy Trade-offs:</strong> In our pipeline, the slowest step was summarization (lots of LLM calls). I implemented parallelization for fallback (abstract vs LLM summary) using Python threads to save time, but we could do more — e.g., process multiple papers in parallel if we had the compute. An A2A architecture could naturally distribute such work: spawn multiple summarizer agents and assign papers to each. We didn’t go that far due to complexity, but it’s a next step. On accuracy, using GPT-4 for every step gave great results but is slow and costly; one could use smaller models or heuristics for some agents (e.g., a simpler model for initial filtering of papers). The A2A design lets you mix model sizes easily by agent. It also allows human-in-the-loop at agent boundaries: for instance, one could insert a human review after the Critic agent to validate scores. This wasn’t needed for our demo, but in a real use-case, the <strong>ability to inject human checks at defined points</strong> is a big advantage of a structured multi-agent pipeline.</li><li><strong>Ecosystem and Standards:</strong> I manually orchestrated and integrated these agents, but going forward I expect frameworks to emerge that natively support A2A protocols. For example, if LangChain or other libraries fully support A2A messaging, I could have registered each agent and let a central router handle the calls via HTTP. My implementation was partially manual due to tool limitations at the time. I anticipate that in the near future, setting up an A2A system will become easier as standards solidify. In the meantime, I validated that even DIY approaches can yield a working system that adheres to A2A principles.</li></ul><h3>Conclusion</h3><p>Google’s A2A protocol represents a significant step towards <strong>scalable, collaborative AI agents</strong>. By formalizing how agents communicate, A2A allows us to break complex problems into cooperating pieces — improving maintainability, testability, and reusability of AI components. In my multi-agent research assistant project, I saw these benefits firsthand: each agent had a clear role, which made the system easier to develop and extend, and the overall pipeline achieved something no single model could easily do alone.</p><p>Of course, designing multi-agent systems requires careful thought about architecture and infrastructure. There is added complexity in orchestrating asynchronous tasks, persisting state, and securing communications. However, the payoff is a more <strong>robust and modular system</strong> that can grow over time. Tasks that were once too big for one agent (or one prompt) become feasible when handled by an organized “team” of agents.</p><p>As A2A and similar standards gain adoption, I expect to see a flourishing ecosystem of specialized agents that can be composed like building blocks to create sophisticated AI-driven applications — from personal assistants that coordinate multiple services, to enterprise workflows that automate entire end-to-end processes. We’re essentially moving from single-agent intelligence toward <strong>multi-agent societies</strong> of AIs, each an expert in its niche, collectively more powerful than the sum of parts.</p><p>The journey is just beginning, and it’s an exciting time to experiment with these ideas. This research assistant project is open-sourced, so you can explore the implementation details and even run it yourself.</p><blockquote>Check out the <strong>GitHub repo</strong> for the full code and documentation: <a href="https://github.com/plawanrath/research-assistant-agent.git."><strong>https://github.com/plawanrath/research-assistant-agent.git</strong>.</a></blockquote><p>I hope this case study inspires you to build your own multi-agent systems using A2A or similar frameworks — the possibilities for innovation are immense when our agents start working together!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0df1d6eb71c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Look at Google’s Agent-to-Agent (A2A) Protocol For Multi-Agent AI Systems]]></title>
            <link>https://medium.com/@plawanrath/a-look-at-googles-agent-to-agent-a2a-protocol-for-multi-agent-ai-systems-2e876a14604b?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e876a14604b</guid>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Mon, 19 May 2025 00:57:22 GMT</pubDate>
            <atom:updated>2025-05-19T00:57:22.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-iUNKJZBHOPSQHr9hzi3ug.png" /></figure><h3>What is the A2A Protocol?</h3><p><strong>Agent-to-Agent (A2A)</strong> is an open protocol introduced by Google in late 2023 to standardize how AI agents communicate and collaborate with each other. Unlike traditional <em>tool-calling</em> approaches (e.g. a single AI agent invoking tools or APIs via frameworks like LangChain), A2A enables multiple independent agents to interact as peers with a <strong>structured messaging format</strong>. The goal is to allow agents — even those built by different vendors or frameworks — to <strong>“securely exchange information, and coordinate actions”</strong> in a unified way across different platforms. In short, A2A treats agents as services that can talk to one another, rather than forcing every capability to be a tool used by one monolithic agent.</p><p><strong>How A2A Differs from Tool-Calling:</strong> In tool-calling paradigms (like many LangChain agents), an LLM-based agent uses natural language to decide on actions and invokes external tools or APIs as functional calls. Those “tools” don’t behave like autonomous agents; they are more like extensions of the single agent’s capabilities. A2A, on the other hand, assumes <strong>multiple agents each with their own reasoning</strong>, communicating via formal messages. As the Google team puts it, A2A enables <em>“true multi-agent scenarios without limiting an agent to a ‘tool.’”</em> In practice, this means one agent can delegate a task to another agent as a request, and receive a structured result or ongoing updates, rather than just grabbing a tool’s output.</p><p><strong>Key Features of A2A:</strong> Several design features distinguish A2A from earlier frameworks:</p><ul><li><strong>Structured, Standard Messaging:</strong> A2A communication is built on web standards (HTTP, JSON-RPC, etc.) rather than ad-hoc prompts. Agents exchange JSON-formatted messages that include a defined <strong>Task</strong> object encapsulating what needs to be done, and any results (called <strong>Artifacts</strong>) produced. This structured approach makes interactions more deterministic and machine-readable compared to free-form language prompts. It also supports rich content: each message can have <strong>“parts”</strong> with specified content types (text, image, etc.) so that agents can negotiate the format of information (for example, an agent can send an image or a form if the counterpart can handle it).</li><li><strong>Capability Discovery &amp; Composability:</strong> Every agent in A2A advertises its skills and interface via an <strong>Agent Card</strong> (a JSON descriptor). This card describes what the agent can do (its “skills”), how to reach it (host/URL), and other metadata. Using this, a <strong>client agent</strong> can discover and choose the best <strong>remote agent</strong> for a given sub-task. In effect, agents become plug-and-play components — if an agent knows how to summarize text, and another knows how to fetch data, a third can find and invoke them dynamically. This composability is a major shift from monolithic agents: it enables drop-in replacements or upgrades. Teams can deploy <em>“smaller niche expertise agents that do specific tasks and then communicate — like a microservice framework”</em>, which are easier to build, maintain, and test than one giant agent.</li><li><strong>Clear Role Separation:</strong> A2A enforces a separation of roles in an interaction. One agent takes on the <strong>“client” role</strong> (initiating a task request) while another acts as the <strong>“remote” agent</strong> (executing the task). This explicit delineation of responsibility means each agent focuses on its role. In more complex multi-agent systems, you might have agents dedicated to planning or mediating between others. In fact, the protocol <em>“encourages explicit role delineation: some agents serve as initiators (requesting tasks), others as executors (fulfilling them), and some as planners or mediators (coordinating between agents)”</em>. Such structure supports building focused, purpose-driven agents without each needing awareness of the entire system.</li><li><strong>Complements Tool Use (MCP Standard):</strong> Importantly, A2A is <em>not</em> trying to replace tool integrations; it works alongside them. Google explicitly designed A2A to <strong>complement Anthropic’s Model Context Protocol (MCP)</strong> — not compete with it. MCP is a standard for connecting LLMs to external tools and data (essentially standardizing how an AI agent calls tools or APIs). A2A tackles the <em>agent-to-agent</em> layer instead. In other words, MCP might let an agent query a database or invoke a calculator, while A2A would let that agent delegate a high-level task to another agent (which itself might use tools internally). The two protocols address different needs and together aim to cover the whole ecosystem of agentic AI. As one explanation neatly summarized: <em>“A2A standardizes agent-to-agent communication, while MCP standardizes agent-to-tool communication — they are complementary.”</em></li><li><strong>Enterprise-Grade Security:</strong> Since A2A envisions agents operating across organizations and cloud services, it was built <strong>secure by default</strong>, with support for enterprise authentication and authorization schemes (aligned with OpenAPI auth standards). Essentially, agent endpoints can be secured just like standard web APIs. Each agent’s capabilities can be exposed in a controlled way, and sensitive data exchanges can be authenticated. (Of course, using these features is up to the implementer — by itself A2A is like an open API surface, which still requires proper access control in production, as we’ll note later.)</li><li><strong>Support for Long-Running Tasks:</strong> A2A is designed to handle both quick requests and long processes that might span minutes or hours (possibly with a human in the loop). The protocol supports different messaging patterns depending on task duration: for example, an agent can use a simple request/response (HTTP call) for a short task, <strong>Server-Sent Events (SSE)</strong> to stream results or interim updates, or <strong>push notifications</strong> to alert when a long task is complete. This built-in flexibility is a big differentiator from simpler agent frameworks — it acknowledges that some agent tasks (like research or data processing) won’t finish instantly. Agents can keep each other informed of progress or partial results, improving robustness in complex workflows.</li><li><strong>Multi-Modal and UI-Aware:</strong> While many current agents operate purely in text, A2A is <em>modality agnostic</em> — supporting text, images, audio, even video streams as message content. The protocol allows agents to negotiate content formats and UI capabilities. For instance, a client agent could tell a remote agent that it (or the end-user interface) can display an HTML form or a map, so the remote agent could return an interactive element. This is forward-looking, enabling richer user experiences when multiple agents and humans collaborate.</li></ul><p>In summary, A2A establishes a common language and set of rules for agent collaboration. It formalizes things that used to be handled in an ad-hoc way (if at all) — discovery of agent capabilities, passing of tasks with structured inputs/outputs, and maintaining dialog over the lifecycle of a task. By doing so, it aims to unlock <strong>true interoperability</strong>: any A2A-compliant agent should be able to work with any other, which is powerful for organizations that want to integrate various AI services. As Google’s announcement put it, businesses get <em>“a standardized method for managing their agents across diverse platforms,”</em> which is essential to fully realize collaborative AI’s potential.</p><h3>Why A2A?</h3><p>Building on the above, let’s analyze <strong>why A2A is significant for production-grade agent systems</strong>, and also acknowledge some drawbacks of this approach.</p><h3>Key Advantages of A2A</h3><ul><li><strong>Clear Agent Boundaries &amp; Modularity:</strong> In A2A, each agent runs as an independent service with a well-defined API (its Agent Card and tasks). This is analogous to microservices in software architecture. The boundary is clear — an agent can only communicate through the protocol, not by poking into another agent’s internal memory. This modular design makes it easier to reason about the system. Teams can update or replace one agent (say, swap out a summarization agent for a better one) without breaking the others, as long as it respects the same interface. It also enforces separation of concerns: one agent = one responsibility.</li><li><strong>Easier Testing and Iteration:</strong> Because of these boundaries, each agent can be <strong>unit-tested</strong> in isolation. You can feed a remote agent various task requests (via HTTP calls or JSON inputs) and verify its responses without needing the whole multi-agent ensemble running. Similarly, a client agent’s decision logic (how it picks which agent to delegate to, how it handles responses) can be simulated by mocking the remote agents. This is much harder in a monolithic agent that entangles reasoning and tool use in one giant prompt. A2A’s structured interactions lend themselves to more deterministic testing and even formal verification of agent behaviors. In our experience, developing agents with strict input/output schemas and database-logged results made it feasible to debug issues step by step, rather than wading through an LLM’s entire chain-of-thought.</li><li><strong>Improved Safety and Governance:</strong> A2A can enhance safety in multiple ways. First, because agents communicate via explicit messages, it’s possible to log and inspect those communications centrally — an audit log of who asked what and which data was exchanged. This auditability is useful for compliance and debugging. Second, role separation means you could insert a <strong>“mediator” agent that monitors or filters tasks</strong> between agents. For example, a mediator could check that a request doesn’t ask a planning agent to do something outside its allowed scope. While A2A by itself doesn’t magically solve AI safety, it provides hooks for control. Additionally, the protocol’s built-in authentication support means enterprises can enforce <strong>access control</strong> on agent endpoints. (One caveat: as an expert pointed out, if you expose an agent’s capabilities without restrictions, it could be like an open API — you must still implement proper permissions. But A2A gives you the framework to do so.) Overall, having multiple specialized agents can also be safer than one general agent: each can be sandboxed to certain data or actions. If one agent is compromised or goes off track, its abilities are limited, and it can’t directly hijack the whole workflow without cooperation from others.</li><li><strong>Scalability and Resilience:</strong> With agents as separate services, you gain flexibility in deployment. You might run heavy-duty agents on powerful servers or GPUs, while lighter ones run on edge devices or separate clouds — yet they can all talk via the protocol. This also means you can scale agents independently; e.g., if an influx of tasks requires more of the “analysis” agent, you could spin up more instances of it behind a load balancer. If one instance fails, the client agent could retry or route to another. In contrast, a single-agent system has a single point of failure. A2A systems can be more resilient: one agent crashing doesn’t necessarily crash the others — the client can catch an error and decide what to do (maybe try a fallback agent). Furthermore, dividing a complex job among agents can speed things up if some parts can run in parallel. For instance, one agent could gather data while another processes previous results.</li><li><strong>Interoperability and Future-Proofing:</strong> A2A’s vendor-neutral design ensures you’re not locked into one ecosystem. You could have a Python-based agent using one ML library and a Java-based agent using another, and they can still cooperate. This encourages using the best tool for each job. It also means as new agent frameworks emerge, if they adopt A2A, they can plug into your system without a complete rewrite. The protocol’s openness (with an evolving spec on GitHub) hints at a future where community-driven standards might reduce the chaos of today’s myriad agent APIs. In the long run, this could lead to an <strong>ecosystem of third-party agents</strong> you can integrate (much like web services today) — e.g. an off-the-shelf translation agent, a scheduling agent, etc. — accelerating development of AI workflows.</li><li><strong>Rich Interactions (Beyond Text):</strong> Because A2A isn’t limited to plain text prompting, it enables richer multi-modal workflows. Agents can exchange data like images, JSON payloads, or other structured artifacts as part of their messages. This is great for production settings where outputs might be, say, a CSV file generated by a data-analysis agent, or an image from a design generator agent. The receiving agent can explicitly know the content type and handle it appropriately. It’s a cleaner pipeline than stuffing binary data into a text prompt or base64 string. Moreover, A2A messages include metadata that can capture state and context over a long task, which helps build <strong>user-friendly experiences</strong> (imagine an agent telling another “I can display a map if you return geolocation data”). All of this improves the ability to build complex applications where AI is not just chatting, but doing things.</li></ul><h3>Drawbacks and Challenges</h3><p>Despite its promise, A2A also comes with some <strong>challenges and trade-offs</strong> that teams should consider:</p><ul><li><strong>Increased System Complexity:</strong> There’s no denying that an A2A-based solution is more complex to set up than a single-agent script. You now have <em>multiple moving parts</em> — potentially multiple servers or processes to deploy and maintain. You need to implement the protocol (or use an SDK) for each agent, define their API schemas, handle networking, etc. In early stages, this overhead can slow down development. For example, if you just want a quick prototype to answer questions using one LLM, introducing a whole multi-agent architecture might be overkill. The complexity also means more points of failure: network calls can timeout, one agent’s response might not parse correctly, etc., so robust error-handling is needed at each junction.</li><li><strong>Latency and Verbosity:</strong> A2A interactions typically incur more overhead than in-process tool calls. Each agent-to-agent call might involve HTTP requests or event streams, serialization/deserialization of JSON, and potentially waiting in queues. This can add latency, especially if agents need to have several back-and-forth messages to complete a task. Additionally, the messages themselves are verbose (think JSON with structured fields) compared to a compact function call. In high-throughput scenarios, this could become a bottleneck. There’s also a <strong>cognitive overhead</strong> for developers: reading logs of agent conversations means parsing a lot of structured data, which can be harder to follow than a linear prompt log. Verbosity can be mitigated with good tooling (e.g., visualization of agent dialogues), but currently those tools are immature.</li><li><strong>Learning Curve and Immature Ecosystem:</strong> A2A is very new (as of 2024–2025), and while many big names have expressed support, the ecosystem of libraries and best practices is still nascent. Developers might have to DIY more solutions. For instance, orchestrating multiple agents requires some planning — do you write a custom router agent to manage who talks to whom? Or use a library (some early frameworks like LangChain’s <strong>LangGraph</strong> or others are exploring multi-agent orchestration)? The standards are evolving, so what you build today might need adjustments as the spec is refined. Compared to something like REST or gRPC which have mature support, A2A will feel a bit raw. Early adopters may face issues with lack of documentation or subtle interoperability bugs between different vendors’ agents. In short, the <em>promise</em> of interoperability is huge, but the real-world plug-and-play might be rough initially.</li><li><strong>Security and Trust Boundaries:</strong> While we listed improved safety as a benefit, it’s also true that opening agent-to-agent communication <strong>expands the attack surface</strong>. If your agent can accept tasks from another agent, you must ensure it trusts that agent (or properly authenticates it). Otherwise, a malicious or malfunctioning agent could feed harmful tasks or data. In tool-calling, typically the human is in the loop deciding which tools the agent can use; in A2A, agents could autonomously enlist each other’s help, which might lead to unintended consequences if not constrained. There’s also the matter of data governance: an agent might send data to another agent — how do we ensure the receiving agent handles it under the same privacy rules? These are solvable with careful design (e.g., scopes, role-based access control — <strong>RBAC</strong>, as one expert recommends), but they add design complexity. Essentially, an A2A network could become like an open API network in your enterprise — requiring the same diligence in security policy as any web services you expose.</li><li><strong>Debugging Multi-Agent Systems:</strong> When an A2A system scales to many agents, understanding <strong>where an error occurred or why a decision was made</strong> can be challenging. If a result is wrong, was it because Agent A gave a bad instruction, or Agent B misunderstood it, or Agent C’s tool call failed? Tracing the chain of events is critical. Logging each step helps, but the volume of logs can be large. There’s a risk of creating a “black-box AI” effect if the agent network becomes too large or dynamic. This calls for sophisticated monitoring: developers might need to build dashboards to visualize agent interactions and dependencies. In our experience even with a small number of agents, we had to invest in good logging and a results database to trace how each piece of data was produced. For larger networks, one might need automated analysis to pinpoint bottlenecks or anomalies.</li></ul><p>Despite these challenges, the <strong>general consensus</strong> is that A2A opens up powerful new capabilities for AI systems. As one AI lead noted, it’s an important step toward scalable, modular agent architectures — much like microservices revolutionized software backends. The key is to start with well-scoped use cases and gradually build up, applying sound software engineering (testing, security, monitoring) to mitigate the complexity. In the next section, we’ll look at some concrete scenarios where A2A makes a lot of sense.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e876a14604b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Model Context Protocol (MCP) in Practice: A Hands-On Tutorial (with a macOS File Assistant Example)]]></title>
            <link>https://medium.com/@plawanrath/model-context-protocol-mcp-in-practice-a-hands-on-tutorial-with-a-macos-file-assistant-example-4822a2aecaf7?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/4822a2aecaf7</guid>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[mcp-protocol]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Sat, 10 May 2025 16:45:23 GMT</pubDate>
            <atom:updated>2025-05-10T16:45:23.466Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ljbsRLMBPl7aDnKKBT8pXg.png" /></figure><h3>Introduction</h3><p>Imagine building AI-powered applications that seamlessly interact with external tools, services, and data sources through natural language. Model Context Protocol (MCP) is an emerging open standard designed precisely for this task. In this tutorial, we’ll explore MCP in-depth, using a practical example — a macOS-based FileSystem Assistant I created — as a guide.</p><p>If you’ve heard about MCP but haven’t yet implemented it, this tutorial will demystify the protocol and equip you to start building your own MCP-powered AI applications.</p><h3>Understanding MCP</h3><p>Model Context Protocol (MCP) enables Large Language Models (LLMs) to interact securely and efficiently with external resources. Conceptually, MCP serves as a standardized bridge allowing an LLM to invoke external “tools” (functions) exposed by MCP-compatible servers, receive structured responses, and iterate in a safe, structured, and auditable manner.</p><p>Popularized by Anthropic’s Claude, MCP-like concepts are increasingly appearing in other ecosystems.</p><h3>Architecture at a Glance</h3><p>Below is the pattern you’ll repeat for <strong>any</strong> MCP build; keep the File Assistant in mind only as an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7FuLoDklQVJC6AMrywQ20g.png" /></figure><h3>Tech Stack Used for this example</h3><ul><li><strong>Python</strong> (3.10+): Rich ecosystem and compatibility with LLM APIs.</li><li><strong>fastmcp</strong>: Python SDK for easily creating MCP-compatible servers.</li><li><strong>PyQt6</strong>: GUI library for desktop applications.</li><li><strong>qasync</strong>: Integrates asyncio event loops into PyQt applications.</li><li><strong>OpenAI Python SDK</strong>: For invoking GPT models with function-calling capabilities.</li><li><strong>py2app</strong>: Packaging Python apps into macOS-native bundles.</li></ul><h3>Setting Up Your First MCP Tool Server</h3><p>FastMCP (a thin wrapper around FastAPI) is the quickest way to stand up a server.</p><pre>from mcp.server.fastmcp import FastMCP<br>import os, pathlib<br><br>mcp = FastMCP(&quot;local_files&quot;)<br><br>@mcp.tool(<br>    name=&quot;list_files&quot;,<br>    description=&quot;List directory contents. If file_type==&#39;files&#39; return only files.&quot;<br>)<br>def list_files(directory: str = &quot;~&quot;, file_type: str = &quot;all&quot;) -&gt; list[str]:<br>    base = _abs(directory)<br>    try:<br>        entries = os.listdir(base)<br>    except FileNotFoundError:<br>        return []<br>    if file_type.lower() == &quot;files&quot;:<br>        entries = [e for e in entries if os.path.isfile(base / e)]<br>    return entries<br><br>@mcp.tool()<br>def read_file(path: str) -&gt; str:<br>    &quot;&quot;&quot;Return contents of the text file at `path`.&quot;&quot;&quot;<br>    try:<br>        with open(path, encoding=&quot;utf-8&quot;) as f:<br>            return f.read()<br>    except Exception as e:<br>        return f&quot;Error: {e}&quot;<br><br>if __name__ == &quot;__main__&quot;:<br>    mcp.run()      </pre><ul><li><strong>Type hints + docstrings → JSON Schema</strong>: FastMCP turns your function signature into the exact schema the LLM host needs — no manual JSON editing.</li></ul><p>Replicate the pattern for gdrive_server.py, icloud_server.py, etc. The only real difference is that those functions wrap the Google Drive / iCloud SDKs instead of os.listdir.</p><h3>Writing the Orchestrator</h3><p>Below is the minimal async loop you’ll reuse everywhere. It works with <strong>GPT-4/3.5 function-calling</strong>, but the same concept applies to Claude, Mistral Function-Calling, etc.</p><pre>import openai, json, asyncio, httpx<br><br>class MCPAssistant:<br>    def __init__(self, tool_schemas):<br>        self._tools = tool_schemas<br>        self._model = &quot;gpt-4o-mini&quot;        # or gpt-4-turbo, etc.<br><br>    async def __call__(self, user_msg: str) -&gt; str:<br>        msgs = [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: user_msg}]<br>        while True:<br>            chat = await openai.ChatCompletion.acreate(<br>                model=self._model,<br>                messages=msgs,<br>                functions=self._tools,<br>                function_call=&quot;auto&quot;,<br>            )<br>            reply = chat.choices[0].message<br><br>            # 1️⃣  Tool call requested?<br>            if reply.get(&quot;function_call&quot;):<br>                fn = reply.function_call<br>                args = json.loads(fn.arguments or &quot;{}&quot;)<br>                result = await self._invoke_tool(fn.name, args)<br><br>                msgs.append({<br>                    &quot;role&quot;: &quot;assistant&quot;, &quot;name&quot;: fn.name,<br>                    &quot;content&quot;: json.dumps(result) if not isinstance(result, str) else result,<br>                })<br>                continue<br><br>            # 2️⃣  Done -- return natural-language answer<br>            return reply.content<br><br>    async def _invoke_tool(self, name, args):<br>        &quot;&quot;&quot;Route to the correct MCP server and return its JSON result.&quot;&quot;&quot;<br>        # simplest: fire every server, first non-error wins<br>        for endpoint in SERVER_ENDPOINTS[name]:          # you maintain this map<br>            try:<br>                async with httpx.AsyncClient() as client:<br>                    r = await client.post(endpoint, json={&quot;name&quot;: name, &quot;input&quot;: args})<br>                    return r.json()[&quot;output&quot;]<br>            except Exception as e:<br>                continue<br>        return f&quot;Error invoking {name}&quot;</pre><h4><strong>Pro tips:</strong></h4><ul><li><em>Maintain a tool_name → [server endpoint(s)] registry at startup</em></li><li><em>Normalize synonyms (folder → directory, etc.) before dispatching</em></li></ul><h3>Building a macOS Desktop Front-End</h3><p>You can skip this if you only need a CLI, but PyQt6 + qasync make a nice native shell:</p><pre>from PyQt6.QtWidgets import QApplication, QTextEdit, QLineEdit, QPushButton, QVBoxLayout, QWidget, QLabel<br>from qasync import QEventLoop, asyncSlot<br>import asyncio, sys<br><br>assistant = MCPAssistant(all_tool_schemas)   # collected at launch<br><br>class Main(QWidget):<br>    def __init__(self):<br>        super().__init__()<br>        self.setWindowTitle(&quot;MCP File Assistant (Demo)&quot;)<br>        self.chat = QTextEdit(readOnly=True)<br>        self.input = QLineEdit()<br>        self.send = QPushButton(&quot;Send&quot;)<br>        self.status = QLabel(&quot;&quot;)<br>        self.send.clicked.connect(self.on_send)<br>        layout = QVBoxLayout(self)<br>        for w in (self.chat, self.input, self.send, self.status): layout.addWidget(w)<br><br>    @asyncSlot()<br>    async def on_send(self):<br>        query = self.input.text().strip()<br>        if not query: return<br>        self.input.clear(); self.status.setText(&quot;Thinking...&quot;)<br>        answer = await assistant(query)<br>        self.status.setText(&quot;&quot;)<br>        self.chat.append(f&quot;&lt;b&gt;User:&lt;/b&gt; {query}&quot;)<br>        self.chat.append(f&quot;&lt;b&gt;Assistant:&lt;/b&gt; {answer}&quot;)<br><br>if __name__ == &quot;__main__&quot;:<br>    app = QApplication(sys.argv)<br>    loop = QEventLoop(app); asyncio.set_event_loop(loop)<br>    w = Main(); w.show()<br>    with loop: loop.run_forever()</pre><p>Package it with <strong>py2app</strong> (or PyInstaller) and you get a double-clickable .app.</p><h4>Common Pitfalls (&amp; How to Dodge Them)</h4><p><strong>Pitfall:</strong> <em>Wrong schema fields (e.g., missing description or required) </em><strong>Fix/Prevention:</strong> Let FastMCP autogenerate, then inspect /.well-known/mcp.json — copy exactly into the functions= param.</p><p><strong>Pitfall:</strong> <em>LLM uses wrong arg names (e.g., folder instead of directory) </em><strong>Fix/Prevention:</strong> Add a tiny alias-normalizer before invoking the tool.</p><p><strong>Pitfall:</strong> <em>macOS privacy dialogs when accessing folder ~/Documents </em><strong>Fix/Prevention:</strong> Sign the .app and request NSDocumentsFolderUsageDescription; for hobby projects, click <em>Allow</em> once.</p><p><strong>Pitfall:</strong> <em>GUI becomes unresponsive during long-running tool calls </em><strong>Fix/Prevention:</strong> Always run your QT/async loop via qasync or another asyncio bridge.</p><h4>When should <em>you</em> reach for MCP ?</h4><p><strong>Use-case 1:</strong> A handful of heterogeneous systems (files + calendar + emails)<br>Is MCP worth it?: <strong>Yes</strong> ✅ MCP’s modular servers keep credentials &amp; errors isolated.</p><p><strong>Use-case 2:</strong> Reusing the same tools across multiple LLM hosts<br>Is MCP worth it?: <strong>Yes</strong> ✅ standard interface beats re-implementing for each vendor.</p><p><strong>Use-case 3:</strong> One-off function (e.g., “get weather”)<br>Is MCP worth it?: <strong>Probably overkill </strong>⚠️ just expose a single OpenAI function.</p><p><strong>Use-case 4:</strong> Ultra-low-latency, high-QPS micro-service<br>Is MCP worth it?: <strong>Maybe not</strong> ⚠️ raw in-process calls might matter more than modularity.</p><h3>Example Repo (Optional Reference)</h3><p>If you want to see the full macOS File Assistant — including GUI, packaging script, and four tool servers — grab the code here:</p><p><strong>🗂</strong><a href="https://github.com/plawanrath/filesystem-assistant"><strong> https://github.com/plawanrath/filesystem-assistant</strong></a></p><p><em>Remember: the repo shows one application of MCP. Apply the same skeleton to control Kubernetes, scrape websites, automate spreadsheets… whatever your next agent idea needs.</em></p><h3>Final Thoughts</h3><p>MCP turns “chatty” LLMs into practical <em>agents</em> — and it does so with clean boundaries that keep each capability testable, swappable, and auditable. The file assistant demo you just read about may serve personal productivity, but the same pattern scales to enterprise workflows or IoT fleets.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4822a2aecaf7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fine-Tuning Mistral-7B on Apple Silicon: A Mac User’s Journey with Axolotl & LoRA]]></title>
            <link>https://medium.com/@plawanrath/fine-tuning-mistral-7b-on-apple-silicon-a-mac-users-journey-with-axolotl-lora-c6ff53858e7d?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6ff53858e7d</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Sun, 04 May 2025 09:44:39 GMT</pubDate>
            <atom:updated>2025-05-04T09:44:39.079Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>TL;DR:</em></strong> <em>Fine-tuning a large language model like </em><strong><em>Mistral-7B</em></strong><em> on an M Series Mac is absolutely possible — but it’s not without challenges. In this article, I’ll share my personal journey fine-tuning Mistral-7B on a Rust programming dataset using an M3 Ultra Mac. I’ll walk through my false starts with the Axolotl fine-tuning toolkit (and the CUDA-centric pitfalls I hit), and how I ultimately succeeded by writing a custom </em><strong><em>LoRA</em></strong><em> fine-tuning script with Transformers and PEFT. We’ll cover the errors I encountered (and how I fixed or worked around them), how I merged the LoRA weights into the base model, converted the result to </em><strong><em>GGUF</em></strong><em> format with llama.cpp, and got the model running locally in </em><strong><em>LM Studio</em></strong><em>. Along the way, I’ll include code snippets, tool links, and tips for Mac users (like disabling Weights &amp; Biases prompts, silencing tokenizer warnings, and organizing your files). Let’s dive in!</em> 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*utnzyBjkDvMohpq0FZ2Pcg.png" /></figure><h3>Why Fine-Tune Mistral-7B Locally on a Mac?</h3><p>Fine-tuning large language models is often assumed to require a beefy NVIDIA GPU with CUDA. I wanted to see if I could fine-tune a model <strong>locally on Apple Silicon</strong> — taking advantage of the M-series chip’s unified memory and <strong>Metal Performance Shaders (MPS)</strong> backend for PyTorch. The model I chose was <strong>Mistral-7B</strong>, a powerful 7-billion-parameter model released by Mistral AI in late 2023, known for strong performance relative to its size. My goal was to fine-tune Mistral-7B on a <strong>Rust-specific dataset</strong> to create a Rust-fluent assistant.</p><p>Why not use a cloud GPU? Cost is one reason, but also the appeal of <strong>running everything offline on my Mac</strong>. The challenge is that much of the LLM tooling (fine-tuning frameworks, optimizers, etc.) is very <strong>CUDA-centric</strong> and not built with Apple’s GPUs in mind. Apple’s MPS support in PyTorch is steadily improving, but still has some gaps (e.g. incomplete mixed-precision support). In this article, I’ll share how I navigated these limitations.</p><h3>Attempt 1: Fine-Tuning with Axolotl (and the Pitfalls on Apple Silicon)</h3><p>To kick things off, I decided to try <strong>Axolotl</strong>, an open-source toolkit that aims to streamline fine-tuning of LLMs with minimal code. Axolotl supports many architectures (LLaMA, Mistral, Falcon, etc.) and uses simple YAML configs to orchestrate data preprocessing, LoRA or full fine-tuning, and even model merging. This sounded perfect — I could focus on my dataset and config while Axolotl handled the heavy lifting.</p><p><strong>Axolotl setup:</strong> I created a Python 3.10 virtual environment on my Mac and ran the Axolotl installation. On Apple Silicon, the recommended approach was to install from source (since some dependencies need special handling). After installing PyTorch (with MPS support) and datasets, I did:</p><pre># Install Axolotl without CUDA extras<br>pip install axolotl</pre><p>This installed Axolotl and most dependencies, but as expected, <strong>bitsandbytes</strong> (a library for 8-bit optimizations) failed to install — it has <em>no support for macOS/M1</em> (it’s CUDA-only). I knew I wouldn’t be able to use 4-bit quantization or 8-bit optimizers on Mac, but that’s okay for a 7B model. I planned to fine-tune in full 16-bit or 32-bit precision on CPU/MPS.</p><p>Next, I wrote an Axolotl YAML config for my task, specifying the base model (<em>mistralai/Mistral-7B-v0.1</em> from Hugging Face), LoRA parameters (rank, alpha, target modules, etc.), and pointing to my Rust dataset (a JSON with instruction-output pairs). Then I ran Axolotl to begin training.</p><h3>Challenges and Errors with Axolotl on M3</h3><p>Almost immediately, I hit a series of issues trying to use Axolotl on Apple Silicon. Here’s a rundown of the key challenges I faced, and how I attempted to address them:</p><ul><li><strong>bitsandbytes incompatibility:</strong> As noted, Axolotl by default tries to use bitsandbytes for 8-bit model loading or optimizers (especially if you configure QLoRA or 4-bit training). On Mac, bitsandbytes isn’t available, causing installation or runtime errors. <em>Workaround:</em> I disabled any 4-bit quantization options in the config and let Axolotl load the model in full precision. Axolotl’s docs confirm that on Mac, you have to stick to full precision or FP16 — no 4/8-bit support.</li><li><strong>“CUDA-only” cleanup routines:</strong> During shutdown, I saw warnings/errors related to CUDA operations (e.g. attempts to call <em>torch.cuda.empty_cache()</em> or use CUDA-specific memory cleanup) even though I was running on CPU/MPS. These weren’t show-stoppers, but they cluttered the logs with warnings. <em>Solution:</em> I mostly ignored these, but it highlighted that some parts of Axolotl assume an NVIDIA GPU environment. (Axolotl’s own docs note that <strong>M-series Mac support is partial</strong>, since not all dependencies support MPS)</li><li><strong>Unexpected dataset key errors:</strong> My dataset was a simple JSON of instructions and answers (I had keys like “instruction” and “output”). Axolotl, however, expected a certain format or key naming depending on the chosen prompt template. At first, I got a KeyError complaining about missing keys. I realized Axolotl defaults to the <strong>OpenAI conversation format</strong> (expecting a list of messages with roles). <em>Fix:</em> I updated the config to map my dataset’s keys to what Axolotl expects. For example, I set field_instruction to “instruction” and field_reply to “output” in the config (or I could have reformatted my JSON). After this tweak, Axolotl was able to parse the dataset.</li><li><strong>merge_and_unload error (merging LoRA weights):</strong> After training for a while (which itself was slow but working on CPU), Axolotl tries to <strong>merge the LoRA adapter into the base model</strong> to produce a final model. This step crashed with an AttributeError — <em>“MistralForCausalLM object has no attribute ‘merge_and_unload’”</em>. Essentially, the Mistral model class in transformers did not support the merge_and_unload() method that PEFT models have. This was a known Axolotl bug at the time for Mistral. The result: Axolotl couldn’t merge the weights.</li><li><strong>Missing adapter_model.bin:</strong> To make matters worse, because of the merge failure, Axolotl also <strong>failed to save the LoRA adapter weights</strong> in the expected output folder. I was left with an output directory that had some logs and config, but no adapter_model.bin (the LoRA weight file) or merged model. After hours of training, I essentially had nothing usable to show for it.</li></ul><p>After wrestling with these issues and digging through GitHub issues, I decided to change course. Axolotl is a great tool, but its Mac support (at least at that time) was bleeding-edge and these CUDA-centric roadblocks were draining my productivity. It was time for <strong>Plan B</strong>.</p><h3>Plan B: Fine-Tuning with a Custom PEFT Script (No Axolotl, No CUDA)</h3><p>Determined to get this model fine-tuned on my Mac, I rolled up my sleeves and wrote a custom training script using the<strong> Transformers</strong> library and the <strong>PEFT</strong> (Parameter-Efficient Fine-Tuning) library for LoRA. Writing my own script gave me full control and transparency, at the cost of re-implementing some of what Axolotl would have handled automatically. The upside: I could explicitly avoid any CUDA-specific code and handle the quirks of Apple Silicon myself.</p><h3>1. Environment Setup for Mac Development</h3><p>First, I made sure my environment was ready:</p><p><strong>PyTorch with MPS:</strong> I installed a recent PyTorch build that supports the Apple MPS backend. For me, pip install torch torchvision torchaudio (PyTorch 2.1) worked out-of-the-box. After installation, I quickly tested torch.backends.mps.is_available() in a Python shell to confirm that the MPS (Metal Performance Shaders) backend was enabled. If MPS hadn’t worked, the fallback would be CPU, but MPS can accelerate tensor operations on the GPU (though it still uses GPU memory).</p><p><strong>Hugging Face libraries:</strong> I installed the Transformers, Datasets, and PEFT libraries:</p><pre>pip install transformers datasets peft safetensors accelerate</pre><p>Using safetensors is optional but recommended when dealing with model weights, as it’s a safer alternative to pickle-based .bin files. I also included accelerate just in case I wanted to use it for device placement (though for a single machine and MPS, it wasn’t strictly needed).</p><p><strong>Disable W&amp;B and tokenizers warnings:</strong> By default, the Hugging Face Trainer will attempt to log to Weights &amp; Biases. To avoid the interactive prompt or unwanted logging, I set an environment variable to disable W&amp;B:</p><pre>export WANDB_DISABLED=true<br>export TOKENIZERS_PARALLELISM=false</pre><p>I also turned off the tokenizers parallelism. These two lines can be added to your ~/.bashrc/~/.zshrc or just exported in the terminal before running the script. (Alternatively, in your Python script you can do <strong><em>os.environ[“WANDB_DISABLED”] = “true”)</em></strong>. This ensures a cleaner output with no pauses or huge warnings.</p><ul><li><strong>Organize files and folders:</strong> For sanity, I structured my project as follows:</li></ul><blockquote>A directory for the <strong>base model</strong> weights (I used the Hugging Face mistralai/Mistral-7B-v0.1 — which I had downloaded in advance using huggingface_hub or git lfs). For example: ./models/Mistral-7B-v0.1/…</blockquote><blockquote>A directory (or file) for the <strong>dataset</strong>. In my case, a JSON lines file rust_instruct.json containing entries with “instruction” and “output”.</blockquote><blockquote>An <strong>output</strong> directory for fine-tuning results. I created ./outputs/lora_rust/ for the LoRA adapter, and later ./outputs/merged_model/ for the merged full model.</blockquote><p>Keeping these separate helps avoid mixing up files and makes it easier to convert or move things later.</p><h3>2. Writing the LoRA Training Script</h3><p>Now for the main event: fine-tuning the model with LoRA. I wrote a script <em>train_lora_mistral.py</em> to do the following steps:</p><p><strong>a. Load the tokenizer and base model:</strong> Using the Hugging Face Transformers API:</p><pre>from transformers import AutoTokenizer, AutoModelForCausalLM<br><br>model_name = &quot;./models/Mistral-7B-v0.1&quot;  # path or name of base model<br>tokenizer = AutoTokenizer.from_pretrained(model_name)<br>model = AutoModelForCausalLM.from_pretrained(<br>    model_name,<br>    load_in_8bit=False,   # we avoid bitsandbytes on Mac<br>    torch_dtype=&quot;auto&quot;,   # let PyTorch decide (float32 or float16 if MPS allows)<br>    device_map={&quot;&quot;: &quot;mps&quot;}  # this places the model on the Apple GPU (MPS). <br>    # If MPS is not available or if issues occur, use {&quot;&quot;: &quot;cpu&quot;} to train on CPU.<br>)</pre><p>A few notes on this:</p><ul><li>I loaded the model in full precision <em>(load_in_8bit=False)</em> because 8-bit loading (via bitsandbytes) isn’t supported on Mac. Full FP16 or FP32 was fine given 7B isn’t too large. On my 32GB RAM Mac, the 7B model in FP16 (~13 GB) fits in memory.</li><li><em>device_map={“”: “mps”}</em> is a way to instruct Transformers to put the whole model on the MPS device. You could also call <em>model.to(“mps”)</em> after loading. If you only have CPU (or if MPS has issues), use “cpu”. Keep in mind training on CPU will be <strong>very slow</strong> — MPS can be 2–3× faster for matrix ops.</li><li>I used the local path for the model. If you haven’t downloaded the model, you can use the Hugging Face hub name (it will download automatically). Just be mindful of disk space.</li></ul><p><strong>b. Add LoRA adapters to the model:</strong> Using <strong>PEFT (🤗 PEFT library)</strong> to wrap the model with LoRA:</p><pre>from peft import LoraConfig, get_peft_model, TaskType<br><br># Configure LoRA<br>lora_config = LoraConfig(<br>    r=16,             # LoRA rank (trade-off between memory and capacity, common values: 4,8,16)<br>    lora_alpha=32,    # LoRA alpha scaling<br>    target_modules=[&quot;q_proj&quot;, &quot;k_proj&quot;, &quot;v_proj&quot;, &quot;o_proj&quot;],  # target linear layers in Mistral model<br>    lora_dropout=0.05,<br>    bias=&quot;none&quot;,<br>    task_type=TaskType.CAUSAL_LM  # we&#39;re fine-tuning a causal language model<br>)<br><br># Wrap the model with LoRA<br>model = get_peft_model(model, lora_config)</pre><p>Some explanation: The <em>target_modules</em> are the names of the model’s weight modules we want to apply LoRA to. For LLaMA/Mistral architectures, the attention projection layers are typically named <em>q_proj, k_proj, v_proj, and sometimes o_proj</em> (output projection). I included those to allow LoRA to train those matrices. The rank and alpha are hyperparameters (I chose a moderately high rank of 16 for potentially better learning of coding knowledge, at the cost of a larger adapter). <strong>Note:</strong> A rank of 16 on a 7B model is still quite small in terms of new parameters — LoRA adds only <em>(2 * hidden_size * r)</em> parameters per target layer, which is much less than full model tuning.</p><p><strong>c. Prepare the dataset and training data loader:</strong> I used the <strong>Datasets</strong> library to load my JSON and then set up the training loop:</p><pre>from datasets import load_dataset<br><br>data = load_dataset(&quot;json&quot;, data_files=&quot;rust_instruct.json&quot;)<br>train_data = data[&quot;train&quot;]  # assuming the JSON is just a list of examples</pre><p>My dataset entries look like:</p><pre>{&quot;instruction&quot;: &quot;Explain the ownership model in Rust.&quot;, &quot;output&quot;: &quot;Rust&#39;s ownership model is based on ...&quot;}<br>{&quot;instruction&quot;:&quot;Rust use statement&quot;,&quot;input&quot;:&quot;&quot;,&quot;output&quot;:&quot;use bytes::Bytes;&quot;}</pre><p>I decided to fine-tune in an <em>instruction-tuning</em> style, where each example is like a prompt-response pair. I concatenated each instruction with perhaps a system prefix and used the output as the label. A quick way is to format each example into a single text with a special separator token, but since Mistral/LLaMA are usually trained in chat format, I could also use the prompt template approach. For simplicity, I created a function to join them:</p><pre>def format_example(example):<br>    prompt = f&quot;&lt;s&gt;[INST] {example[&#39;instruction&#39;]} [/INST]\n&quot;  # using a format akin to LLaMA-2 chat<br>    response = example[&quot;output&quot;]<br>    full_text = prompt + response<br>    return tokenizer(full_text, truncation=True)</pre><p>I then applied this formatting to the dataset and set it up for the Trainer:</p><pre>train_data = train_data.map(lambda ex: tokenizer(format_example(ex)[&quot;input_ids&quot;]), batched=True)</pre><p>(Depending on memory, you might want to stream or use train_data.map() with caution on large sets. My dataset was small enough.)</p><p><strong>d. Configure training parameters:</strong> I used the Hugging Face Trainer API for convenience:</p><pre>from transformers import TrainingArguments, Trainer, DataCollatorForLanguageModeling<br><br>training_args = TrainingArguments(<br>    output_dir=&quot;./outputs/lora_rust&quot;,<br>    per_device_train_batch_size=1,<br>    gradient_accumulation_steps=4,<br>    num_train_epochs=3,<br>    logging_steps=10,<br>    save_steps=50,<br>    learning_rate=2e-4,<br>    fp16=True,  # enable mixed precision (this works on MPS as of PyTorch 2.1 for forward, but watch out for any issues)<br>    report_to=&quot;none&quot;  # disable wandb logging<br>)<br># Use a data collator that can handle language modeling (it will pad sequences to the same length in a batch)<br>data_collator = DataCollatorForLanguageModeling(tokenizer, mlm=False)<br><br>trainer = Trainer(<br>    model=model,<br>    args=training_args,<br>    train_dataset=train_data,<br>    data_collator=data_collator<br>)</pre><p>I chose a very small <em>batch_size</em> of 1 with <em>gradient_accumulation_steps=4</em> to simulate an effective batch of 4 — this was because of limited memory on the Mac and the fact that MPS backend currently doesn’t support more complex multi-batch operations as efficiently. The rest of hyperparams (epochs, LR) were picked somewhat heuristically for a small dataset. I set <em>fp16=True</em> hoping that mixed precision would be used; on MPS, PyTorch’s Automatic Mixed Precision support was still being worked on, but by PyTorch 2.1 some operations can use half precision on the GPU. In any case, it didn’t crash, and using FP16 where possible helps speed.</p><p><strong>e. Run training:</strong> Finally:</p><pre>trainer.train()</pre><p>This started the fine-tuning process. It was <strong>slow</strong> — let’s be honest, fine-tuning 7B on a laptop CPU/MPS is nowhere near GPU training speeds. But it was progressing! The training loop printed loss updates every 10 steps, and over a couple of hours (for a small dataset) I got through my 3 epochs. I could see the loss decreasing and the model seemingly learning from the Rust examples.</p><p>After training, I saved the LoRA adapter:</p><pre>trainer.model.save_pretrained(&quot;./outputs/lora_rust&quot;)</pre><p>The <em>save_pretrained</em> of a PEFT model will save the adapter weights and configuration. Indeed, in <em>./outputs/lora_rust/ </em>I now saw <em>adapter_model.bin</em> (about a few 10s of MB, since LoRA weights are small) and <em>adapter_config.json</em>. Victory! I had a fine-tuned LoRA adapter.</p><blockquote><em>(Side note: I could have also used model.save_pretrained on the LoRA-wrapped model. Both achieve the same, since trainer.model is the LoRA-wrapped model. Just ensure you’re saving the PEFT model, not the base model alone.)</em></blockquote><h3>3. Merging LoRA Weights with the Base Model</h3><p>Having a LoRA adapter is great if you plan to use it via code (you can load the base model and apply the adapter on the fly). But I wanted to use this model in a self-contained way (e.g., in LM Studio or other inference tools that might not support PEFT natively). So the next step was <strong>merging the LoRA weights into the base model</strong> to create a standalone fine-tuned model.</p><p>I wrote a small script <em>merge_lora.py</em> to do this:</p><pre>from transformers import AutoModelForCausalLM<br>from peft import PeftModel<br><br>base_model = AutoModelForCausalLM.from_pretrained(<br>    &quot;./models/Mistral-7B-v0.1&quot;,<br>    torch_dtype=&quot;auto&quot;,<br>    device_map={&quot;&quot;: &quot;cpu&quot;}  # we can do merging on CPU to avoid any MPS quirk<br>)<br># Load the fine-tuned LoRA adapter into the base model<br>lora_model = PeftModel.from_pretrained(base_model, &quot;./outputs/lora_rust&quot;)<br><br># Merge and unload – incorporate LoRA weights into base model<br>merged_model = lora_model.merge_and_unload()<br><br># Save the merged model<br>merged_model.save_pretrained(&quot;./outputs/merged_model&quot;, safe_serialization=True)</pre><p>A couple of things to highlight:</p><ul><li>I loaded the base model to CPU for merging. Merging is a one-time operation and is not performance critical, so CPU is fine (just needs enough RAM). This avoids any MPS issues with the <em>merge_and_unload</em> function.</li><li><em>PeftModel.from_pretrained</em> applied my LoRA to the base. Then calling <em>merge_and_unload()</em> gave me a normal <em>transformers</em> model (<em>merged_model</em>) with the weights updated as if they had been fully fine-tuned. This function essentially adds the low-rank updates (scaled by alpha) to the original weights.</li><li>I saved the merged model with <em>safe_serialization=True</em> which saves it in a <em>.safetensors</em> format (you could omit that or use the default to get a <em>pytorch_model.bin</em>, but I prefer safetensors for safety). The output directory now contained <em>adapter_config.json</em> (not needed anymore) and <em>model.safetensors</em> (the full weights, ~13GB in FP16).</li></ul><p>This step <strong>succeeded</strong> — unlike Axolotl’s built-in merge which errored out, doing it manually with the latest PEFT library worked. If your PEFT version is old, note that the <em>merge_and_unload</em> is a method on the <strong>PeftModel</strong> (specifically a <strong>PeftModelForCausalLM</strong>). In my case it was available and did the job. (In fact, the Axolotl issue was that they weren’t calling it on the correct object.)</p><p>Now I had a merged model that I could use like any other Hugging Face model. For example, I could do:</p><pre>import torch<br>from transformers import AutoModelForCausalLM, AutoTokenizer<br><br>tok = AutoTokenizer.from_pretrained(&quot;./outputs/merged_model&quot;, use_fast=True)<br>mod = AutoModelForCausalLM.from_pretrained(&quot;./outputs/merged_model&quot;, torch_dtype=torch.float16, device_map={&quot;&quot;: &quot;mps&quot;})<br>res = mod.generate(**tok(&quot;How do I implement a binary tree in Rust?&quot;, return_tensors=&quot;pt&quot;).to(&quot;mps&quot;))<br>print(tok.decode(res[0]))</pre><p>And it would produce an answer using the fine-tuned knowledge. (I did a quick test like this — the answers seemed reasonably Rust-aware!)</p><h3>4. Converting the Model to GGUF for llama.cpp</h3><p>While having the Hugging Face format model is nice, running a 13GB model on my Mac for inference isn’t ideal (it can run, but not efficiently). Many local LLM tools (like LM Studio, text-generation-webui, etc.) prefer models in the <strong>GGUF</strong> format (which is the latest iteration of the GPT/LLAMA binary format, succeeding GGML/GGUF). GGUF allows various quantization levels and is optimized for CPU inference via <strong>llama.cpp</strong>.</p><p>I decided to convert my model to GGUF. <strong>llama.cpp</strong> provides a conversion script for this purpose. Here’s what I did:</p><pre># Clone llama.cpp (if not already cloned)<br>git clone https://github.com/ggerganov/llama.cpp.git<br>cd llama.cpp<br><br># Install Python requirements for conversion (e.g., sentencepiece, numpy, safetensors etc.)<br>pip install -r requirements.txt<br><br># Run the conversion script<br>python ./convert-hf-to-gguf.py ../outputs/merged_model --outfile mistral-rust-7b.gguf --outtype q4_0</pre><p>A breakdown of the command:</p><ul><li>I pointed convert-hf-to-gguf.py to my merged_model directory, which contains the config.json, tokenizer.model, tokenizer.json, and the model.safetensors. The script needs those.</li><li>— outfile mistral-rust-7b.gguf is the name of the output file I wanted.</li><li>— outtype q4_0 specifies the quantization type. I chose <strong>4-bit (q4_0)</strong> which drastically reduces the model size (my output GGUF file became around ~3.5 GB). You can choose other quantization levels or even unquantized (f16 or f32). I found q4_0 to be a good balance for local CPU inference — it might sacrifice a bit of accuracy but for my use-case (Rust explanations) it was fine. If you have more RAM and want better quality, q5_1 or q8_0 are options (with larger file sizes).</li></ul><p>The conversion script ran for a few minutes and successfully produced mistral-rust-7b.gguf. Now the model was in a single file, ready for use in llama.cpp-compatible UIs.</p><h3>5. Installing the Model in LM Studio (Folder Structure Gotcha)</h3><p>Finally, I wanted to load the model into <strong>LM Studio</strong>, which is a nice Mac-friendly UI for chatting with local models. LM Studio supports GGUF models, but it expects them in a specific folder structure so it can recognize and list them.</p><p>According to the LM Studio docs, the model files should be placed under ~/.lmstudio/models with a <strong>publisher</strong> and <strong>model name</strong> hierarchy. Concretely, I did this:</p><pre># Create a folder for my model in LM Studio&#39;s directory<br>mkdir -p ~/.lmstudio/models/local/mistral-rust-7b<br><br># Move the GGUF file into that folder<br>mv mistral-rust-7b.gguf ~/.lmstudio/models/local/mistral-rust-7b/</pre><p>Here, I used local as the “publisher” name (you could use anything, maybe your username or org name). And mistral-rust-7b as the model name folder. One important detail: <strong>the file name must contain .gguf</strong> (which it does as I named it). If you have a quantization suffix (like q4_0), it’s fine to include it (e.g., mistral-rust-7b-q4_0.gguf), just keep the extension. In my case I left it as mistral-rust-7b.gguf.</p><p>I then launched LM Studio, and lo and behold, under “My Models” the model appeared as <strong>local/mistral-rust-7b</strong>. I could select it and start chatting. The Rust knowledge was there, and the model was running entirely on my Mac! 🎉</p><h3>Tips and Lessons Learned</h3><p>To wrap up, here are some <strong>tips for beginners</strong> gleaned from this journey, especially for those fine-tuning LLMs on Mac hardware:</p><ul><li><strong>Environment and dependencies:</strong> Use an isolated environment (conda or venv) and install only what you need. On Apple Silicon, make sure to use a PyTorch version that supports MPS. Check with a small test that MPS is available, but be prepared to fall back to CPU if something isn’t supported. Keep an eye on the PyTorch release notes for improvements to MPS (each version has gotten better).</li><li><strong>Axolotl on Mac:</strong> Axolotl is a powerful tool and may improve Mac support over time, but currently you might encounter issues due to its expectation of NVIDIA tools. If you still want to use it, comb through the Axolotl docs and GitHub issues for Mac-specific tips. For example, they note that certain features like bitsandbytes, QLoRA, and DeepSpeed are not available on M-series Macs. You may have to disable those. Always double-check that your dataset format matches what Axolotl expects to avoid key errors.</li><li><strong>PEFT (LoRA) approach:</strong> Using Hugging Face’s PEFT library directly gives you flexibility. You can tailor the training loop, integrate custom data processing, and debug easier in a straightforward Python script. The trade-off is writing more boilerplate (loading data, writing a training loop or using Trainer). For many, the Trainer API will be sufficient and saves a lot of manual coding.</li><li><strong>Folder layout best practices:</strong> It’s easy to get confused with multiple versions of model weights flying around. I recommend organizing as follows:</li></ul><blockquote><strong>Base model folder:</strong> e.g. models/&lt;model-name&gt; containing the original model files (whether downloaded from HF or converted).</blockquote><blockquote><strong>Data folder:</strong> e.g. data/&lt;dataset-name&gt; for your training data.</blockquote><blockquote><strong>Output (LoRA) folder:</strong> to save the adapter (if using LoRA) — e.g. outputs/&lt;exp-name&gt;-lora/.</blockquote><blockquote><strong>Output (merged model) folder:</strong> e.g. outputs/&lt;exp-name&gt;-merged/.</blockquote><blockquote><strong>Converted models folder:</strong> e.g. outputs/&lt;exp-name&gt;-gguf/ or directly move to ~/.lmstudio/models/… as appropriate.</blockquote><blockquote>This separation avoids overwriting something important. Always double-check which model you’re loading or saving to avoid mixing the base and fine-tuned weights inadvertently.</blockquote><ul><li><strong>Disabling unused features:</strong> As shown, disable any external logging (unless you explicitly want it) to keep things simple. Similarly, if using the Hugging Face Trainer, set report_to=”none” (or “tensorboard” if you prefer that) to avoid W&amp;B usage. If you see tokenizer parallelism warnings, just set the env var as mentioned. These small things make the process less noisy.</li><li><strong>Know your tool versions:</strong> The ML ecosystem moves fast. By the time you read this, newer versions of Axolotl, PEFT, or PyTorch might have changed behaviors. Check the documentation for the versions you’re using. For instance, the merge_and_unload bug I faced might be fixed in a future Axolotl release. Always refer to official docs or source — many open-source projects have active Discords or forums where you can ask for Mac-specific help.</li></ul><h3>Conclusion</h3><p>Fine-tuning a large language model on a Mac <strong>is</strong> possible — and it’s incredibly rewarding to see a model trained on your own data running locally. Throughout this journey, I encountered the rough edges of tooling that wasn’t originally designed with Apple Silicon in mind. By combining the strengths of different tools — Axolotl’s inspiration and config templates, Transformers/PEFT for a custom training loop, and llama.cpp for efficient inference — I managed to create a Rust-savvy Mistral-7B that runs on my Mac Studio.</p><p><strong>Resources &amp; References:</strong></p><ul><li><strong>Axolotl (Fine-tuning toolkit):</strong> GitHub repo and docs.</li><li><strong>PEFT (LoRA by Hugging Face):</strong> PEFT library documentation — covers how to use LoRA and other efficient tuning methods.</li><li><strong>Hugging Face Transformers:</strong> The Transformers documentation for details on the Trainer, model loading, etc.</li><li><strong>llama.cpp and GGUF conversion:</strong> See llama.cpp’s README and the conversion script usage.</li><li><strong>LM Studio docs:</strong> Guide on importing models in LM Studio (folder structure expectations).</li></ul><p>Good luck with your fine-tuning experiments, and happy modeling on your Mac! 🍏🤖</p><p>Model in Hugging Face: <a href="https://huggingface.co/plawanrath/minstral-7b-rust-fine-tuned">https://huggingface.co/plawanrath/minstral-7b-rust-fine-tuned</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6ff53858e7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building and Running CodeLlama Locally on Your Mac]]></title>
            <link>https://medium.com/@plawanrath/building-and-running-codellama-locally-on-your-mac-78306f89eb57?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/78306f89eb57</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 05:28:14 GMT</pubDate>
            <atom:updated>2025-04-21T05:28:14.417Z</atom:updated>
            <content:encoded><![CDATA[<p>Getting started with large language models (LLMs) can feel daunting — between hefty hardware requirements, unfamiliar tooling, and murky setup instructions, even seasoned developers can get stuck. In this article, we’ll walk through how to run CodeLlama (7B‑instruct) on an Apple Silicon Mac using <strong>llama.cpp</strong> and <strong>Metal acceleration</strong>, then hook it up to a lightweight GUI and even generate simple diagrams via Mermaid.js. Whether you’re an AI beginner or just curious about local LLM workflows, by the end you’ll have a fully offline playground for experimentation and exploration.</p><h3>Why Run Locally?</h3><ul><li><strong>Privacy &amp; Control</strong>: Your prompts and outputs never leave your machine.</li><li><strong>Cost Efficiency</strong>: No per‑token or API fees — once set up, it’s yours to use.</li><li><strong>Performance</strong>: With Metal acceleration, Apple’s M‑series chips can rival small GPU servers.</li><li><strong>Offline Access</strong>: Tinker in coffee shops, planes, or anywhere without Internet.</li></ul><h3>Prerequisites</h3><p>Before we dive in, make sure you have Homebrew installed. Then, open your terminal and install:</p><pre>brew install cmake protobuf rust python@3.11 node</pre><p>Add Python 3.11 to your shell path:</p><pre>echo &#39;export PATH=&quot;/opt/homebrew/opt/python@3.11/bin:$PATH&quot;&#39; &gt;&gt; ~/.zprofile<br>source ~/.zprofile</pre><h3>Steps</h3><ol><li><strong>Clone and Build llama.cpp</strong></li></ol><p>The <a href="https://github.com/ggerganov/llama.cpp">llama.cpp</a> repo provides a lightweight, C/C++ implementation to run LLaMA-family models entirely on CPU or Metal.</p><pre>git clone https://github.com/ggerganov/llama.cpp.git<br>cd llama.cpp<br>mkdir build &amp;&amp; cd build</pre><p><strong>2. Enable Metal Support</strong></p><p>To leverage Apple GPUs, configure the build with LLAMA_METAL=on:</p><pre>cmake .. -DLLAMA_METAL=on<br>cmake --build . --config Release</pre><p>This produces the llama-run binary in build/bin/.</p><p><strong>3. Download the CodeLlama Model</strong></p><p>Head to Hugging Face and grab the quantized GGUF version of CodeLlama‑7B‑Instruct:</p><pre>wget \<br>  https://huggingface.co/TheBloke/CodeLlama-7B-Instruct-GGUF/\<br>resolve/main/codellama-7b-instruct.Q4_K_M.gguf \<br>  -P ~/models/codellama-7b-instruct/</pre><p><strong>Tip:</strong> The Q4_K_M quantized models strike a sweet spot between speed and quality on CPU/GPU.</p><p><strong>4. Run CodeLlama in the Terminal</strong></p><p>With your binary and model in place, launch the model:</p><pre>cd llama.cpp/build/bin<br>./llama-run \<br>  -c 16 \<br>  --temp 0.7 \<br>  --ngl 35 \<br>  ~/models/codellama-7b-instruct/codellama-7b-instruct.Q4_K_M.gguf</pre><ul><li>-c 16: Uses 16 CPU threads</li><li>--ngl 35: Allocates the first 35 layers to Metal (GPU)</li><li>--temp 0.7: Sets randomness for more creative outputs</li></ul><p>Type your prompt and watch your local LLM respond in real time!</p><p><strong>5. Add a Friendly GUI with text‑generation‑webui</strong></p><p>If you prefer a browser interface:</p><ol><li>Clone the web UI repo:</li></ol><pre>git clone https://github.com/oobabooga/text-generation-webui.git<br>cd text-generation-webui</pre><p>2. Install Python dependencies:</p><pre>pip3 install -r requirements.txt</pre><p>3. Organize models in models/ :</p><p>I prefer the following structure:</p><pre>text-generation-webui/<br>├── models/<br>│   └── codellama-python/<br>│       └── codellama-7b-python-instruct.Q4_K_M.gguf</pre><p>4. Start the server:</p><pre>python3 server.py \<br>  --model codellama-7b-instruct \<br>  --loader llama.cpp \<br>  --n-gpu-layers 35 \<br>  --n_ctx 16384</pre><p>5. Open your browser at <a href="http://localhost:7860/">http://localhost:7860/</a></p><p>Now you’ve got sliders, chat history, and file uploads — all in your browser!</p><h3>6. Generating Diagrams with Mermaid.js (Optional)</h3><p>LLMs aren’t image generators, but you can ask CodeLlama to output <strong>Mermaid</strong> syntax for flowcharts, then render them locally:</p><p>Prompt example:</p><pre>“Generate a Mermaid.js flowchart showing my CodeLlama build and run steps.”</pre><p>Install Mermaid CLI</p><pre>npm install -g @mermaid-js/mermaid-cli</pre><p><strong>Save</strong> the LLM’s output to diagram.mmdc, then render:</p><pre>mmdc -i diagram.mmdc -o diagram.svg</pre><p>Embed the resulting SVG in blog posts or documentation!</p><h3>Wrapping Up</h3><p>You’ve turned your Mac into a fully offline playground for CodeLlama — compiling native binaries, tapping Apple GPUs, driving a web UI, and even generating diagrams. From here, experiment with different quantization levels, integrate with your own apps via the HTTP API, or fine‑tune smaller models on custom data. Welcome to the world of local LLMs — lightning‑fast, private, and entirely yours to explore.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78306f89eb57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rust Playground: A Fun, Collaborative Way to Learn Rust]]></title>
            <link>https://medium.com/@plawanrath/rust-playground-a-fun-collaborative-way-to-learn-rust-d0bc59e39dfc?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0bc59e39dfc</guid>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Sun, 30 Mar 2025 23:13:39 GMT</pubDate>
            <atom:updated>2025-03-30T23:13:39.422Z</atom:updated>
            <content:encoded><![CDATA[<p>Rust is steadily growing into one of the most beloved (and in-demand) programming languages thanks to its focus on safety, performance, and concurrency. However, if you’re just getting started, Rust can sometimes feel a bit daunting — especially if you’re new to systems programming in general. That’s why I created a <strong>rust-playground</strong> in my GitHub repo:<a href="https://github.com/plawanrath/rust-basics"> plawanrath/rust-basics</a>. This playground aims to give newcomers (and even intermediate Rustaceans) a place to experiment, learn, and practice Rust in a welcoming, hands-on way.</p><p>In this article, we’ll take a closer look at what the <strong>rust-playground</strong> is, how it’s organized, and how you can use it to learn Rust — whether on your own or in a group setting with friends, classmates, or family.</p><h3>Why Rust?</h3><p>If you’re new to Rust entirely, a quick overview:</p><ul><li><strong>Memory Safety</strong>: Rust enforces strict rules around ownership and borrowing. This keeps your code safe from the dreaded segmentation faults and data races without needing a garbage collector.</li><li><strong>Performance</strong>: Rust compiles down to machine code, with zero-cost abstractions that let you write code close to the metal without sacrificing high-level expressiveness.</li><li><strong>Community &amp; Ecosystem</strong>: The Rust community emphasizes mentoring, documentation, and tools like Cargo (the Rust package manager) for a more streamlined experience.</li></ul><h3>About the Rust Playground</h3><p>The Rust Playground in my<a href="https://github.com/plawanrath/rust-basics"> rust-basics repo</a> is a dedicated folder that houses small example programs. <strong>The goal</strong> is to let you dive in right away and get started with experimenting with the language the way you prefer.</p><p>This isn’t meant to replace the official Rust documentation or more formal learning resources. Instead, it gives you a sandbox to see how Rust code behaves and to pick up good practices along the way.</p><h3>Getting Started</h3><p>Here’s how to set things up and start exploring:</p><ol><li><strong>Clone the Repo<br></strong> Open your terminal and run:</li></ol><pre>git clone https://github.com/plawanrath/rust-basics.git<br>cd rust-basics/rust-playground</pre><p><em>This will put you directly into the rust-playground folder.</em></p><p><strong>2. Make Sure You Have Rust Installed<br></strong> If you haven’t already, install Rust using<a href="https://www.rust-lang.org/tools/install"> rustup</a>:</p><pre>curl - proto &#39;=https&#39; - tlsv1.2 -sSf https://sh.rustup.rs | sh</pre><p>Then, check your installation:</p><pre>rustc - version<br>cargo - version</pre><p><strong>3. Explore the Files<br></strong> The rust-playground folder contains Rust source files (.rs) that demonstrate different features of Rust. Files might be organized by specific topics or grouped into an example-driven structure.</p><p><strong>4. Compile and Run<br></strong>This is a Cargo-based project (look for a Cargo.toml in the rust-playground folder), you can build and run directly with:</p><pre>cargo run</pre><p>This approach is handy if you have multiple source files or want to manage dependencies easily.</p><h3>What You’ll Find Inside</h3><p>Inside the <strong>rust-playground</strong>, you’ll likely see some (or all) of the following topics covered:</p><ol><li><strong>Hello, Rust! — </strong>A classic “Hello, world!” program to confirm your environment is set up correctly.</li><li><strong>Starter folder structure to organize by users — </strong>Basic setup to organize your work by users such that each user can run their own binaries.</li><li><strong>Testing — </strong>Basic tests with #[test] and how to run them with cargo test.</li></ol><h3>Tips for Collaborative Learning</h3><p>Feel free to clone this repo and use it however you like — by yourself or alongside friends and family. Here are a few suggestions:</p><ol><li><strong>Clone and Explore</strong><br> Everyone can clone the same repository so that you’re working from a common baseline.</li><li><strong>Fork or Copy for Personal Use</strong><br> If you want to customize your version, just fork the repo or copy the files, then adapt the code examples to your liking.</li><li><strong>Share Ideas with Friends</strong><br> If you’re learning Rust together, take turns modifying or extending the examples. You can even pass snippets back and forth, or compare how each person implements certain concepts.</li><li><strong>Compare Approaches</strong><br> Look at each other’s versions of a particular exercise or file, then discuss different ways to handle ownership, error handling, or concurrency.</li></ol><p>The playground is yours to explore — have fun experimenting, debugging, and creating new examples with people you enjoy coding with!Extending the Playground</p><h3>Wrapping Up</h3><p>Learning Rust doesn’t have to be intimidating. By using the <strong>rust-playground</strong> in the<a href="https://github.com/plawanrath/rust-basics"> rust-basics repository</a>, you gain a structured but flexible environment to explore the language at your own pace or with a group of fellow learners. You can try things out, break them, fix them, and experiment without fear — exactly what a playground should be!</p><p>If you’re curious about Rust or want to share a fun, safe space for coding together with friends and family, clone the playground, and let’s get started.</p><p><strong>Happy coding, and welcome to the Rustacean community!</strong></p><h3>Further Resources</h3><ul><li><a href="https://doc.rust-lang.org/book/">Official Rust Book</a> — The best place to start for a thorough introduction to Rust.</li><li><a href="https://doc.rust-lang.org/rust-by-example/">Rust By Example</a> — Helpful for those who learn best by tinkering with ready-made examples.</li><li><a href="https://doc.rust-lang.org/cargo/">Cargo Documentation</a> — Dive deeper into Rust’s package manager and project workflow.</li><li><a href="https://crates.io/">Crates.io</a> — Explore the ecosystem of published Rust libraries and frameworks.</li></ul><p>Feel free to share your thoughts, issues, or contributions on the<a href="https://github.com/plawanrath/rust-basics"> GitHub repo</a>. Let’s keep learning Rust, together!</p><h4>Thank you for reading!</h4><p>If you found this playground useful, please consider giving the repo a star on GitHub, sharing it with friends, or leaving a comment here. Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0bc59e39dfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can ChatGPT write useable Machine Learning models ?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@plawanrath/can-chatgpt-write-useable-machine-learning-models-498bd1de3e47?source=rss-1ab97931ed01------2"><img src="https://cdn-images-1.medium.com/max/1200/0*VLG0Hky9DXTfF4m1.jpg" width="1200"></a></p><p class="medium-feed-snippet">Just like everyone else in the world, I am fascinated by the possibilities that a Generative AI model like ChatGPT unlocks. It can explain&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@plawanrath/can-chatgpt-write-useable-machine-learning-models-498bd1de3e47?source=rss-1ab97931ed01------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@plawanrath/can-chatgpt-write-useable-machine-learning-models-498bd1de3e47?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/498bd1de3e47</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Sun, 16 Apr 2023 05:32:07 GMT</pubDate>
            <atom:updated>2023-04-16T05:32:07.556Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Build A Neural Network From Scratch Using PyTorch]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@plawanrath/build-a-neural-network-from-scratch-using-pytorch-e69f41fea857?source=rss-1ab97931ed01------2"><img src="https://cdn-images-1.medium.com/max/848/1*puKwuDf3y7LZqltMR5HJKQ.jpeg" width="848"></a></p><p class="medium-feed-snippet">Motivation</p><p class="medium-feed-link"><a href="https://medium.com/@plawanrath/build-a-neural-network-from-scratch-using-pytorch-e69f41fea857?source=rss-1ab97931ed01------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@plawanrath/build-a-neural-network-from-scratch-using-pytorch-e69f41fea857?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/e69f41fea857</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Mon, 03 Apr 2023 07:57:11 GMT</pubDate>
            <atom:updated>2023-04-05T15:09:15.159Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[PyTorch For Dummies]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@plawanrath/pytorch-for-dummies-a9d2cb56cfe9?source=rss-1ab97931ed01------2"><img src="https://cdn-images-1.medium.com/max/1201/1*HoU6NuIbLXRLg_-V_YalvQ.png" width="1201"></a></p><p class="medium-feed-snippet">This article goes over the basic setup and introduction to PyTorch. We will load a dataset and build and train a Neural Network model.</p><p class="medium-feed-link"><a href="https://medium.com/@plawanrath/pytorch-for-dummies-a9d2cb56cfe9?source=rss-1ab97931ed01------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@plawanrath/pytorch-for-dummies-a9d2cb56cfe9?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9d2cb56cfe9</guid>
            <category><![CDATA[pytorch-tutorial]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 04:28:14 GMT</pubDate>
            <atom:updated>2023-03-27T04:31:18.355Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[French Conjugations using Python]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@plawanrath/french-conjugations-using-python-8361d6e71050?source=rss-1ab97931ed01------2"><img src="https://cdn-images-1.medium.com/max/2600/0*-bYTL_UrqAP6QFJy" width="5184"></a></p><p class="medium-feed-snippet">I have been learning French lately and I was looking to simplify my learning of french conjugations. I usually go to my favorite French&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@plawanrath/french-conjugations-using-python-8361d6e71050?source=rss-1ab97931ed01------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@plawanrath/french-conjugations-using-python-8361d6e71050?source=rss-1ab97931ed01------2</link>
            <guid isPermaLink="false">https://medium.com/p/8361d6e71050</guid>
            <category><![CDATA[french]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[language-learning]]></category>
            <dc:creator><![CDATA[Plawan Rath]]></dc:creator>
            <pubDate>Mon, 28 Sep 2020 00:34:45 GMT</pubDate>
            <atom:updated>2020-09-28T00:34:45.372Z</atom:updated>
        </item>
    </channel>
</rss>