<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gokul G</title>
    <description>The latest articles on DEV Community by Gokul G (@gokul_g).</description>
    <link>https://dev.to/gokul_g</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4234399%2F98d2c8ea-e9c7-4f57-b20b-657fcd0fbc3b.jpg</url>
      <title>DEV Community: Gokul G</title>
      <link>https://dev.to/gokul_g</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gokul_g"/>
    <language>en</language>
    <item>
      <title>Compute Is the New Wealth: What If Developers Could Pool Their GPUs?</title>
      <dc:creator>Gokul G</dc:creator>
      <pubDate>Sun, 29 Nov 2026 17:05:05 +0000</pubDate>
      <link>https://dev.to/gokul_g/compute-is-the-new-wealth-what-if-developers-could-pool-their-gpus-3im1</link>
      <guid>https://dev.to/gokul_g/compute-is-the-new-wealth-what-if-developers-could-pool-their-gpus-3im1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftse2.mm.bing.net%2Fth%2Fid%2FOIP.nL7MN_IadFjdqB1nj3ffJAAAAA%3Fr%3D0%26rs%3D1%26pid%3DImgDetMain%26o%3D7%26rm%3D3" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftse2.mm.bing.net%2Fth%2Fid%2FOIP.nL7MN_IadFjdqB1nj3ffJAAAAA%3Fr%3D0%26rs%3D1%26pid%3DImgDetMain%26o%3D7%26rm%3D3" alt="Image" width="320" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Compute is becoming one of the most valuable resources in the AI era.&lt;/p&gt;

&lt;p&gt;The companies with access to massive GPU clusters have a significant advantage. They can train, fine-tune, and serve models at a scale that most individual developers simply cannot afford. But I think there is another side to this story that is worth exploring.&lt;/p&gt;

&lt;p&gt;Not every developer needs a data center. Some developers already have GPUs sitting on their desks.&lt;/p&gt;

&lt;p&gt;A gaming laptop with an RTX 3050, an RTX 3070 desktop, or even a newer GPU might be enough to run several useful local AI workloads. With quantization and optimized inference engines, it is possible to run models that would otherwise require much more powerful hardware.&lt;/p&gt;

&lt;p&gt;But there is still a limitation: these resources are isolated.&lt;/p&gt;

&lt;p&gt;A developer might have a GPU that is sitting idle most of the day, while another developer on the same team struggles to run a local model because they don't have GPU hardware.&lt;/p&gt;

&lt;p&gt;What if we could share these resources?&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea behind GPU pooling
&lt;/h2&gt;

&lt;p&gt;I am not trying to compete with large cloud providers or build a distributed GPU cluster capable of training massive models. That is a completely different problem.&lt;/p&gt;

&lt;p&gt;Instead, I built &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; for a smaller, more practical use case: allowing a group of developers to share their GPU resources securely within a workspace.&lt;/p&gt;

&lt;p&gt;Consider a team of three developers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User A owns a machine with an RTX 3070.&lt;/li&gt;
&lt;li&gt;User B owns a machine with an RTX 3050.&lt;/li&gt;
&lt;li&gt;User C doesn't have a GPU.
Today, User A and User B can run local models on their machines, but User C cannot easily access those resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With Swago Bridge, User A and User B can register their machines into a shared workspace. User C can then send inference requests through an API without needing a GPU on their own machine.&lt;/p&gt;

&lt;p&gt;The GPUs remain on their respective machines. Swago Bridge connects these resources and makes them accessible through a shared API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foxj8lvqfo1usfelfvckg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foxj8lvqfo1usfelfvckg.png" alt="Image" width="780" height="678"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt;?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; is a lightweight GPU resource-sharing layer for developers.&lt;/p&gt;

&lt;p&gt;It lets developers register their local machines into a workspace and expose their locally running AI inference engines through a centralized API.&lt;/p&gt;

&lt;p&gt;The coordinator acts as the entry point for API requests, while the node agents manage the communication between the coordinator and the machines hosting the models.&lt;/p&gt;

&lt;p&gt;The architecture looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    C[Developer without GPU] --&amp;gt; API[Swago Coordinator]
    API --&amp;gt; W[Workspace and Routing]
    W --&amp;gt; N1[Node 1 - RTX 3070]
    W --&amp;gt; N2[Node 2 - RTX 3050]
    W --&amp;gt; N3[Node 3 - RTX 4070]
    N1 --&amp;gt; M1[Local Model]
    N2 --&amp;gt; M2[Local Model]
    N3 --&amp;gt; M3[Local Model]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Each node is a developer's machine, which could be a desktop, laptop, or even a server.&lt;/p&gt;

&lt;p&gt;The coordinator manages workspace membership, node availability and request routing. The node agent communicates with the local inference engine and executes the requests routed to it.&lt;/p&gt;

&lt;p&gt;The goal is to make these resources feel like a shared inference pool rather than separate machines.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Workspaces: the foundation of resource sharing
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; is designed around workspaces.&lt;/p&gt;

&lt;p&gt;Rather than allowing every registered machine to become globally accessible, nodes belong to a workspace. This gives developers a way to organize and control which machines participate in a shared resource pool.&lt;/p&gt;

&lt;p&gt;A developer can create a workspace and invite other machines to participate in it.&lt;/p&gt;

&lt;p&gt;For example, a workspace could contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Windows machine running Ollama.&lt;/li&gt;
&lt;li&gt;A Linux machine running vLLM.&lt;/li&gt;
&lt;li&gt;A desktop running another OpenAI-compatible inference server.
Each node registers into the workspace using a key issued from the workspace.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows the coordinator to identify which workspace a node belongs to and which nodes are eligible for routing.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How does a node enroll?
&lt;/h2&gt;

&lt;p&gt;I wanted the enrollment process to be simple enough that a developer doesn't need to configure an entire distributed infrastructure just to share their GPU.&lt;/p&gt;

&lt;p&gt;The enrollment process follows a few steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Create a workspace&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The workspace creator creates a workspace in the &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; console.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Generate a key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The workspace creator generates a key from the console. Keys can be revoked immediately if a machine should no longer participate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Configure the node&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The developer installs the node agent on their machine and saves the key once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;swago-gpu-agent config add-authtoken &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;YOUR_API_KEY&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Start the node agent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;swago-gpu-agent start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The node agent connects out to the coordinator and registers itself. No inbound firewall ports are needed, which matters for laptops and home networks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Discover local inference engines&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The node agent detects supported local inference engines and their available models.&lt;/p&gt;

&lt;p&gt;Supported engines include Ollama, llama.cpp and vLLM, along with other compatible inference servers.&lt;/p&gt;

&lt;p&gt;Once the node is registered and healthy, the coordinator can consider it for incoming requests.&lt;/p&gt;

&lt;p&gt;The experience I wanted is simple: configure the key, start the agent, and let &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; handle the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Local inference engines
&lt;/h2&gt;

&lt;p&gt;I didn't want &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; to become another model inference engine.&lt;/p&gt;

&lt;p&gt;There are already excellent projects solving that problem.&lt;/p&gt;

&lt;p&gt;Instead, &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; works as an integration layer that connects existing inference engines to a shared workspace.&lt;/p&gt;

&lt;p&gt;A developer could already be running a model through Ollama, llama.cpp or vLLM. The node agent connects to that running instance and exposes its capabilities to the coordinator.&lt;/p&gt;

&lt;p&gt;This separation is important.&lt;/p&gt;

&lt;p&gt;The inference engine is responsible for loading models, managing GPU memory, executing inference and generating tokens.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; is responsible for node registration, workspace management, communication, routing and making those resources accessible to other authorized members.&lt;/p&gt;

&lt;p&gt;That means developers can continue using the inference stack they prefer without having to change how they run their models.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. OpenAI-compatible API
&lt;/h2&gt;

&lt;p&gt;One of the things I wanted to avoid was introducing another proprietary API that developers would have to learn.&lt;/p&gt;

&lt;p&gt;The coordinator exposes an OpenAI-compatible API interface, making it easier to integrate with existing applications, SDKs and tools that support the standard API format.&lt;/p&gt;

&lt;p&gt;For example, a developer can configure an application with the &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; endpoint instead of pointing it directly to a local inference server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://bend.theswagostack.in/v1/chat/completions \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Authorization: Bearer YOUR_API_KEY"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "model": "qwen2.5:1.5b",
    "messages": [
      {
        "role": "user",
        "content": "Explain Java virtual threads"
      }
    ],
    "stream": false
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set &lt;code&gt;"stream": true&lt;/code&gt; and the response is delivered as Server-Sent Events, token by token.&lt;/p&gt;

&lt;p&gt;The coordinator receives the request, identifies the workspace, selects an appropriate available node and forwards the request to the node hosting the requested model.&lt;/p&gt;

&lt;p&gt;The response is then returned to the client.&lt;/p&gt;

&lt;p&gt;From the client's perspective, it interacts with an API endpoint rather than directly communicating with another developer's machine.&lt;/p&gt;

&lt;p&gt;This is one of the reasons I think API compatibility matters. Developers should be able to experiment with shared inference without rewriting their applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What happens when a request arrives?
&lt;/h2&gt;

&lt;p&gt;At a high level, the request lifecycle looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The client sends a request to the coordinator.&lt;/li&gt;
&lt;li&gt;The coordinator authenticates the API request and identifies the workspace.&lt;/li&gt;
&lt;li&gt;The coordinator identifies nodes that can serve the requested model.&lt;/li&gt;
&lt;li&gt;It selects an eligible node based on availability and routing policies.&lt;/li&gt;
&lt;li&gt;The node agent forwards the request to its local inference engine.&lt;/li&gt;
&lt;li&gt;The inference engine generates the response.&lt;/li&gt;
&lt;li&gt;The response is returned through the coordinator to the client.
Routing has to consider more than whether a node is online. GPU memory, model availability, active requests, queue length, latency and node health can all influence the decision. For example, a node that already has the requested model loaded in VRAM can answer immediately, while a node that has to load it first makes the user wait.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is where the project becomes more interesting from an engineering perspective.&lt;/p&gt;

&lt;p&gt;Finding a node is relatively straightforward. Managing a pool of heterogeneous machines and routing requests without making the system unreliable is a much harder problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. What GPU pooling actually means here
&lt;/h2&gt;

&lt;p&gt;I want to be clear about what I mean by GPU pooling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; does not combine the physical GPU memory of multiple machines into one unified GPU or make a model that cannot fit on any individual GPU automatically fit across all of them.&lt;/p&gt;

&lt;p&gt;That would require a different distributed inference architecture.&lt;/p&gt;

&lt;p&gt;The goal is to pool inference capacity, not GPU memory.&lt;/p&gt;

&lt;p&gt;If three machines are running compatible models, the coordinator can distribute independent inference requests across those machines, subject to their availability and capabilities.&lt;/p&gt;

&lt;p&gt;For example, if several developers are using the same model for different requests, those requests could be routed to different nodes.&lt;/p&gt;

&lt;p&gt;This can improve resource utilization when the workloads are suitable and the nodes are available.&lt;/p&gt;

&lt;p&gt;But it doesn't mean that a single inference request will automatically become faster by using multiple GPUs across multiple machines.&lt;/p&gt;

&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Security and trust
&lt;/h2&gt;

&lt;p&gt;Sharing GPU resources between developers introduces security concerns that cannot be ignored.&lt;/p&gt;

&lt;p&gt;A node is essentially allowing another system to send inference requests to its local model. That means the node owner should have control over what is exposed and how it is used.&lt;/p&gt;

&lt;p&gt;Workspace membership alone should not be treated as a complete security boundary.&lt;/p&gt;

&lt;p&gt;The areas &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; needs to address include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node-specific credentials that can be revoked.&lt;/li&gt;
&lt;li&gt;Workspace-level authorization.&lt;/li&gt;
&lt;li&gt;Secure communication between nodes and the coordinator.&lt;/li&gt;
&lt;li&gt;No unrestricted access to the host machine through the node agent.&lt;/li&gt;
&lt;li&gt;Restricted access to local inference endpoints.&lt;/li&gt;
&lt;li&gt;Resource limits and request quotas.&lt;/li&gt;
&lt;li&gt;Node owners being able to stop or disconnect their nodes.&lt;/li&gt;
&lt;li&gt;Monitoring and visibility into requests and resource utilization.
The node agent should only expose the inference capabilities that the owner explicitly allows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It should never become a general-purpose remote access mechanism to the host machine. This is also why the node agent is open source under the MIT License: if it runs on your machine, you should be able to read exactly what it does.&lt;/p&gt;

&lt;p&gt;This is particularly important when nodes belong to different people rather than a single organization.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Where this could be useful
&lt;/h2&gt;

&lt;p&gt;I think this approach could be useful in smaller developer communities, student teams, research groups and people experimenting with local AI.&lt;/p&gt;

&lt;p&gt;Imagine a group of developers who each have different hardware.&lt;/p&gt;

&lt;p&gt;Instead of every developer independently purchasing hardware or depending entirely on external APIs, they could share their available inference capacity for workloads that make sense.&lt;/p&gt;

&lt;p&gt;It could also be useful for experimenting with local AI development environments, internal tools, prototyping and lightweight inference workloads.&lt;/p&gt;

&lt;p&gt;There are still plenty of constraints around bandwidth, uptime, model compatibility and resource contention. This isn't a replacement for dedicated infrastructure when reliability or performance requirements are high.&lt;/p&gt;

&lt;p&gt;But for experimentation and collaborative development, I think the idea is worth exploring.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Where &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; stands today
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; already has the core components of this architecture in place.&lt;/p&gt;

&lt;p&gt;The coordinator handles workspace-based node enrollment and provides an OpenAI-compatible API. Nodes can connect through the node agent, discover supported local inference engines, and expose their available models to the workspace.&lt;/p&gt;

&lt;p&gt;The system also includes model-aware routing, request handling, streaming support and node health monitoring, allowing the coordinator to route requests to participating nodes.&lt;/p&gt;

&lt;p&gt;Secure node communication and workspace-based access are also part of the architecture, with the aim of making resource sharing manageable without exposing the underlying machines directly.&lt;/p&gt;

&lt;p&gt;There is still room to improve scheduling, resource utilization and the overall experience as the number of participating nodes grows. But the core idea is already working as an implementation rather than just an architectural proposal.&lt;/p&gt;

&lt;p&gt;What interests me most now is how this approach behaves as more machines with different hardware, model configurations and availability patterns join the same workspace.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Current limitations
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; is useful today, but it has real limits, and it's better to state them clearly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inference capacity is pooled, not GPU memory.&lt;/strong&gt; A model that doesn't fit on any single machine still won't run. Adding nodes lets more requests run in parallel, but it doesn't make one request faster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability depends on the owners' machines.&lt;/strong&gt; Laptops sleep, desktops reboot and home networks drop. A pool made of personal hardware will never be as reliable as a data center.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every request takes an extra hop.&lt;/strong&gt; Traffic goes client → coordinator → node → inference engine and back. That adds latency compared with calling a local model directly, which matters most for short prompts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The coordinator is a central point.&lt;/strong&gt; Nodes connect to it, so if it goes down, the workspace is unreachable even when every GPU is healthy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompts pass through other people's machines.&lt;/strong&gt; In a workspace shared between different people, the node owner's machine processes the prompt. Workspaces work best among people who trust each other, and sensitive data needs extra thought.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Models must already be available on a node.&lt;/strong&gt; &lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; routes to what nodes have installed. It doesn't pull or manage models for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model choice is manual.&lt;/strong&gt; The client names the model it wants, and the coordinator doesn't yet decide which model suits a given task.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Platform coverage is still growing.&lt;/strong&gt; The node agent has mostly been used on Windows so far, and other platforms need more real-world testing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Heterogeneous hardware is lightly tested.&lt;/strong&gt; I've only had a small number of nodes with different GPUs, so behavior at larger scale is still an open question.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  11. Future experiments
&lt;/h2&gt;

&lt;p&gt;These are the directions I want to explore next. Some will become features, and some may turn out not to be worth it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smarter routing&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A router model:&lt;/strong&gt; a fast, lightweight layer that picks the right small or medium model for each task, so simple requests don't use a bigger model than they need.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A scoring function for node selection:&lt;/strong&gt; combining model fit, whether the model is already loaded in VRAM, current load and recent latency, instead of simple availability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Routing decisions as data:&lt;/strong&gt; logging each decision with its outcome (latency, tokens, errors) so a learned router can be trained from real traffic later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cascade routing:&lt;/strong&gt; trying a smaller model first and escalating only when the answer looks weak, and measuring whether the savings are worth the extra latency.
&lt;strong&gt;Reliability&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request queuing and backpressure:&lt;/strong&gt; what should happen when every node is busy?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failover during streaming:&lt;/strong&gt; if a node disappears mid-response, can the request recover cleanly?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Behavior under churn:&lt;/strong&gt; how the pool performs when nodes join, leave and sleep unpredictably.
&lt;strong&gt;Trust and privacy&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finer node-owner controls:&lt;/strong&gt; allowlists for which models and which workspace members a node serves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clearer trust models:&lt;/strong&gt; separate setups for a trusted team workspace and a more open shared pool.
&lt;strong&gt;Measurement&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Benchmarks:&lt;/strong&gt; time to first token, tokens per second and throughput per node, compared against a single machine running the same model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scale tests:&lt;/strong&gt; adding more nodes with different GPUs to see where scheduling starts to break down.
&lt;strong&gt;Longer-term research&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Splitting one model across machines:&lt;/strong&gt; a different problem from pooling capacity, with its own network and synchronization costs. I'd treat it as a separate experiment rather than a feature.
I'd rather learn these things in the open and report what works and what doesn't than promise a roadmap.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Compute is becoming an important resource in AI development, and access to it isn't equal.&lt;/p&gt;

&lt;p&gt;While large organizations will continue to operate massive GPU infrastructure, there is also an opportunity to make smaller, distributed resources more useful.&lt;/p&gt;

&lt;p&gt;Many developers already own capable GPUs. Those resources are often isolated, and I think there is an interesting opportunity to connect them in a practical and secure way.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sbridge.theswagostack.in/" rel="noopener noreferrer"&gt;Swago Bridge&lt;/a&gt; is my implementation of that idea. It's live, and I'm learning from it as more machines join.&lt;/p&gt;

&lt;p&gt;Not by building another cloud provider, but by making locally available GPU resources easier to share among developers.&lt;/p&gt;

&lt;p&gt;The idea is simple. The engineering challenges are not.&lt;/p&gt;

&lt;p&gt;And that's exactly what makes it interesting to build.&lt;/p&gt;




&lt;p&gt;This isn't the end of the story. If you see another use case for Swago Bridge, or a way it could be better, drop a comment. I'd love to hear your perspective, and I'm always up for a new challenge.&lt;/p&gt;

&lt;p&gt;Curious what else I'm building? Step into &lt;a href="https://theswagostack.in/" rel="noopener noreferrer"&gt;The Swago Stack&lt;/a&gt;, my small lab where side quests get promoted to main quests. It's a digital wardrobe of every project I've made, and each one scratches an itch I've had or know is coming.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>llm</category>
      <category>devops</category>
    </item>
    <item>
      <title>Rethinking Code Retrieval</title>
      <dc:creator>Gokul G</dc:creator>
      <pubDate>Mon, 09 Nov 2026 18:07:07 +0000</pubDate>
      <link>https://dev.to/gokul_g/rethinking-code-retrieval-2a86</link>
      <guid>https://dev.to/gokul_g/rethinking-code-retrieval-2a86</guid>
      <description>&lt;p&gt;Recently, I came across a YouTube thumbnail that said, "Why Grep is better than Vector Search."&lt;/p&gt;

&lt;p&gt;That caught my attention.&lt;/p&gt;

&lt;p&gt;Over the past few weeks, I've also been running into several articles, videos, and discussions around search algorithms, code retrieval, and optimization techniques for AI agents.&lt;/p&gt;

&lt;p&gt;It made me curious.&lt;/p&gt;

&lt;p&gt;How much does the way we retrieve information actually impact an AI agent's performance? Are we overcomplicating code retrieval with sophisticated approaches when simpler, well-engineered search techniques could do the job better?&lt;/p&gt;

&lt;p&gt;That curiosity wouldn't let me sit still. I spent hours reading, experimenting, and understanding different approaches to information retrieval.&lt;/p&gt;

&lt;p&gt;Well, curiosity needed a victim, and this time it was my keyboard. I decided to build an efficient code search adapter for agentic AI.&lt;/p&gt;

&lt;p&gt;But there was another thought that kept coming back to me while working on this project.&lt;/p&gt;

&lt;p&gt;Remember the days when memory was scarce and developers were extremely conscious of how much memory their applications consumed?&lt;/p&gt;

&lt;p&gt;Every allocation mattered. Developers thought carefully about data structures, algorithms, and unnecessary computation.&lt;/p&gt;

&lt;p&gt;By the way, I genuinely believe that's one of the reasons much of the older software felt incredibly fast. Resource constraints forced engineers to be intentional about efficiency.&lt;/p&gt;

&lt;p&gt;Today, we have significantly more computing power, but we're facing a different kind of constraint when building AI applications: &lt;strong&gt;&lt;em&gt;context&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;An AI agent might have access to an entire repository, but that doesn't mean we should dump hundreds of files into its context window.&lt;/p&gt;

&lt;p&gt;We need to retrieve the right information, rank it intelligently, and provide it within a limited token budget.&lt;/p&gt;

&lt;p&gt;And that brings me back to the fundamental question:&lt;/p&gt;

&lt;p&gt;Can we build a lightweight, efficient code retrieval engine that gives AI agents exactly what they need, without overwhelming them with unnecessary information?&lt;/p&gt;

&lt;p&gt;That's what I wanted to experiment with. Here's how I approached it.&lt;/p&gt;

&lt;p&gt;Rather than jumping straight into the implementation, I started with a few small experiments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Experiment 1: Building a Trigram Index&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://grokipedia.com/page/Trigram" rel="noopener noreferrer"&gt;What is trigram?&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My first experiment was to understand how trigram-based searching works.&lt;/p&gt;

&lt;p&gt;I followed these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Created a function to extract trigrams from a given word.&lt;/li&gt;
&lt;li&gt;Generated a trigram-to-document mapping using a collection of sample sentences. &lt;/li&gt;
&lt;li&gt;Tested the mapping with simple search queries. &lt;/li&gt;
&lt;li&gt;Implemented an index-based search function using the generated trigram map.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The basic idea was to avoid scanning every document for every query.&lt;/p&gt;

&lt;p&gt;Instead, the index would identify potential matching documents using their shared trigrams, reducing the search space before performing the actual verification.&lt;/p&gt;

&lt;p&gt;Once the basic implementation worked, I wanted to understand how it behaved with a larger dataset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Experiment 2: Index Search vs. Full Scan&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I generated 100,000 random sentences and intentionally inserted a rare word, zebracrossing, at document position 54,321.&lt;/p&gt;

&lt;p&gt;The objective was to compare my custom trigram index against a straightforward full scan.&lt;/p&gt;

&lt;p&gt;Here are the results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[54321]
[54321]

rare:   scan 12 ms, index 0 ms, same result: true
rare:   scan  3 ms, index 0 ms, same result: true
rare:   scan 11 ms, index 0 ms, same result: true

common: scan 14 ms, index 24 ms, same result: 32078 vs 32078
common: scan  3 ms, index 18 ms, same result: 32078 vs 32078
common: scan  3 ms, index 20 ms, same result: 32078 vs 32078
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before comparing performance, I first verified that both approaches returned exactly the same result. As expected, both the full scan and my trigram index located the rare word at position 54321. The same correctness check held for the common query, with both approaches returning 32,078 matches. This gave me confidence that I was comparing search performance rather than different search results.&lt;/p&gt;

&lt;p&gt;An interesting observation emerged.&lt;/p&gt;

&lt;p&gt;For rare terms, my custom index function clearly outperformed a full scan.&lt;/p&gt;

&lt;p&gt;However, for common terms, my custom index lost the battle. Why?&lt;/p&gt;

&lt;p&gt;For a common term, my custom index retuned a large candidate set. The search engine had to process and verify those candidate to identify the actual matches.&lt;/p&gt;

&lt;p&gt;In this situation, the overhead of retriving and filtering candidates was the greater than simple scanning the documents.&lt;/p&gt;

&lt;p&gt;My realization here is, an index doesn't automatically make the query faster&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Experiment 3: The smart search way&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What makes this search smarter is here I have implemented the concept called selectivity which is commonly used in database systems.&lt;/p&gt;

&lt;p&gt;If trigram occurence is below 10% of the total documents, use the index.&lt;br&gt;
If trigram occurrence exceeds 10% of the total documents, use the default scan.&lt;br&gt;
Here my intention is to avoid spending more computation time on processing a larger candidate where the full scan will outperform.&lt;/p&gt;

&lt;p&gt;Here are the results&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---- smart search benchmarks ----

[54321]
true
true

zebracrossing: scan 3 ms, index 0 ms, smart 0 ms
zebracrossing: scan 4 ms, index 0 ms, smart 0 ms
zebracrossing: scan 3 ms, index 0 ms, smart 0 ms

retry: scan 5 ms, index 14 ms, smart 5 ms
retry: scan 5 ms, index 14 ms, smart 5 ms
retry: scan 6 ms, index 14 ms, smart 5 ms

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The adaptive strategy worked as expected in this experiment. For rare terms it used the custom index and for common terms it switched to a full scan.&lt;/p&gt;

&lt;p&gt;This gave me an interesting takeaway: the fallback threshold is a tuning parameter. It can be adjusted experimentally to find the point where index-based retrieval stops being beneficial.&lt;/p&gt;

&lt;p&gt;This is closely related to selectivity estimation and access-path selection in database query optimizers.&lt;/p&gt;

&lt;p&gt;Of course, 10% is currently just an experimental threshold, not a universally optimal value.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small experiment, a bigger question
&lt;/h2&gt;

&lt;p&gt;What started as a simple search experiment gradually turned into a much bigger engineering question.&lt;/p&gt;

&lt;p&gt;How do we build a retrieval system that doesn't just find matching code, but also understands which results are worth returning to an AI agent?&lt;/p&gt;

&lt;p&gt;Search latency is only one part of the problem. Retrieval quality, relevance, and context consumption matter just as much.&lt;/p&gt;

&lt;p&gt;I started moving beyond synthetic datasets and began experimenting with an actual open-source repository: &lt;strong&gt;Spring Batch&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's where things started getting interesting.&lt;/p&gt;

&lt;p&gt;I'll cover those experiments, the benchmark results, and the engineering decisions behind the retrieval strategy in the next part.&lt;/p&gt;

&lt;p&gt;For now, I'm leaving you with one question:&lt;/p&gt;

&lt;p&gt;When building retrieval systems for AI agents, should we always reach for sophisticated search techniques, or should we first get the fundamentals right?&lt;/p&gt;

&lt;p&gt;P.S. Please excuse any spelling mistakes or grammatical imperfections. I'm still learning, and writing is part of that journey! 😊&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>java</category>
      <category>rag</category>
    </item>
  </channel>
</rss>
