<?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 Binita Bharati on Medium]]></title>
        <description><![CDATA[Stories by Binita Bharati on Medium]]></description>
        <link>https://medium.com/@binitabharati?source=rss-36749511fb38------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*MHdnpOCDz19KDr2z.png</url>
            <title>Stories by Binita Bharati on Medium</title>
            <link>https://medium.com/@binitabharati?source=rss-36749511fb38------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 08:05:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@binitabharati/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[Teaching Qwen Coder to Write Files: Bridging the Gap Between LLM Output and Tool Execution]]></title>
            <link>https://medium.com/@binitabharati/teaching-qwen-coder-to-write-files-bridging-the-gap-between-llm-output-and-tool-execution-06046a1017de?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/06046a1017de</guid>
            <category><![CDATA[open-code]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[calling-tool]]></category>
            <category><![CDATA[qwen25-coder]]></category>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 14:19:17 GMT</pubDate>
            <atom:updated>2026-11-15T16:17:43.319Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is this about ?</h3><p><strong>A coding LLM can generate code, but generating code and actually creating or modifying files are two different things. Tool calling bridges that gap.</strong></p><p>This blog is a sequel to these other blogs:</p><p><a href="https://medium.com/@binitabharati/llama-cpp-on-linux-installing-and-enabling-nvidia-gpu-acceleration-on-ubuntu-24-04-acf1633ae209">Running llama.cpp on Linux</a></p><p><a href="https://medium.com/@binitabharati/your-ide-your-ai-bringing-local-llms-to-intellij-ee3df32daef0">IntelliJ with Local LLM on Mac</a></p><h4><strong>What is tool calling?</strong></h4><p>An LLM normally receives a prompt and generates a text response. For example:</p><blockquote><em>Create a file named </em><em>hello.txt containing &quot;Hello World&quot;.</em></blockquote><p>A normal text-generation response might simply be:</p><blockquote>Hello World</blockquote><p>The model has generated the requested content, but it hasn’t actually created a file.</p><p>Tool calling changes this interaction. Instead of merely responding with text, the model can request that an external function be executed.</p><p>For example, it might request:</p><pre>{<br>  &quot;name&quot;: &quot;write_file&quot;,<br>  &quot;arguments&quot;: {<br>    &quot;path&quot;: &quot;hello.txt&quot;,<br>    &quot;content&quot;: &quot;Hello World&quot;<br>  }<br>}</pre><p>This is a request to invoke a tool, not the file-writing operation itself.</p><h4><strong>What is a tool?</strong></h4><p>A tool is an external function or capability that an application makes available to an LLM.</p><p>The LLM doesn’t necessarily have direct access to the filesystem, terminal, database, or browser. Instead, the application provides tools that allow it to interact with those resources.</p><h4>What is an application?</h4><p>The application sends prompts and <strong>available tool definitions</strong> to the LLM. Based on the LLM’s response, the application may execute the requested tools, return their results to the LLM, and continue the interaction until the task is completed.</p><p>So, as we can see, LLM is not aware of the tool definitions that an application has. But, it is the application itself that advertises its capabilities/tools to the LLM.</p><h4>Is the tool names standardized ?</h4><p>Tool calling provides a standardized mechanism for an LLM to request external operations, but the actual tools, their names, and their capabilities are defined by the application or the tool provider.</p><p>For more details, please refer to <a href="https://developers.openai.com/api/docs/guides/function-calling?strict-mode=disabled&amp;utm_source=chatgpt.com">OpenAI — Function Calling Guide</a>.</p><p>OpenAI-compatible function calling provides a common interface for applications and LLMs to exchange tool definitions, invocation requests and execution results. This makes it possible to integrate different models and inference servers with applications that understand the same API convention, provided the model and server correctly support the required tool-calling behavior. Also, it does not mean that Open AI standards is only for OpenAI LLMs. Same standard is also implemented by other open source LLMs.</p><p>Lets consider two application A and B that interact with the same LLM.</p><p>Application A may define a tool to write file like below:</p><pre>{<br>  &quot;name&quot;: &quot;write&quot;,<br>  &quot;arguments&quot;: {<br>    &quot;filePath&quot;: &quot;hello.txt&quot;,<br>    &quot;content&quot;: &quot;Hello World&quot;<br>  }<br>}</pre><p>Application B may define a tool to write file like below:</p><pre>{<br>  &quot;name&quot;: &quot;write_file&quot;,<br>  &quot;arguments&quot;: {<br>    &quot;path&quot;: &quot;hello.txt&quot;,<br>    &quot;content&quot;: &quot;Hello World&quot;<br>  }<br>}</pre><p>Although the tool names and parameter names differ, both applications can use the same standardized function-calling structure to communicate with an LLM. The application provides its tool definitions to the LLM, allowing the LLM to generate requests that match the tools available in that application.</p><p>In other words, the communication mechanism is standardized, but the tools, their names, parameters and implementations are application-specific.</p><h3>Under the hood</h3><p>As described <a href="https://medium.com/@binitabharati/your-ide-your-ai-bringing-local-llms-to-intellij-ee3df32daef0">here</a>, I was trying to use Qwen-2.5-Coder LLM to generate my code. Code generation was working fine in terms of returning response. Whole source code files was being spitted out.</p><p>However, I wanted the response to be saved in the source code files automatically, instead of me manually copy pasting the relevant output from the response. So, I tried to provide relevant prompt like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ry97kTIcZjlHJLH3MCHzFQ.png" /></figure><p>I soon realized that the prompt was not being exactly honored, since no file named tool-test.txt was getting created under my project. Also, instead of the ACP agent (OpenCode) really doing its supposed work, which is writing into a file, the raw response from the LLM was being sent to the ACP client (IntelliJ AI chat).</p><p>On digging further, I got to know that the model bartowski/Qwen2.5-Coder-14B-Instruct-GGUF:Q4_K_M itself was not honoring the contract that OpenCode advertised about its tooling capabilities.</p><p>This was analyzed by invoking the Open AI standardized /chat/completions API with the below payload:</p><pre>{<br>  &quot;model&quot;: &quot;bartowski/Qwen2.5-Coder-14B-Instruct-GGUF:Q4_K_M&quot;,<br>  &quot;messages&quot;: [<br>    {<br>      &quot;role&quot;: &quot;user&quot;,<br>      &quot;content&quot;: &quot;Create a file named hello.txt containing Hello World.&quot;<br>    }<br>  ],<br>  &quot;tools&quot;: [<br>    {<br>      &quot;type&quot;: &quot;function&quot;,<br>      &quot;function&quot;: {<br>        &quot;name&quot;: &quot;write_file&quot;,<br>        &quot;description&quot;: &quot;Create or overwrite a file with the supplied content.&quot;,<br>        &quot;parameters&quot;: {<br>          &quot;type&quot;: &quot;object&quot;,<br>          &quot;properties&quot;: {<br>            &quot;path&quot;: {<br>              &quot;type&quot;: &quot;string&quot;<br>            },<br>            &quot;content&quot;: {<br>              &quot;type&quot;: &quot;string&quot;<br>            }<br>          },<br>          &quot;required&quot;: [&quot;path&quot;, &quot;content&quot;]<br>        }<br>      }<br>    }<br>  ],<br>  &quot;tool_choice&quot;: &quot;auto&quot;,<br>  &quot;stream&quot;: false,<br>  &quot;temperature&quot;: 0<br>}</pre><p>The part of response that matters looks like below:</p><pre> &quot;choices&quot;: [<br>        {<br>            &quot;finish_reason&quot;: &quot;stop&quot;,<br>            &quot;index&quot;: 0,<br>            &quot;message&quot;: {<br>                &quot;role&quot;: &quot;assistant&quot;,<br>                &quot;content&quot;: &quot;&lt;tools&gt;\n{\n  \&quot;name\&quot;: \&quot;write_file\&quot;,\n  \&quot;arguments\&quot;: {\n    \&quot;path\&quot;: \&quot;hello.txt\&quot;,\n    \&quot;content\&quot;: \&quot;Hello World\&quot;\n  }\n}\n&lt;/tools&gt;&quot;<br>            }<br>        }<br>    ]</pre><p>This should actually look like this:</p><pre>&quot;choices&quot;: [ <br>{<br>  &quot;message&quot;: {<br>    &quot;role&quot;: &quot;assistant&quot;,<br>    &quot;tool_calls&quot;: [<br>      {<br>        &quot;type&quot;: &quot;function&quot;,<br>        &quot;function&quot;: {<br>          &quot;name&quot;: &quot;write_file&quot;,<br>          &quot;arguments&quot;: &quot;{\&quot;path\&quot;:\&quot;hello.txt\&quot;,\&quot;content\&quot;:\&quot;Hello World\&quot;}&quot;<br>        }<br>      }<br>    ]<br>  },<br>  &quot;finish_reason&quot;: &quot;tool_calls&quot;<br>}<br>]</pre><p>Let’s check the same /chat/completions with another LLM. So, instead of using qwen coder LLM, we will use bartowski/Meta-Llama-3.1–8B-Instruct-GGUF:Q4_K_M . So, we will need to restart llama.ccp with this model name keeping all other start up configs unaltered. For more info on my local LLM set up, please check <a href="https://medium.com/@binitabharati/llama-cpp-on-linux-installing-and-enabling-nvidia-gpu-acceleration-on-ubuntu-24-04-acf1633ae209">this</a>.</p><p>It was found that on using the same request payload (albeit after updating the model name at the top of the request json), we get the expected response with the Meta Llama LLM ! ! This surely means that there is issue with the specific Qwen Coder model that I am using.</p><h3>The hack</h3><p>Since, I wanted to use Qwen Coder LLM itself, we have to think of a workaround so that the incompatible response from the LLM can be made compatible before being fed into OpenCode.</p><p>So, instead of open code directly talking to the model hosted on llama.cpp, let us write a python adapter code that can turn the incompatible response from Qwen Coder LLM to a compatible format that can be understood by OpenCode.</p><h4>Python adapter</h4><p>The python code is given below, and it has to be run on the Mac where out IntelliJ ACP agent (OpenCode) is also installed.</p><pre>from __future__ import annotations<br>import json<br>import os<br>import re<br>import time<br>import uuid<br>from typing import Any<br><br>import httpx<br>from fastapi import FastAPI, HTTPException, Request<br>from fastapi.responses import JSONResponse, StreamingResponse<br><br>LLAMA_BASE_URL = os.getenv(<br>    &quot;LLAMA_BASE_URL&quot;, &quot;http://192.168.1.16:8080/v1&quot;<br>).rstrip(&quot;/&quot;)<br>HTTP_TIMEOUT = float(os.getenv(&quot;HTTP_TIMEOUT&quot;, &quot;300&quot;))<br><br>app = FastAPI(title=&quot;Qwen OpenAI Tool-Call Adapter&quot;)<br><br><br>def get_declared_tools(payload: dict[str, Any]) -&gt; dict[str, dict[str, Any]]:<br>    declared = {}<br>    for item in payload.get(&quot;tools&quot;) or []:<br>        if item.get(&quot;type&quot;) == &quot;function&quot;:<br>            fn = item.get(&quot;function&quot;) or {}<br>            name = fn.get(&quot;name&quot;)<br>            if isinstance(name, str) and name:<br>                declared[name] = fn<br>    return declared<br><br><br>def forced_function_name(tool_choice: Any) -&gt; str | None:<br>    if isinstance(tool_choice, dict):<br>        return (tool_choice.get(&quot;function&quot;) or {}).get(&quot;name&quot;)<br>    return None<br><br><br>def extract_json_objects(text: str) -&gt; list[dict[str, Any]]:<br>    &quot;&quot;&quot;Extract complete JSON objects embedded in text, preserving their order.&quot;&quot;&quot;<br>    decoder = json.JSONDecoder()<br>    found = []<br>    seen_spans = set()<br><br>    for match in re.finditer(r&quot;\{&quot;, text):<br>        start = match.start()<br>        try:<br>            obj, end_offset = decoder.raw_decode(text[start:])<br>        except json.JSONDecodeError:<br>            continue<br><br>        end = start + end_offset<br>        if (start, end) in seen_spans:<br>            continue<br>        seen_spans.add((start, end))<br>        if isinstance(obj, dict):<br>            found.append(obj)<br><br>    return found<br><br><br>def validate_arguments(<br>    name: str, arguments: Any, tool_schema: dict[str, Any]<br>) -&gt; dict[str, Any] | None:<br>    if isinstance(arguments, str):<br>        try:<br>            arguments = json.loads(arguments)<br>        except json.JSONDecodeError:<br>            return None<br><br>    if not isinstance(arguments, dict):<br>        return None<br><br>    schema = tool_schema.get(&quot;parameters&quot;) or {}<br>    properties = schema.get(&quot;properties&quot;) or {}<br>    required = schema.get(&quot;required&quot;) or []<br><br>    if any(key not in arguments for key in required):<br>        return None<br><br>    type_map = {<br>        &quot;string&quot;: str,<br>        &quot;integer&quot;: int,<br>        &quot;number&quot;: (int, float),<br>        &quot;boolean&quot;: bool,<br>        &quot;object&quot;: dict,<br>        &quot;array&quot;: list,<br>    }<br><br>    for key, value in arguments.items():<br>        prop = properties.get(key)<br>        if not prop:<br>            # Do not reject extra fields here; the tool implementation<br>            # remains responsible for its own argument handling.<br>            continue<br><br>        expected_type = type_map.get(prop.get(&quot;type&quot;))<br>        if expected_type is None:<br>            continue<br><br>        if not isinstance(value, expected_type):<br>            return None<br><br>        if prop.get(&quot;type&quot;) == &quot;integer&quot; and isinstance(value, bool):<br>            return None<br><br>    return arguments<br><br><br>def parse_text_tool_calls(<br>    content: Any, tools: dict[str, dict[str, Any]], tool_choice: Any<br>) -&gt; list[dict[str, Any]] | None:<br>    if not isinstance(content, str) or not content.strip():<br>        return None<br>    if tool_choice == &quot;none&quot;:<br>        return None<br><br>    forced_name = forced_function_name(tool_choice)<br><br>    # Prefer content inside recognizable wrappers, but also inspect the<br>    # complete response because Qwen sometimes emits bare JSON.<br>    candidates = []<br>    wrapper_patterns = (<br>        r&quot;&lt;tool_call\b[^&gt;]*&gt;(.*?)&lt;/tool_call&gt;&quot;,<br>        r&quot;&lt;function-call\b[^&gt;]*&gt;(.*?)&lt;/function-call&gt;&quot;,<br>        r&quot;&lt;function_calls\b[^&gt;]*&gt;(.*?)&lt;/function_calls&gt;&quot;,<br>        r&quot;&lt;function-calls\b[^&gt;]*&gt;(.*?)&lt;/function-calls&gt;&quot;,<br>        r&quot;&lt;tools\b[^&gt;]*&gt;(.*?)&lt;/tools&gt;&quot;,<br>    )<br>    for pattern in wrapper_patterns:<br>        candidates.extend(<br>            re.findall(pattern, content, flags=re.IGNORECASE | re.DOTALL)<br>        )<br>    candidates.append(content)<br><br>    for candidate in candidates:<br>        for obj in extract_json_objects(candidate):<br>            # Supported shapes:<br>            # {&quot;name&quot;:&quot;write&quot;,&quot;arguments&quot;:{...}}<br>            # {&quot;function&quot;:{&quot;name&quot;:&quot;write&quot;,&quot;arguments&quot;:{...}}}<br>            call = obj.get(&quot;function&quot;) if isinstance(obj.get(&quot;function&quot;), dict) else obj<br>            name = call.get(&quot;name&quot;)<br>            if not isinstance(name, str) or name not in tools:<br>                continue<br>            if forced_name and name != forced_name:<br>                continue<br><br>            arguments = validate_arguments(<br>                name, call.get(&quot;arguments&quot;), tools[name]<br>            )<br>            if arguments is None:<br>                continue<br><br>            return [{<br>                &quot;id&quot;: &quot;call_&quot; + uuid.uuid4().hex[:24],<br>                &quot;type&quot;: &quot;function&quot;,<br>                &quot;function&quot;: {<br>                    &quot;name&quot;: name,<br>                    &quot;arguments&quot;: json.dumps(<br>                        arguments, ensure_ascii=False, separators=(&quot;,&quot;, &quot;:&quot;)<br>                    ),<br>                },<br>            }]<br><br>    return None<br><br><br>async def call_llama(payload: dict[str, Any]) -&gt; dict[str, Any]:<br>    url = f&quot;{LLAMA_BASE_URL}/chat/completions&quot;<br>    try:<br>        async with httpx.AsyncClient(timeout=HTTP_TIMEOUT) as client:<br>            response = await client.post(url, json=payload)<br>    except httpx.HTTPError as exc:<br>        raise HTTPException(status_code=502, detail=f&quot;llama.cpp request failed: {exc}&quot;)<br><br>    if response.is_error:<br>        raise HTTPException(status_code=response.status_code, detail=response.text)<br><br>    try:<br>        return response.json()<br>    except ValueError:<br>        raise HTTPException(status_code=502, detail=&quot;llama.cpp returned invalid JSON&quot;)<br><br><br>def normalize_response(<br>    data: dict[str, Any], original_request: dict[str, Any]<br>) -&gt; dict[str, Any]:<br>    tools = get_declared_tools(original_request)<br><br>    for choice in data.get(&quot;choices&quot;, []):<br>        message = choice.get(&quot;message&quot;) or {}<br><br>        # Do not alter calls that llama.cpp has already parsed natively.<br>        if message.get(&quot;tool_calls&quot;):<br>            continue<br><br>        calls = parse_text_tool_calls(<br>            message.get(&quot;content&quot;),<br>            tools,<br>            original_request.get(&quot;tool_choice&quot;, &quot;auto&quot;),<br>        )<br>        if calls:<br>            message[&quot;content&quot;] = None<br>            message[&quot;tool_calls&quot;] = calls<br>            choice[&quot;finish_reason&quot;] = &quot;tool_calls&quot;<br><br>    return data<br><br><br>def make_stream(data: dict[str, Any]):<br>    &quot;&quot;&quot;Convert the normalized non-stream response into OpenAI-style SSE.&quot;&quot;&quot;<br>    choice = (data.get(&quot;choices&quot;) or [{}])[0]<br>    message = choice.get(&quot;message&quot;) or {}<br>    created = data.get(&quot;created&quot;, int(time.time()))<br>    model = data.get(&quot;model&quot;, &quot;qwen-local&quot;)<br>    response_id = data.get(&quot;id&quot;, &quot;chatcmpl-&quot; + uuid.uuid4().hex)<br><br>    def emit(delta: dict[str, Any], finish_reason: str | None = None):<br>        chunk = {<br>            &quot;id&quot;: response_id,<br>            &quot;object&quot;: &quot;chat.completion.chunk&quot;,<br>            &quot;created&quot;: created,<br>            &quot;model&quot;: model,<br>            &quot;choices&quot;: [{<br>                &quot;index&quot;: 0,<br>                &quot;delta&quot;: delta,<br>                &quot;finish_reason&quot;: finish_reason,<br>            }],<br>        }<br>        return &quot;data: &quot; + json.dumps(chunk, ensure_ascii=False) + &quot;\n\n&quot;<br><br>    yield emit({&quot;role&quot;: &quot;assistant&quot;})<br><br>    tool_calls = message.get(&quot;tool_calls&quot;) or []<br>    if tool_calls:<br>        for index, call in enumerate(tool_calls):<br>            yield emit({<br>                &quot;tool_calls&quot;: [{<br>                    &quot;index&quot;: index,<br>                    &quot;id&quot;: call[&quot;id&quot;],<br>                    &quot;type&quot;: &quot;function&quot;,<br>                    &quot;function&quot;: {<br>                        &quot;name&quot;: call[&quot;function&quot;][&quot;name&quot;],<br>                        &quot;arguments&quot;: call[&quot;function&quot;][&quot;arguments&quot;],<br>                    },<br>                }]<br>            })<br>        finish_reason = &quot;tool_calls&quot;<br>    else:<br>        content = message.get(&quot;content&quot;) or &quot;&quot;<br>        for start in range(0, len(content), 80):<br>            yield emit({&quot;content&quot;: content[start:start + 80]})<br>        finish_reason = choice.get(&quot;finish_reason&quot;, &quot;stop&quot;)<br><br>    yield emit({}, finish_reason)<br>    yield &quot;data: [DONE]\n\n&quot;<br><br><br>@app.get(&quot;/v1/models&quot;)<br>async def list_models():<br>    try:<br>        async with httpx.AsyncClient(timeout=30) as client:<br>            response = await client.get(f&quot;{LLAMA_BASE_URL}/models&quot;)<br>    except httpx.HTTPError as exc:<br>        raise HTTPException(status_code=502, detail=str(exc))<br>    return JSONResponse(<br>        content=response.json(),<br>        status_code=response.status_code,<br>    )<br><br><br>@app.post(&quot;/v1/chat/completions&quot;)<br>async def chat_completions(request: Request):<br>    original_payload = await request.json()<br><br>    # Buffer upstream output so text-based calls can be converted before<br>    # OpenCode receives the response. The adapter then re-emits SSE if needed.<br>    upstream_payload = dict(original_payload)<br>    upstream_payload[&quot;stream&quot;] = False<br><br>    data = await call_llama(upstream_payload)<br>    data = normalize_response(data, original_payload)<br><br>    if original_payload.get(&quot;stream&quot;, False):<br>        return StreamingResponse(<br>            make_stream(data),<br>            media_type=&quot;text/event-stream&quot;,<br>            headers={&quot;Cache-Control&quot;: &quot;no-cache&quot;, &quot;Connection&quot;: &quot;keep-alive&quot;},<br>        )<br><br>    return JSONResponse(content=data)</pre><p>Save the above file as qwen_adpater.py into ~/opencode-llama-adapter directory.</p><p>Run this code in a vitual env.</p><pre>$ python3 -m venv .venv<br><br>$ source .venv/bin/activate<br>(.venv)<br><br>$ pip install fastapi uvicorn httpx<br><br><br>$ uvicorn qwen_adapter:app --host 127.0.0.1 --port 8090</pre><h4>Configure OpenCode</h4><p>Change the baseURL in ~/.config/opencode/opencode.json to point to the python adapter, instead of llama.cpp.</p><pre> &quot;baseURL&quot;: &quot;http://127.0.0.1:8090/v1&quot;</pre><h4>Sanity Test</h4><p>We can test this by sending the prompt from OpenCode CLI. Later we can configure IntelliJ also if the basic test works. Run OpenCode CLI by typing opencode</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwqMnf5E0tvQ0YX0cItuUg.png" /></figure><p>The file tool-test.txt got created in the current working directory from where open code command was run.</p><h4>Configuring IntelliJ</h4><p>Update the AI Assistant -&gt; Provider and API Keys -&gt; URL field to connect to Python Adapter rather than llama.cpp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LiQs27qbs9YiISIDziS6EQ.png" /></figure><p>Now, you are all set !! Just restart IntelliJ and open a new chat session and see how your source files get created/edited automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dMEOmfS1uSEL0Ik1ewqA1A.png" /></figure><p>A new Java class was indeed created and then also edited under the expected directory. I would like to highlight a important tip:<br><strong>You will get good response only with good prompts like above.</strong></p><p>Example of bad prompt, where user wanted to edit a existing file:</p><pre>Edit diagnostictest to print current system time</pre><p>The above prompt may hit/miss, ie you will see unpredictable behavior with bad prompts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06046a1017de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your IDE, Your AI: Bringing Local LLMs to IntelliJ]]></title>
            <link>https://medium.com/@binitabharati/your-ide-your-ai-bringing-local-llms-to-intellij-ee3df32daef0?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee3df32daef0</guid>
            <category><![CDATA[intellj-local-llm]]></category>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Fri, 06 Nov 2026 06:24:40 GMT</pubDate>
            <atom:updated>2026-11-15T16:26:35.222Z</atom:updated>
            <content:encoded><![CDATA[<h3>Scope</h3><p>Support agentic coding on IntellJ IDEA using local LLM inference server.</p><h3>Set Up</h3><ul><li>llama.cpp server running on my home network on a Linux desktop. For more details refer to <a href="https://medium.com/@binitabharati/llama-cpp-on-linux-installing-and-enabling-nvidia-gpu-acceleration-on-ubuntu-24-04">local llm</a></li><li>IntelliJ (IntelliJ IDEA 2026.2.4) running on MAC book on the home network.</li></ul><h3>Solution</h3><ul><li>Install “JetBrains AI Assistant” plugin.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tURodu8O3-cyowp1glvZRg.png" /><figcaption>JetBrains AI Assistant plugin</figcaption></figure><ul><li>After installation, the AI Assistant plugin shows up as AI Chat on the Intellij editor.</li><li>By default, this plugin supports various coding agents like Junie, Codex, Claude Agent, Github Copilot and external ACP agents.</li><li>None of the default agents are capable of talking to llama.cpp in a reliable manner.</li><li>My research found that using OpenCode as an external ACP agent was a good option.</li><li>Install Opencode ACP agent on Mac:</li></ul><pre>brew install opencode</pre><ul><li>Now, that opencode is installed, lets configure opencode to use our local LLM server.</li></ul><pre>cat ~/.config/opencode/opencode.json<br>{<br>  &quot;$schema&quot;: &quot;https://opencode.ai/config.json&quot;,<br>  &quot;provider&quot;: {<br>    &quot;llama-local&quot;: {<br>      &quot;npm&quot;: &quot;@ai-sdk/openai-compatible&quot;,<br>      &quot;name&quot;: &quot;Home Ubuntu LLM&quot;,<br>      &quot;options&quot;: {<br>        &quot;baseURL&quot;: &quot;http://192.168.1.16:8080/v1&quot;,<br>        &quot;apiKey&quot;: &quot;sk-local&quot;<br>      },<br>      &quot;models&quot;: {<br>        &quot;bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;: {<br>          &quot;name&quot;: &quot;Qwen2.5-Coder-7B (Home GPU)&quot;,<br>          &quot;limit&quot;: {<br>            &quot;context&quot;: 4096,<br>            &quot;output&quot;: 512<br>          }<br>        },<br>        &quot;bartowski/Qwen2.5-Coder-14B-Instruct-GGUF:Q4_K_M&quot;: {<br>          &quot;name&quot;: &quot;Qwen2.5-Coder-14B (Home GPU)&quot;,<br>     &quot;limit&quot;: {<br>            &quot;context&quot;: 32768,<br>            &quot;output&quot;: 8192<br>          }<br>        }<br>      }<br>    }<br>  },<br>  &quot;model&quot;: &quot;llama-local/bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;<br>}</pre><p>Notice, how we can specify multiple models in the opencode config, but choose only one model among the multiple.</p><ul><li>Now, lets add the OpenCode ACP agent plugin to AI Assistant.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DAaY_n6r1vJCpkffvOaMVQ.png" /></figure><ul><li>In fact, you can also add the OpenCode ACP agent to AI Chat using the <em>Install the ACP Registry</em> option available in the drop down list containing existing agent names.</li><li>We need to restart IntelliJ once so that the newly installed OpenCode agent starts appearing under AI chat like below. This will appear in the same place where default ACP agents like Junie, Codex, etc are listed. The first time you try to send a prompt, you will be asked to select a authentication method. You should select “Managed by agent” as the authentication methodology. This option will enable you to use your local opencode agent.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*282J3XmO8N7MWqEK02yLAw.png" /></figure><p><em>Note: If you have not set any API key for your local LLM server, then this API Key can be any random value, else this value should match your configured API key.</em></p><ul><li>Also, notice that you have not started any opencode server or anything. IntelliJ is able to discover the path of opencode binary installed on your MAC, and the OpenCode ACP agent directly launches opencode command as a subprocess. That is why we dont need any opencode server to be running.</li></ul><h3>Footnote</h3><h4>What is ACP agent ?</h4><p>ACP stands for <strong>Agent Client Protocol</strong>. It is an open protocol that standardizes communication between code editors/IDEs (ACP clients) and coding agents (ACP agents).</p><p><strong>So, what exactly is an ACP agent?</strong></p><p>An ACP agent is a coding agent that implements the ACP protocol and acts as a bridge between the IDE and the underlying AI server.</p><p>When an ACP client (such as a code editor) sends a prompt or request, the ACP agent receives it, interprets the request, and orchestrates the interaction with an LLM. It translates the request into a format the LLM understands and processes the LLM’s response.</p><p>The agent can also interact with other tools, such as the filesystem, terminal, and code-editing capabilities, depending on its implementation.</p><p>In short, the ACP agent handles the communication with the IDE, while managing the interaction with the LLM and the tools required to accomplish the coding task.</p><p>Below diagram depicts the communicate architecture between IntelliJ and my local LLM server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ddwem7oVP-s9_olShB4SVg.png" /></figure><h4>IntelliJ OpenCode ACP agent remembers past conversations across IDE restarts</h4><p>OpenCode supports persistent sessions through ACP. So, unless, you start a new chat session from the IDE, you may find that on asking the same question again, the ACP agent is responding with the same answers as in the past chats. Turns out that OpenCode stores its session history locally. It typically is saved at ~/.local/share/opencode/opencode.db</p><p><strong>How to start on a fresh slate ?</strong><br>You need to start a fresh chat session; IDE restarts does not open a fresh chat session by default. To start a fresh chat, you need to click on New Chat option at the top right corner of the AI chat window. Where is the conversation stored?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee3df32daef0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[llama.cpp on Linux: Installing and Enabling NVIDIA GPU Acceleration on Ubuntu 24.04]]></title>
            <link>https://medium.com/@binitabharati/llama-cpp-on-linux-installing-and-enabling-nvidia-gpu-acceleration-on-ubuntu-24-04-acf1633ae209?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/acf1633ae209</guid>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Fri, 06 Nov 2026 05:45:13 GMT</pubDate>
            <atom:updated>2026-11-15T14:15:59.603Z</atom:updated>
            <content:encoded><![CDATA[<h3>Scope</h3><p>I’ve seen discussions online where people complain that their locally hosted coding models aren’t performing well enough, or that they’re not even utilizing their GPUs.</p><p>The thing is, just because we have an LLM-capable GPU on our machine doesn’t mean our local LLM server will automatically use it. We need to make sure the server is properly configured to take advantage of the available GPU resources.</p><p>As of today, Nov 2026, one can easily check the steps to install llama.cpp over AI interfaces like chatgpt. This blog will still outline the steps that I took to make llama.cpp work on my GPUm, and learnings along the way.</p><h3>Hardware specs</h3><pre>OS:                      Ubuntu 24.04.4 LTS<br>GPU:                     NVIDIA GeForce RTX 4060 Ti, 16GB VRAM<br>NVIDIA Driver Version:   580.178.04<br>CUDA toolkit version:    13.0</pre><p>Also, I had another basic NVIDIA’s graphical display GPU (the old school GPU that was there long before AI explosion). Output of nvidia-smi command is shared below:</p><pre>$ nvidia-smi<br>Fri Nov  6 10:06:50 2026<br>+-----------------------------------------------------------------------------------------+<br>| NVIDIA-SMI 580.178.04             Driver Version: 580.178.04     CUDA Version: 13.0     |<br>+-----------------------------------------+------------------------+----------------------+<br>| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |<br>| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |<br>|                                         |                        |               MIG M. |<br>|=========================================+========================+======================|<br>|   0  Quadro P400                    Off |   00000000:04:00.0 Off |                  N/A |<br>| 34%   36C    P8            N/A  /  N/A  |     279MiB /   2048MiB |      0%      Default |<br>|                                         |                        |                  N/A |<br>+-----------------------------------------+------------------------+----------------------+<br>|   1  NVIDIA GeForce RTX 4060 Ti     Off |   00000000:0A:00.0 Off |                  N/A |<br>|  0%   41C    P5             16W /  165W |      13MiB /  16380MiB |      0%      Default |<br>|                                         |                        |                  N/A |<br>+-----------------------------------------+------------------------+----------------------+<br><br>+-----------------------------------------------------------------------------------------+<br>| Processes:                                                                              |<br>|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |<br>|        ID   ID                                                               Usage      |<br>|=========================================================================================|<br>|    0   N/A  N/A            2577      G   /usr/bin/gnome-shell                    241MiB |<br>|    0   N/A  N/A            2698      G   /usr/bin/Xwayland                         1MiB |<br>|    1   N/A  N/A            2577      G   /usr/bin/gnome-shell                      2MiB |<br>+-----------------------------------------------------------------------------------------+</pre><h3>Installing llama.cpp</h3><pre>--install all Ubuntu packages required to build and run llama.cpp<br>$ sudo apt update<br><br>$ sudo apt install -y \<br>    cmake \<br>    build-essential \<br>    ninja-build \<br>    git \<br>    libcurl4-openssl-dev \<br>    libssl-dev<br><br>--check installed cmake command works<br>$ cmake --version<br>cmake version 3.28.3<br><br>CMake suite maintained and supported by Kitware (kitware.com/cmake).</pre><h3>Installing llama.cpp continued</h3><p>This section is a continuation of the previous section. But, here , the installation steps talks about making llama.cpp use the required LLM GPU on my machine.</p><h4>Clone the llama.cpp code base</h4><pre>-- clone llama.cpp code base<br>$ git clone https://github.com/ggml-org/llama.cpp.git<br><br>$ cd llama.cpp</pre><h4>Configure llama build for the GPU architecture</h4><p>Important build configurations in this step:</p><p>-DCMAKE_CUDA_ARCHITECTURES=89 → 8.9 GPU model for NVIDIA GeForce RTX 4060 Ti</p><p>The 89 is taken from the GPU model. It can be extracted from the below command:</p><blockquote><strong>$nvidia-smi — query-gpu=name,compute_cap — format=csv</strong></blockquote><blockquote>name, compute_cap</blockquote><blockquote>Quadro P400, 6.1</blockquote><blockquote>NVIDIA GeForce RTX 4060 Ti, 8.9</blockquote><p>-DGGML_CUDA=ON tells CMake to enable NVIDIA CUDA GPU support when compiling llama.cpp.</p><pre>$ cmake -B build \<br>    -DGGML_CUDA=ON \<br>    -DCMAKE_BUILD_TYPE=Release \<br>    -DCMAKE_CUDA_ARCHITECTURES=89 \<br>    -DLLAMA_OPENSSL=ON<br><br>-- The C compiler identification is GNU 13.3.0<br>-- The CXX compiler identification is GNU 13.3.0<br>-- Detecting C compiler ABI info<br>-- Detecting C compiler ABI info - done<br>-- Check for working C compiler: /usr/bin/cc - skipped<br>-- Detecting C compile features<br>-- Detecting C compile features - done<br>-- Detecting CXX compiler ABI info<br>-- Detecting CXX compiler ABI info - done<br>-- Check for working CXX compiler: /usr/bin/c++ - skipped<br>-- Detecting CXX compile features<br>-- Detecting CXX compile features - done<br>-- llama.cpp version: 0.9.0-dev<br>CMAKE_BUILD_TYPE=Release<br>-- Found Git: /usr/bin/git (found version &quot;2.43.0&quot;)<br>-- The ASM compiler identification is GNU<br>-- Found assembler: /usr/bin/cc<br>-- Performing Test CMAKE_HAVE_LIBC_PTHREAD<br>-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success<br>-- Found Threads: TRUE<br>-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF<br>-- CMAKE_SYSTEM_PROCESSOR: x86_64<br>-- GGML_SYSTEM_ARCH: x86<br>-- Found OpenMP_C: -fopenmp (found version &quot;4.5&quot;)<br>-- Found OpenMP_CXX: -fopenmp (found version &quot;4.5&quot;)<br>-- Found OpenMP: TRUE (found version &quot;4.5&quot;)<br>-- Including CPU backend<br>-- x86 detected<br>-- Adding CPU backend variant ggml-cpu: -march=native<br>-- Found CUDAToolkit: /usr/local/cuda/targets/x86_64-linux/include (found version &quot;13.4.59&quot;)<br>-- CUDA Toolkit found<br>-- The CUDA compiler identification is NVIDIA 13.4.59<br>-- Detecting CUDA compiler ABI info<br>-- Detecting CUDA compiler ABI info - done<br>-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped<br>-- Detecting CUDA compile features<br>-- Detecting CUDA compile features - done<br>-- Using CMAKE_CUDA_ARCHITECTURES=89 CMAKE_CUDA_ARCHITECTURES_NATIVE=89-real;61-real<br>-- FlashAttention K-V type combinations: f16-f16;q4_0-q4_0;q8_0-q8_0;bf16-bf16<br>-- Could NOT find NCCL (missing: NCCL_LIBRARY NCCL_INCLUDE_DIR)<br>-- Warning: NCCL not found, performance for multiple CUDA GPUs will be suboptimal<br>-- CUDA host compiler is GNU 13.3.0<br>-- Including CUDA backend<br>-- ggml version: 0.29.0<br>-- ggml commit:  45b6604b2<br>-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version &quot;3.0.13&quot;)<br>-- Performing Test OPENSSL_VERSION_SUPPORTED<br>-- Performing Test OPENSSL_VERSION_SUPPORTED - Success<br>-- OpenSSL found: 3.0.13<br>-- Generating embedded license file for target: llama-app<br>-- Configuring done (3.9s)<br>-- Generating done (0.3s)<br>-- Build files have been written to: /home/binita/installables/llama.cpp/build<br></pre><h4>Build llama using the afore config</h4><pre><br>$ cmake --build build --config Release -j2<br>[ 11%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/conv3d.cu.o<br>[ 11%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/convert.cu.o<br>[ 11%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/count-equal.cu.o<br>[ 11%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/cpy.cu.o<br>[ 11%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/cross-entropy-loss.cu.o<br>[ 11%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/cumsum.cu.o<br>[ 12%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/diag.cu.o<br>[ 12%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/diagmask.cu.o<br>[ 12%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/dsv4-hc.cu.o<br>[ 12%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/fattn-tile.cu.o<br>[ 12%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/fattn.cu.o<br>[ 12%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/fill.cu.o<br>[ 13%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/fwht.cu.o<br>[ 13%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/gated-delta-net-mma.cu.o<br>[ 13%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/gated_delta_net.cu.o<br>[ 13%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/getrows.cu.o<br>[ 13%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/ggml-cuda.cu.o<br>[ 13%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/gla.cu.o<br>[ 14%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/im2col.cu.o<br>[ 14%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/lightning-indexer.cu.o<br>[ 14%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/mean.cu.o<br>[ 14%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/mmf.cu.o<br>[ 14%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/mmid.cu.o<br>[ 14%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/mmq.cu.o<br>[ 15%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/mmvf.cu.o<br>[ 15%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/mmvq.cu.o<br>[ 15%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/moe-weighted-reduction.cu.o<br>[ 15%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/norm.cu.o<br>[ 15%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/opt-step-adamw.cu.o<br>[ 15%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/opt-step-sgd.cu.o<br>[ 16%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/out-prod.cu.o<br>[ 16%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/pad.cu.o<br>[ 16%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/pad_reflect_1d.cu.o<br>[ 16%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/pool1d.cu.o<br>[ 16%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/pool2d.cu.o<br>[ 16%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/quantize.cu.o<br>[ 17%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/roll.cu.o<br>[ 17%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/rope.cu.o<br>[ 17%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/scale.cu.o<br>[ 17%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/set-rows.cu.o<br>[ 17%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/set.cu.o<br>[ 17%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/snake.cu.o<br>[ 18%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/softcap.cu.o<br>[ 18%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/softmax.cu.o<br>[ 18%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/solve_tri.cu.o<br>[ 18%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/ssm-conv.cu.o<br>[ 18%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/ssm-scan.cu.o<br>[ 18%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/sum.cu.o<br>[ 19%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/sumrows.cu.o<br>[ 19%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/top-k-mask.cu.o<br>[ 19%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/top-k.cu.o<br>[ 19%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/topk-moe.cu.o<br>[ 19%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/tri.cu.o<br>[ 19%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/tsembd.cu.o<br>[ 20%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/unary.cu.o<br>[ 20%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/upscale.cu.o<br>[ 20%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/wkv.cu.o<br>[ 20%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq112-dv112.cu.o<br>[ 20%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq128-dv128.cu.o<br>[ 20%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq192-dv128.cu.o<br>[ 21%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq256-dv256.cu.o<br>[ 21%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq320-dv256.cu.o<br>[ 21%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq40-dv40.cu.o<br>[ 21%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq512-dv512.cu.o<br>[ 21%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq576-dv512.cu.o<br>[ 21%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq64-dv64.cu.o<br>[ 22%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq72-dv72.cu.o<br>[ 22%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq80-dv80.cu.o<br>[ 22%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-tile-instance-dkq96-dv96.cu.o<br>[ 22%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_16.cu.o<br>[ 22%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_32.cu.o<br>[ 22%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_8.cu.o<br>[ 23%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_1.cu.o<br>[ 23%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_2.cu.o<br>[ 23%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_4.cu.o<br>[ 23%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_16.cu.o<br>[ 23%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_32.cu.o<br>[ 23%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_4.cu.o<br>[ 23%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_8.cu.o<br>[ 24%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_1.cu.o<br>[ 24%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_2.cu.o<br>[ 24%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_16.cu.o<br>[ 24%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_2.cu.o<br>[ 24%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_4.cu.o<br>[ 24%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_8.cu.o<br>[ 25%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_64-ncols2_1.cu.o<br>[ 25%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_1.cu.o<br>[ 25%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_2.cu.o<br>[ 25%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_4.cu.o<br>[ 25%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_8.cu.o<br>[ 25%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-iq1_s.cu.o<br>[ 26%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-iq2_s.cu.o<br>[ 26%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-iq2_xs.cu.o<br>[ 26%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-iq2_xxs.cu.o<br>[ 26%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-iq3_s.cu.o<br>[ 26%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-iq3_xxs.cu.o<br>[ 26%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-iq4_nl.cu.o<br>[ 27%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-iq4_xs.cu.o<br>[ 27%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-mxfp4.cu.o<br>[ 27%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-nvfp4.cu.o<br>[ 27%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q1_0.cu.o<br>[ 27%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q2_0.cu.o<br>[ 27%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q2_k.cu.o<br>[ 28%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q3_k.cu.o<br>[ 28%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q4_0.cu.o<br>[ 28%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q4_1.cu.o<br>[ 28%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q4_k.cu.o<br>[ 28%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q5_0.cu.o<br>[ 28%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q5_1.cu.o<br>[ 29%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q5_k.cu.o<br>[ 29%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q6_k.cu.o<br>[ 29%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmq-instance-q8_0.cu.o<br>[ 29%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_1.cu.o<br>[ 29%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_10.cu.o<br>[ 29%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_11.cu.o<br>[ 30%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_12.cu.o<br>[ 30%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_13.cu.o<br>[ 30%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_14.cu.o<br>[ 30%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_15.cu.o<br>[ 30%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_16.cu.o<br>[ 30%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_2.cu.o<br>[ 31%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_3.cu.o<br>[ 31%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_4.cu.o<br>[ 31%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_5.cu.o<br>[ 31%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_6.cu.o<br>[ 31%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_7.cu.o<br>[ 31%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_8.cu.o<br>[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/mmf-instance-ncols_9.cu.o<br>[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-vec-instance-f16-f16.cu.o<br>[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-vec-instance-q4_0-q4_0.cu.o<br>[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-vec-instance-q8_0-q8_0.cu.o<br>[ 32%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-vec-instance-bf16-bf16.cu.o<br>[ 32%] Linking CUDA shared library ../../../bin/libggml-cuda.so<br>[ 32%] Built target ggml-cuda<br>[ 32%] Building CXX object ggml/src/CMakeFiles/ggml.dir/ggml-backend-reg.cpp.o<br>[ 32%] Building CXX object ggml/src/CMakeFiles/ggml.dir/ggml-backend-dl.cpp.o<br>[ 32%] Linking CXX shared library ../../bin/libggml.so<br>[ 32%] Built target ggml<br>[ 34%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_10_cxx.cxx.o<br>[ 34%] Building CXX object tests/CMakeFiles/test-opt.dir/test-opt.cpp.o<br>[ 34%] Linking CXX executable ../bin/test-opt<br>[ 34%] Built target test-opt<br>[ 34%] Building CXX object tests/CMakeFiles/test-backend-ops.dir/test-backend-ops.cpp.o<br>[ 34%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_9_cxx.cxx.o<br>[ 34%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_8_cxx.cxx.o<br>[ 34%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_7_cxx.cxx.o<br>[ 34%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_6_cxx.cxx.o<br>[ 34%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_5_cxx.cxx.o<br>[ 35%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_4_cxx.cxx.o<br>[ 35%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_3_cxx.cxx.o<br>[ 35%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_2_cxx.cxx.o<br>[ 35%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_1_cxx.cxx.o<br>[ 35%] Linking CXX executable ../bin/test-backend-ops<br>[ 35%] Built target test-backend-ops<br>[ 35%] Building CXX object tests/CMakeFiles/test-backend-tensor.dir/test-backend-tensor.cpp.o<br>[ 36%] Linking CXX executable ../bin/test-backend-tensor<br>[ 36%] Built target test-backend-tensor<br>[ 36%] Building CXX object tests/CMakeFiles/test-tiled-mulmat.dir/test-tiled-mulmat.cpp.o<br>[ 36%] Building CXX object src/CMakeFiles/llama.dir/Unity/unity_0_cxx.cxx.o<br>[ 36%] Linking CXX executable ../bin/test-tiled-mulmat<br>[ 36%] Built target test-tiled-mulmat<br>[ 36%] Building CXX object tests/CMakeFiles/test-barrier.dir/test-barrier.cpp.o<br>[ 36%] Linking CXX executable ../bin/test-barrier<br>[ 36%] Built target test-barrier<br>[ 36%] Building CXX object tests/CMakeFiles/test-quantize-fns.dir/test-quantize-fns.cpp.o<br>[ 36%] Linking CXX executable ../bin/test-quantize-fns<br>[ 36%] Built target test-quantize-fns<br>[ 37%] Building CXX object tests/CMakeFiles/test-quantize-perf.dir/test-quantize-perf.cpp.o<br>[ 37%] Linking CXX executable ../bin/test-quantize-perf<br>[ 37%] Built target test-quantize-perf<br>[ 38%] Building CXX object tests/CMakeFiles/test-rope.dir/test-rope.cpp.o<br>[ 38%] Building CXX object src/CMakeFiles/llama.dir/llama.cpp.o<br>[ 38%] Linking CXX executable ../bin/test-rope<br>[ 38%] Built target test-rope<br>[ 39%] Building CXX object tests/CMakeFiles/test-col2im-1d.dir/test-col2im-1d.cpp.o<br>[ 39%] Linking CXX executable ../bin/test-col2im-1d<br>[ 39%] Built target test-col2im-1d<br>[ 39%] Building CXX object tests/CMakeFiles/test-conv-1d.dir/test-conv-1d.cpp.o<br>[ 39%] Linking CXX executable ../bin/test-conv-1d<br>[ 39%] Built target test-conv-1d<br>[ 40%] Building CXX object tests/CMakeFiles/test-gelu-quick.dir/test-gelu-quick.cpp.o<br>[ 41%] Building CXX object src/CMakeFiles/llama.dir/llama-adapter.cpp.o<br>[ 41%] Linking CXX executable ../bin/test-gelu-quick<br>[ 41%] Built target test-gelu-quick<br>[ 41%] Building CXX object tests/CMakeFiles/test-gguf.dir/test-gguf.cpp.o<br>[ 41%] Building CXX object src/CMakeFiles/llama.dir/llama-arch.cpp.o<br>[ 41%] Linking CXX executable ../bin/test-gguf<br>[ 41%] Built target test-gguf<br>[ 41%] Building CXX object tests/CMakeFiles/test-alloc.dir/test-alloc.cpp.o<br>[ 41%] Linking CXX executable ../bin/test-alloc<br>[ 41%] Built target test-alloc<br>[ 42%] Building CXX object examples/gguf-hash/CMakeFiles/llama-gguf-hash.dir/gguf-hash.cpp.o<br>[ 42%] Linking CXX executable ../../bin/llama-gguf-hash<br>[ 42%] Built target llama-gguf-hash<br>[ 42%] Building CXX object examples/gguf/CMakeFiles/llama-gguf.dir/gguf.cpp.o<br>[ 42%] Building CXX object src/CMakeFiles/llama.dir/llama-batch.cpp.o<br>[ 42%] Linking CXX executable ../../bin/llama-gguf<br>[ 42%] Built target llama-gguf<br>[ 42%] Building CXX object src/CMakeFiles/llama.dir/llama-chat.cpp.o<br>[ 42%] Building CXX object src/CMakeFiles/llama.dir/llama-context.cpp.o<br>[ 42%] Building CXX object src/CMakeFiles/llama.dir/llama-cparams.cpp.o<br>[ 43%] Building CXX object src/CMakeFiles/llama.dir/llama-grammar.cpp.o<br>[ 43%] Building CXX object src/CMakeFiles/llama.dir/llama-graph.cpp.o<br>[ 43%] Building CXX object src/CMakeFiles/llama.dir/llama-hparams.cpp.o<br>[ 43%] Building CXX object src/CMakeFiles/llama.dir/llama-impl.cpp.o<br>[ 43%] Building CXX object src/CMakeFiles/llama.dir/llama-io.cpp.o<br>[ 43%] Building CXX object src/CMakeFiles/llama.dir/llama-kv-cache.cpp.o<br>[ 44%] Building CXX object src/CMakeFiles/llama.dir/llama-kv-cache-iswa.cpp.o<br>[ 44%] Building CXX object src/CMakeFiles/llama.dir/llama-kv-cache-dsa.cpp.o<br>[ 44%] Building CXX object src/CMakeFiles/llama.dir/llama-kv-cache-dsa-iswa.cpp.o<br>[ 44%] Building CXX object src/CMakeFiles/llama.dir/llama-kv-cache-msa.cpp.o<br>[ 44%] Building CXX object src/CMakeFiles/llama.dir/llama-kv-cache-dsv4.cpp.o<br>[ 44%] Building CXX object src/CMakeFiles/llama.dir/llama-memory.cpp.o<br>[ 45%] Building CXX object src/CMakeFiles/llama.dir/llama-moe-cache.cpp.o<br>[ 45%] Building CXX object src/CMakeFiles/llama.dir/llama-memory-hybrid.cpp.o<br>[ 45%] Building CXX object src/CMakeFiles/llama.dir/llama-memory-hybrid-iswa.cpp.o<br>[ 45%] Building CXX object src/CMakeFiles/llama.dir/llama-memory-hybrid-idx.cpp.o<br>[ 45%] Building CXX object src/CMakeFiles/llama.dir/llama-memory-recurrent.cpp.o<br>[ 45%] Building CXX object src/CMakeFiles/llama.dir/llama-mmap.cpp.o<br>[ 46%] Building CXX object src/CMakeFiles/llama.dir/llama-model-loader.cpp.o<br>[ 46%] Building CXX object src/CMakeFiles/llama.dir/llama-model-saver.cpp.o<br>[ 46%] Building CXX object src/CMakeFiles/llama.dir/llama-model.cpp.o<br>[ 46%] Building CXX object src/CMakeFiles/llama.dir/llama-quant.cpp.o<br>[ 46%] Building CXX object src/CMakeFiles/llama.dir/llama-sampler.cpp.o<br>[ 46%] Building CXX object src/CMakeFiles/llama.dir/llama-vocab.cpp.o<br>[ 47%] Building CXX object src/CMakeFiles/llama.dir/unicode-data.cpp.o<br>[ 47%] Building CXX object src/CMakeFiles/llama.dir/unicode.cpp.o<br>[ 47%] Linking CXX shared library ../bin/libllama.so<br>[ 47%] Built target llama<br>[ 48%] Building CXX object tests/CMakeFiles/test-unicode.dir/test-unicode.cpp.o<br>[ 48%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/parsers.cpp.o<br>[ 48%] Linking CXX executable ../bin/test-unicode<br>[ 48%] Built target test-unicode<br>[ 48%] Building CXX object tests/CMakeFiles/test-sampling.dir/test-sampling.cpp.o<br>[ 48%] Linking CXX executable ../bin/test-sampling<br>[ 48%] Built target test-sampling<br>[ 49%] Building CXX object tests/CMakeFiles/test-grammar-parser.dir/test-grammar-parser.cpp.o<br>[ 49%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/cohere2moe.cpp.o<br>[ 49%] Linking CXX executable ../bin/test-grammar-parser<br>[ 49%] Built target test-grammar-parser<br>[ 50%] Building CXX object tests/CMakeFiles/test-llama-grammar.dir/test-llama-grammar.cpp.o<br>[ 50%] Linking CXX executable ../bin/test-llama-grammar<br>[ 50%] Built target test-llama-grammar<br>[ 50%] Building CXX object tests/CMakeFiles/test-batch-alloc.dir/test-batch-alloc.cpp.o<br>[ 51%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/deepseek.cpp.o<br>[ 51%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/functionary-v3-2.cpp.o<br>[ 51%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/gemma4.cpp.o<br>[ 51%] Linking CXX executable ../bin/test-batch-alloc<br>[ 51%] Built target test-batch-alloc<br>[ 51%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/mtmd.cpp.o<br>[ 51%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/gigachat-v3.cpp.o<br>[ 51%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/gpt-oss.cpp.o<br>[ 51%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/mtmd-audio.cpp.o<br>[ 51%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/harmony-xml.cpp.o<br>[ 52%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/mtmd-image.cpp.o<br>[ 53%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/k2-horizon.cpp.o<br>[ 53%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/mtmd-helper.cpp.o<br>[ 53%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/kimi-k2.cpp.o<br>[ 53%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/kimi-k3.cpp.o<br>[ 53%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/ling3.cpp.o<br>[ 53%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/lfm2.cpp.o<br>[ 53%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/llm-jp-harmony.cpp.o<br>[ 53%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/mtmd-helper-gen.cpp.o<br>[ 54%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/minicpm5.cpp.o<br>[ 54%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/clip.cpp.o<br>[ 54%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/minimax-m3.cpp.o<br>[ 54%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/ministral3.cpp.o<br>[ 54%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/muse-glimmer.cpp.o<br>[ 54%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/muse-spark.cpp.o<br>[ 54%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/qwen3-coder.cpp.o<br>[ 54%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/chatterbox-gen.cpp.o<br>[ 55%] Building CXX object common/CMakeFiles/llama-common.dir/parsers/translate-gemma.cpp.o<br>[ 55%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/chatterbox-spkenc.cpp.o<br>[ 56%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/cogvlm.cpp.o<br>[ 56%] Building CXX object common/CMakeFiles/llama-common.dir/arg.cpp.o<br>[ 56%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/conformer.cpp.o<br>[ 56%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/deepseek4v.cpp.o<br>[ 56%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/dots3note.cpp.o<br>[ 56%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/dotsocr.cpp.o<br>[ 56%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/exaone4_5.cpp.o<br>[ 57%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/gemma4a.cpp.o<br>[ 57%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/gemma4v.cpp.o<br>[ 57%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/gemma4ua.cpp.o<br>[ 57%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/gemma4uv.cpp.o<br>[ 57%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/glm4v.cpp.o<br>[ 57%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/granite-speech.cpp.o<br>[ 58%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/granite4-vision.cpp.o<br>[ 58%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/hunyuanvl.cpp.o<br>[ 58%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/internvl.cpp.o<br>[ 58%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/kimivl.cpp.o<br>[ 58%] Building CXX object common/CMakeFiles/llama-common.dir/chat-auto-parser-generator.cpp.o<br>[ 58%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/kimik25.cpp.o<br>[ 58%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/nemotron-v2-vl.cpp.o<br>[ 59%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/nemotron-omni.cpp.o<br>[ 59%] Building CXX object common/CMakeFiles/llama-common.dir/chat-auto-parser-helpers.cpp.o<br>[ 59%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/nemotron-transcribe.cpp.o<br>[ 59%] Building CXX object common/CMakeFiles/llama-common.dir/chat-diff-analyzer.cpp.o<br>[ 59%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/muse-glimmer.cpp.o<br>[ 59%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/muse-spark-audio.cpp.o<br>[ 59%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/llama4.cpp.o<br>[ 59%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/llava.cpp.o<br>[ 60%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/minicpmv.cpp.o<br>[ 60%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/paddleocr.cpp.o<br>[ 60%] Building CXX object common/CMakeFiles/llama-common.dir/chat-peg-parser.cpp.o<br>[ 60%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/pixtral.cpp.o<br>[ 60%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/qwen2vl.cpp.o<br>[ 60%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/sensenova-u1.cpp.o<br>[ 60%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/minimax-m3.cpp.o<br>[ 61%] Building CXX object common/CMakeFiles/llama-common.dir/chat.cpp.o<br>[ 62%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/qwen3vl.cpp.o<br>[ 62%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/lfm3vl.cpp.o<br>[ 62%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/lfm3a.cpp.o<br>[ 62%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/lfm3a-gen.cpp.o<br>[ 62%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/ling3vl.cpp.o<br>[ 62%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/mimovl.cpp.o<br>[ 62%] Building CXX object common/CMakeFiles/llama-common.dir/common.cpp.o<br>[ 63%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/qwen3a.cpp.o<br>[ 63%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/mimo-audio.cpp.o<br>[ 63%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/qwen3tts-spkenc.cpp.o<br>[ 63%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/qwen3tts-gen.cpp.o<br>[ 63%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/drama3-gen.cpp.o<br>[ 63%] Building CXX object common/CMakeFiles/llama-common.dir/console.cpp.o<br>[ 63%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/pockettts-seanet.cpp.o<br>[ 63%] Building CXX object common/CMakeFiles/llama-common.dir/debug.cpp.o<br>[ 64%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/pockettts-spkenc.cpp.o<br>[ 64%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/pockettts-gen.cpp.o<br>[ 64%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/soprano.cpp.o<br>[ 64%] Building CXX object common/CMakeFiles/llama-common.dir/download.cpp.o<br>[ 64%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/step3vl.cpp.o<br>[ 64%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/siglip.cpp.o<br>[ 64%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/whisper-enc.cpp.o<br>[ 65%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/voxtral-rt.cpp.o<br>[ 65%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/deepseekocr.cpp.o<br>[ 65%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/deepseekocr2.cpp.o<br>[ 65%] Building CXX object common/CMakeFiles/llama-common.dir/fit.cpp.o<br>[ 65%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/mobilenetv5.cpp.o<br>[ 65%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/youtuvl.cpp.o<br>[ 65%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/yasa2.cpp.o<br>[ 66%] Building CXX object common/CMakeFiles/llama-common.dir/file-lock.cpp.o<br>[ 67%] Building CXX object tools/mtmd/CMakeFiles/mtmd.dir/models/parakeet.cpp.o<br>[ 67%] Building CXX object common/CMakeFiles/llama-common.dir/hf-cache.cpp.o<br>[ 67%] Linking CXX shared library ../../bin/libmtmd.so<br>[ 67%] Built target mtmd<br>[ 67%] Building CXX object tests/CMakeFiles/test-gbnf-validator.dir/test-gbnf-validator.cpp.o<br>[ 67%] Linking CXX executable ../bin/test-gbnf-validator<br>[ 67%] Built target test-gbnf-validator<br>[ 67%] Building C object tests/CMakeFiles/test-mtmd-c-api.dir/test-mtmd-c-api.c.o<br>[ 67%] Linking C executable ../bin/test-mtmd-c-api<br>[ 67%] Built target test-mtmd-c-api<br>[ 67%] Building CXX object tests/CMakeFiles/test-mtmd-impl.dir/test-mtmd-impl.cpp.o<br>[ 67%] Building CXX object common/CMakeFiles/llama-common.dir/imatrix-loader.cpp.o<br>[ 67%] Building CXX object common/CMakeFiles/llama-common.dir/json-schema-to-grammar.cpp.o<br>[ 67%] Linking CXX executable ../bin/test-mtmd-impl<br>[ 67%] Built target test-mtmd-impl<br>[ 67%] Building C object tests/CMakeFiles/test-c.dir/test-c.c.o<br>[ 68%] Linking C executable ../bin/test-c<br>[ 68%] Built target test-c<br>[ 68%] Building CXX object examples/simple/CMakeFiles/llama-simple.dir/simple.cpp.o<br>[ 69%] Linking CXX executable ../../bin/llama-simple<br>[ 69%] Built target llama-simple<br>[ 69%] Building CXX object examples/simple-chat/CMakeFiles/llama-simple-chat.dir/simple-chat.cpp.o<br>[ 69%] Linking CXX executable ../../bin/llama-simple-chat<br>[ 69%] Built target llama-simple-chat<br>[ 69%] Building CXX object common/CMakeFiles/llama-common.dir/json-schema.cpp.o<br>[ 69%] Building CXX object common/CMakeFiles/llama-common.dir/json.cpp.o<br>[ 70%] Building CXX object common/CMakeFiles/llama-common.dir/llguidance.cpp.o<br>[ 70%] Building CXX object common/CMakeFiles/llama-common.dir/log.cpp.o<br>[ 70%] Building CXX object common/CMakeFiles/llama-common.dir/ngram-cache.cpp.o<br>[ 70%] Building CXX object common/CMakeFiles/llama-common.dir/ngram-map.cpp.o<br>[ 70%] Building CXX object common/CMakeFiles/llama-common.dir/ngram-mod.cpp.o<br>[ 70%] Building CXX object common/CMakeFiles/llama-common.dir/peg-parser.cpp.o<br>[ 71%] Building CXX object common/CMakeFiles/llama-common.dir/preset.cpp.o<br>[ 71%] Building CXX object common/CMakeFiles/llama-common.dir/reasoning-budget.cpp.o<br>[ 71%] Building CXX object common/CMakeFiles/llama-common.dir/sampling.cpp.o<br>[ 71%] Building CXX object common/CMakeFiles/llama-common.dir/speculative.cpp.o<br>[ 71%] Building CXX object common/CMakeFiles/llama-common.dir/subproc.cpp.o<br>[ 71%] Building CXX object common/CMakeFiles/llama-common.dir/trie.cpp.o<br>[ 72%] Building CXX object common/CMakeFiles/llama-common.dir/unicode.cpp.o<br>[ 72%] Building CXX object common/CMakeFiles/llama-common.dir/jinja/lexer.cpp.o<br>[ 72%] Building CXX object common/CMakeFiles/llama-common.dir/jinja/parser.cpp.o<br>[ 72%] Building CXX object common/CMakeFiles/llama-common.dir/jinja/runtime.cpp.o<br>[ 72%] Building CXX object common/CMakeFiles/llama-common.dir/jinja/value.cpp.o<br>[ 72%] Building CXX object common/CMakeFiles/llama-common.dir/jinja/string.cpp.o<br>[ 73%] Building CXX object common/CMakeFiles/llama-common.dir/jinja/caps.cpp.o<br>[ 73%] Linking CXX shared library ../bin/libllama-common.so<br>[ 73%] Built target llama-common<br>[ 73%] Building CXX object tests/CMakeFiles/test-llama-context.dir/test-llama-context.cpp.o<br>[ 74%] Building CXX object tests/CMakeFiles/test-tokenizer-0.dir/test-tokenizer-0.cpp.o<br>[ 74%] Linking CXX executable ../bin/test-tokenizer-0<br>[ 74%] Built target test-tokenizer-0<br>[ 74%] Building CXX object tests/CMakeFiles/test-reasoning-budget.dir/test-reasoning-budget.cpp.o<br>[ 74%] Linking CXX executable ../bin/test-reasoning-budget<br>[ 74%] Built target test-reasoning-budget<br>[ 74%] Building CXX object tests/CMakeFiles/test-grammar-integration.dir/test-grammar-integration.cpp.o<br>[ 74%] Building CXX object tests/CMakeFiles/test-llama-context.dir/llama-context/cases-kv.cpp.o<br>[ 74%] Linking CXX executable ../bin/test-grammar-integration<br>[ 74%] Built target test-grammar-integration<br>[ 74%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-chat.cpp.o<br>[ 75%] Building CXX object tests/CMakeFiles/test-llama-context.dir/llama-context/cases-rs.cpp.o<br>[ 75%] Building CXX object tests/CMakeFiles/test-llama-context.dir/llama-context/test-case.cpp.o<br>[ 75%] Building CXX object tests/CMakeFiles/test-llama-context.dir/llama-context/test-log.cpp.o<br>[ 75%] Building CXX object tests/CMakeFiles/test-llama-context.dir/llama-context/test-runner.cpp.o<br>[ 75%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-task.cpp.o<br>[ 75%] Building CXX object tests/CMakeFiles/test-llama-context.dir/llama-context/test-util.cpp.o<br>[ 75%] Linking CXX executable ../bin/test-llama-context<br>[ 75%] Built target test-llama-context<br>[ 76%] Building CXX object tests/CMakeFiles/test-json-schema-to-grammar.dir/test-json-schema-to-grammar.cpp.o<br>[ 76%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-queue.cpp.o<br>[ 76%] Linking CXX executable ../bin/test-json-schema-to-grammar<br>[ 76%] Built target test-json-schema-to-grammar<br>[ 76%] Building CXX object tests/CMakeFiles/test-quantize-stats.dir/test-quantize-stats.cpp.o<br>[ 76%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-common.cpp.o<br>[ 76%] Linking CXX executable ../bin/test-quantize-stats<br>[ 76%] Built target test-quantize-stats<br>[ 76%] Building CXX object tests/CMakeFiles/test-tokenizer-1-bpe.dir/test-tokenizer-1-bpe.cpp.o<br>[ 76%] Linking CXX executable ../bin/test-tokenizer-1-bpe<br>[ 76%] Built target test-tokenizer-1-bpe<br>[ 76%] Building CXX object tests/CMakeFiles/test-tokenizer-1-spm.dir/test-tokenizer-1-spm.cpp.o<br>[ 76%] Linking CXX executable ../bin/test-tokenizer-1-spm<br>[ 76%] Built target test-tokenizer-1-spm<br>[ 76%] Building CXX object tests/CMakeFiles/test-llama-archs.dir/test-llama-archs.cpp.o<br>[ 77%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-decision.cpp.o<br>[ 77%] Linking CXX executable ../bin/test-llama-archs<br>[ 77%] Built target test-llama-archs<br>[ 78%] Building CXX object tests/CMakeFiles/test-fp8.dir/test-fp8.cpp.o<br>[ 78%] Linking CXX executable ../bin/test-fp8<br>[ 78%] Built target test-fp8<br>[ 79%] Building CXX object tests/CMakeFiles/test-speculative-rejection-sampling.dir/test-speculative-rejection-sampling.cpp.o<br>[ 79%] Linking CXX executable ../bin/test-speculative-rejection-sampling<br>[ 79%] Built target test-speculative-rejection-sampling<br>[ 79%] Building CXX object tests/CMakeFiles/test-fusion.dir/test-fusion.cpp.o<br>[ 79%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-context.cpp.o<br>[ 79%] Linking CXX executable ../bin/test-fusion<br>[ 79%] Built target test-fusion<br>[ 79%] Building CXX object tests/CMakeFiles/test-chat-peg-parser.dir/test-chat-peg-parser.cpp.o<br>[ 79%] Building CXX object tests/CMakeFiles/test-chat-peg-parser.dir/peg-parser/simple-tokenize.cpp.o<br>[ 79%] Linking CXX executable ../bin/test-chat-peg-parser<br>[ 79%] Built target test-chat-peg-parser<br>[ 79%] Building CXX object tests/CMakeFiles/test-jinja.dir/test-jinja.cpp.o<br>[ 79%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-realtime.cpp.o<br>[ 79%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-stream.cpp.o<br>[ 79%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-tools.cpp.o<br>[ 79%] Linking CXX executable ../bin/test-jinja<br>[ 79%] Built target test-jinja<br>[ 79%] Building CXX object tests/CMakeFiles/test-json-schema.dir/test-json-schema.cpp.o<br>[ 79%] Linking CXX executable ../bin/test-json-schema<br>[ 79%] Built target test-json-schema<br>[ 79%] Building CXX object tests/CMakeFiles/test-chat-auto-parser.dir/test-chat-auto-parser.cpp.o<br>[ 79%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-mcp.cpp.o<br>[ 80%] Building CXX object tools/server/CMakeFiles/server-context.dir/server-schema.cpp.o<br>[ 80%] Linking CXX static library libserver-context.a<br>[ 80%] Built target server-context<br>[ 80%] Building CXX object tests/CMakeFiles/test-chat-template.dir/test-chat-template.cpp.o<br>[ 81%] Linking CXX executable ../bin/test-chat-auto-parser<br>[ 81%] Built target test-chat-auto-parser<br>[ 81%] Building CXX object tests/CMakeFiles/test-chat-analysis.dir/test-chat-analysis.cpp.o<br>[ 81%] Linking CXX executable ../bin/test-chat-template<br>[ 81%] Built target test-chat-template<br>[ 81%] Building CXX object tests/CMakeFiles/test-log.dir/test-log.cpp.o<br>[ 81%] Linking CXX executable ../bin/test-log<br>[ 81%] Built target test-log<br>[ 81%] Building CXX object tests/CMakeFiles/test-peg-parser.dir/test-peg-parser.cpp.o<br>[ 81%] Linking CXX executable ../bin/test-chat-analysis<br>[ 81%] Built target test-chat-analysis<br>[ 81%] Building CXX object tests/CMakeFiles/test-thread-safety.dir/test-thread-safety.cpp.o<br>[ 81%] Linking CXX executable ../bin/test-thread-safety<br>[ 81%] Built target test-thread-safety<br>[ 81%] Building CXX object tests/CMakeFiles/test-arg-parser.dir/test-arg-parser.cpp.o<br>[ 81%] Linking CXX executable ../bin/test-arg-parser<br>[ 81%] Built target test-arg-parser<br>[ 82%] Building CXX object tests/CMakeFiles/test-model-resolution.dir/test-model-resolution.cpp.o<br>[ 82%] Building CXX object tests/CMakeFiles/test-peg-parser.dir/peg-parser/simple-tokenize.cpp.o<br>[ 82%] Building CXX object tests/CMakeFiles/test-peg-parser.dir/peg-parser/test-basic.cpp.o<br>[ 82%] Building CXX object tests/CMakeFiles/test-peg-parser.dir/peg-parser/test-gbnf-generation.cpp.o<br>[ 82%] Linking CXX executable ../bin/test-model-resolution<br>[ 82%] Built target test-model-resolution<br>[ 82%] Building CXX object tests/CMakeFiles/test-model-load-cancel.dir/test-model-load-cancel.cpp.o<br>[ 82%] Linking CXX executable ../bin/test-model-load-cancel<br>[ 82%] Built target test-model-load-cancel<br>[ 82%] Building CXX object tests/CMakeFiles/test-autorelease.dir/test-autorelease.cpp.o<br>[ 83%] Linking CXX executable ../bin/test-autorelease<br>[ 83%] Built target test-autorelease<br>[ 83%] Building CXX object tests/CMakeFiles/test-backend-sampler.dir/test-backend-sampler.cpp.o<br>[ 83%] Linking CXX executable ../bin/test-backend-sampler<br>[ 83%] Built target test-backend-sampler<br>[ 83%] Building CXX object tests/CMakeFiles/test-export-graph-ops.dir/test-export-graph-ops.cpp.o<br>[ 84%] Building CXX object tests/CMakeFiles/test-peg-parser.dir/peg-parser/test-json-parser.cpp.o<br>[ 84%] Linking CXX executable ../bin/test-export-graph-ops<br>[ 84%] Built target test-export-graph-ops<br>[ 84%] Building CXX object examples/batched/CMakeFiles/llama-batched.dir/batched.cpp.o<br>[ 84%] Linking CXX executable ../../bin/llama-batched<br>[ 84%] Built target llama-batched<br>[ 85%] Building CXX object examples/debug/CMakeFiles/llama-debug.dir/debug.cpp.o<br>[ 85%] Building CXX object tests/CMakeFiles/test-peg-parser.dir/peg-parser/test-python-dict-parser.cpp.o<br>[ 85%] Linking CXX executable ../../bin/llama-debug<br>[ 85%] Built target llama-debug<br>[ 86%] Building CXX object examples/embedding/CMakeFiles/llama-embedding.dir/embedding.cpp.o<br>[ 86%] Building CXX object tests/CMakeFiles/test-peg-parser.dir/peg-parser/test-unicode.cpp.o<br>[ 86%] Linking CXX executable ../../bin/llama-embedding<br>[ 86%] Built target llama-embedding<br>[ 86%] Building CXX object examples/eval-callback/CMakeFiles/llama-eval-callback.dir/eval-callback.cpp.o<br>[ 86%] Linking CXX executable ../../bin/llama-eval-callback<br>[ 86%] Built target llama-eval-callback<br>[ 86%] Building CXX object examples/idle/CMakeFiles/llama-idle.dir/idle.cpp.o<br>[ 86%] Linking CXX executable ../../bin/llama-idle<br>[ 86%] Built target llama-idle<br>[ 86%] Building CXX object examples/lookahead/CMakeFiles/llama-lookahead.dir/lookahead.cpp.o<br>[ 86%] Linking CXX executable ../bin/test-peg-parser<br>[ 86%] Built target test-peg-parser<br>[ 87%] Building CXX object examples/lookup/CMakeFiles/llama-lookup.dir/lookup.cpp.o<br>[ 87%] Linking CXX executable ../../bin/llama-lookahead<br>[ 87%] Built target llama-lookahead<br>[ 87%] Building CXX object examples/lookup/CMakeFiles/llama-lookup-create.dir/lookup-create.cpp.o<br>[ 87%] Linking CXX executable ../../bin/llama-lookup<br>[ 87%] Built target llama-lookup<br>[ 87%] Building CXX object examples/lookup/CMakeFiles/llama-lookup-merge.dir/lookup-merge.cpp.o<br>[ 87%] Linking CXX executable ../../bin/llama-lookup-create<br>[ 87%] Linking CXX executable ../../bin/llama-lookup-merge<br>[ 87%] Built target llama-lookup-create<br>[ 87%] Built target llama-lookup-merge<br>[ 88%] Building CXX object examples/lookup/CMakeFiles/llama-lookup-stats.dir/lookup-stats.cpp.o<br>[ 88%] Building CXX object examples/parallel/CMakeFiles/llama-parallel.dir/parallel.cpp.o<br>[ 88%] Linking CXX executable ../../bin/llama-lookup-stats<br>[ 88%] Built target llama-lookup-stats<br>[ 88%] Building CXX object examples/passkey/CMakeFiles/llama-passkey.dir/passkey.cpp.o<br>[ 88%] Linking CXX executable ../../bin/llama-parallel<br>[ 88%] Built target llama-parallel<br>[ 88%] Building CXX object examples/retrieval/CMakeFiles/llama-retrieval.dir/retrieval.cpp.o<br>[ 88%] Linking CXX executable ../../bin/llama-passkey<br>[ 88%] Built target llama-passkey<br>[ 88%] Building CXX object examples/speculative/CMakeFiles/llama-speculative.dir/speculative.cpp.o<br>[ 88%] Linking CXX executable ../../bin/llama-retrieval<br>[ 88%] Built target llama-retrieval<br>[ 88%] Building CXX object examples/speculative-simple/CMakeFiles/llama-speculative-simple.dir/speculative-simple.cpp.o<br>[ 89%] Linking CXX executable ../../bin/llama-speculative-simple<br>[ 89%] Built target llama-speculative-simple<br>[ 89%] Building CXX object examples/gen-docs/CMakeFiles/llama-gen-docs.dir/gen-docs.cpp.o<br>[ 89%] Linking CXX executable ../../bin/llama-speculative<br>[ 89%] Built target llama-speculative<br>[ 90%] Building CXX object examples/training/CMakeFiles/llama-finetune.dir/finetune.cpp.o<br>[ 90%] Linking CXX executable ../../bin/llama-finetune<br>[ 90%] Linking CXX executable ../../bin/llama-gen-docs<br>[ 90%] Built target llama-finetune<br>[ 90%] Built target llama-gen-docs<br>[ 90%] Building CXX object examples/diffusion/CMakeFiles/llama-diffusion.dir/diffusion.cpp.o<br>[ 90%] Building CXX object examples/convert-llama2c-to-ggml/CMakeFiles/llama-convert-llama2c-to-ggml.dir/convert-llama2c-to-ggml.cpp.o<br>[ 90%] Linking CXX static library libllama-diffusion.a<br>[ 90%] Built target llama-diffusion<br>[ 90%] Building CXX object pocs/vdot/CMakeFiles/llama-vdot.dir/vdot.cpp.o<br>[ 90%] Linking CXX executable ../../bin/llama-convert-llama2c-to-ggml<br>[ 90%] Built target llama-convert-llama2c-to-ggml<br>[ 90%] Building CXX object pocs/vdot/CMakeFiles/llama-q8dot.dir/q8dot.cpp.o<br>[ 90%] Linking CXX executable ../../bin/llama-vdot<br>[ 90%] Built target llama-vdot<br>[ 90%] Building CXX object tools/batched-bench/CMakeFiles/llama-batched-bench-impl.dir/batched-bench.cpp.o<br>[ 90%] Linking CXX executable ../../bin/llama-q8dot<br>[ 90%] Built target llama-q8dot<br>[ 90%] Building CXX object tools/gguf-split/CMakeFiles/llama-gguf-split.dir/gguf-split.cpp.o<br>[ 90%] Linking CXX executable ../../bin/llama-gguf-split<br>[ 90%] Built target llama-gguf-split<br>[ 91%] Building CXX object tools/imatrix/CMakeFiles/llama-imatrix.dir/imatrix.cpp.o<br>[ 92%] Linking CXX shared library ../../bin/libllama-batched-bench-impl.so<br>[ 92%] Built target llama-batched-bench-impl<br>[ 92%] Building CXX object tools/llama-bench/CMakeFiles/llama-bench-impl.dir/llama-bench.cpp.o<br>[ 92%] Linking CXX executable ../../bin/llama-imatrix<br>[ 92%] Built target llama-imatrix<br>[ 93%] Building CXX object tools/completion/CMakeFiles/llama-completion-impl.dir/completion.cpp.o<br>[ 93%] Linking CXX shared library ../../bin/libllama-completion-impl.so<br>[ 93%] Built target llama-completion-impl<br>[ 93%] Building CXX object tools/perplexity/CMakeFiles/llama-perplexity-impl.dir/perplexity.cpp.o<br>[ 93%] Linking CXX shared library ../../bin/libllama-bench-impl.so<br>[ 93%] Built target llama-bench-impl<br>[ 93%] Building CXX object tools/quantize/CMakeFiles/llama-quantize-impl.dir/quantize.cpp.o<br>[ 93%] Linking CXX shared library ../../bin/libllama-quantize-impl.so<br>[ 93%] Built target llama-quantize-impl<br>[ 93%] Building CXX object tools/server/CMakeFiles/llama-server-impl.dir/server.cpp.o<br>[ 93%] Linking CXX shared library ../../bin/libllama-perplexity-impl.so<br>[ 93%] Built target llama-perplexity-impl<br>[ 93%] Building CXX object tools/tokenize/CMakeFiles/llama-tokenize.dir/tokenize.cpp.o<br>[ 93%] Linking CXX executable ../../bin/llama-tokenize<br>[ 93%] Built target llama-tokenize<br>[ 93%] Building CXX object tools/tts/CMakeFiles/llama-tts.dir/tts.cpp.o<br>[ 93%] Linking CXX executable ../../bin/llama-tts<br>[ 93%] Built target llama-tts<br>[ 93%] Building CXX object tools/mtmd/CMakeFiles/llama-mtmd-cli.dir/mtmd-cli.cpp.o<br>[ 94%] Building CXX object tools/server/CMakeFiles/llama-server-impl.dir/server-connect.cpp.o<br>[ 94%] Building CXX object tools/server/CMakeFiles/llama-server-impl.dir/server-http.cpp.o<br>[ 94%] Linking CXX executable ../../bin/llama-mtmd-cli<br>[ 94%] Built target llama-mtmd-cli<br>[ 95%] Building CXX object tools/mtmd/CMakeFiles/llama-mtmd-debug.dir/debug/mtmd-debug.cpp.o<br>[ 95%] Linking CXX executable ../../bin/llama-mtmd-debug<br>[ 95%] Built target llama-mtmd-debug<br>[ 95%] Building CXX object tools/cvector-generator/CMakeFiles/llama-cvector-generator.dir/cvector-generator.cpp.o<br>[ 95%] Linking CXX executable ../../bin/llama-cvector-generator<br>[ 95%] Built target llama-cvector-generator<br>[ 95%] Building CXX object tools/export-lora/CMakeFiles/llama-export-lora.dir/export-lora.cpp.o<br>[ 95%] Building CXX object tools/server/CMakeFiles/llama-server-impl.dir/server-models.cpp.o<br>[ 95%] Linking CXX executable ../../bin/llama-export-lora<br>[ 95%] Built target llama-export-lora<br>[ 95%] Building CXX object tools/fit-params/CMakeFiles/llama-fit-params-impl.dir/fit-params.cpp.o<br>[ 95%] Linking CXX shared library ../../bin/libllama-fit-params-impl.so<br>[ 95%] Built target llama-fit-params-impl<br>[ 95%] Building CXX object tools/results/CMakeFiles/llama-results.dir/results.cpp.o<br>[ 96%] Linking CXX executable ../../bin/llama-results<br>[ 96%] Built target llama-results<br>[ 96%] Building CXX object tools/server/CMakeFiles/llama-server-impl.dir/server-models-sched.cpp.o<br>[ 96%] Building CXX object tests/CMakeFiles/test-chat.dir/test-chat.cpp.o<br>[ 96%] Linking CXX shared library ../../bin/libllama-server-impl.so<br>[ 96%] Built target llama-server-impl<br>[ 96%] Building CXX object tests/CMakeFiles/test-server-component.dir/test-server-component.cpp.o<br>[ 96%] Linking CXX executable ../bin/test-server-component<br>[ 96%] Built target test-server-component<br>[ 96%] Building CXX object examples/diffusion/CMakeFiles/llama-diffusion-cli.dir/diffusion-cli.cpp.o<br>[ 96%] Linking CXX executable ../../bin/llama-diffusion-cli<br>[ 96%] Built target llama-diffusion-cli<br>[ 96%] Building CXX object tools/batched-bench/CMakeFiles/llama-batched-bench.dir/main.cpp.o<br>[ 96%] Linking CXX executable ../../bin/llama-batched-bench<br>[ 96%] Built target llama-batched-bench<br>[ 96%] Building CXX object tools/llama-bench/CMakeFiles/llama-bench.dir/main.cpp.o<br>[ 96%] Linking CXX executable ../../bin/llama-bench<br>[ 96%] Built target llama-bench<br>[ 96%] Building CXX object tools/completion/CMakeFiles/llama-completion.dir/main.cpp.o<br>[ 96%] Linking CXX executable ../../bin/llama-completion<br>[ 96%] Built target llama-completion<br>[ 96%] Building CXX object tools/perplexity/CMakeFiles/llama-perplexity.dir/main.cpp.o<br>[ 97%] Linking CXX executable ../../bin/llama-perplexity<br>[ 97%] Built target llama-perplexity<br>[ 97%] Building CXX object tools/quantize/CMakeFiles/llama-quantize.dir/main.cpp.o<br>[ 98%] Linking CXX executable ../../bin/llama-quantize<br>[ 98%] Built target llama-quantize<br>[ 98%] Building CXX object tools/cli/CMakeFiles/llama-cli-impl.dir/cli.cpp.o<br>[ 98%] Building CXX object tools/cli/CMakeFiles/llama-cli-impl.dir/cli-client.cpp.o<br>[ 98%] Building CXX object tools/cli/CMakeFiles/llama-cli-impl.dir/cli-context.cpp.o<br>[ 98%] Linking CXX executable ../bin/test-chat<br>[ 98%] Built target test-chat<br>[ 98%] Building CXX object tools/server/CMakeFiles/llama-server.dir/main.cpp.o<br>[ 98%] Linking CXX executable ../../bin/llama-server<br>[ 98%] Built target llama-server<br>[ 98%] Building CXX object tools/fit-params/CMakeFiles/llama-fit-params.dir/main.cpp.o<br>[ 98%] Linking CXX executable ../../bin/llama-fit-params<br>[ 98%] Built target llama-fit-params<br>[ 98%] Linking CXX shared library ../../bin/libllama-cli-impl.so<br>[ 98%] Built target llama-cli-impl<br>[ 98%] Building CXX object tools/cli/CMakeFiles/llama-cli.dir/main.cpp.o<br>[ 98%] Building CXX object app/CMakeFiles/llama-app.dir/llama.cpp.o<br>[ 99%] Linking CXX executable ../../bin/llama-cli<br>[ 99%] Built target llama-cli<br>[ 99%] Building CXX object app/CMakeFiles/llama-app.dir/download.cpp.o<br>[ 99%] Building CXX object app/CMakeFiles/llama-app.dir/__/license.cpp.o<br>[100%] Linking CXX executable ../bin/llama<br>[100%] Built target llama-app</pre><h3>Check installed llama version</h3><pre>$ ./build/bin/llama-cli --version<br>version: 0.9.0-dev (build 12156, commit 45b6604b2)<br>built with GNU 13.3.0 for Linux x86_64<br></pre><h3>Run the llama.cpp infererence server</h3><p>llama requires a config to specify the required CUDA GPU server to be used. To find the correct GPU number, run this command:</p><pre>$ ./build/bin/llama-cli --list-devices<br>Available devices:<br>  CUDA0: NVIDIA GeForce RTX 4060 Ti (15947 MiB, 15807 MiB free)<br>  CUDA1: Quadro P400 (1992 MiB, 1683 MiB free)</pre><p>As you can see, the required GPU is assigned the number 0. Let’s run the llama server with bartowski/Qwen2.5-Coder-7B-Instruct-GGUF LLM coding model on port 8080 and network address 192.168.1.4</p><pre>$ CUDA_VISIBLE_DEVICES=0 GGML_CUDA_PDL=0 ./build/bin/llama-server \<br>  -hf bartowski/Qwen2.5-Coder-14B-Instruct-GGUF:Q4_K_M \<br>  -ngl 99 \<br>  -c 32768 \<br>  -n -1 \<br>  --jinja \<br>  --host 192.168.1.16 \<br>  --port 8080<br>0.00.090.023 I srv  llama_server: initializing ...<br>0.00.718.893 I cmn  common_param: common_params_print_info: verbosity = 3 (adjust with the `-lv N` CLI arg)<br>0.00.719.526 W srv  server_setup: security: no API key is set and CORS allows all origins (see https://github.com/ggml-org/llama.cpp/pull/25655)<br>0.00.722.304 I srv    load_model: loading model &#39;bartowski/Qwen2.5-Coder-14B-Instruct-GGUF:Q4_K_M&#39;<br>0.01.079.013 W load: control-looking token: 128247 &#39;&lt;/s&gt;&#39; was not control-type; this is probably a bug in the model. its type will be overridden<br>0.02.434.416 I cmn          init: llama threadpool init, n_threads = 8<br>0.02.611.756 I srv    load_model: initializing, n_slots = 4, n_ctx_slot = 32768, kv_unified = &#39;true&#39;<br>0.02.616.069 I srv  server_run_i: model loaded<br>0.02.616.075 I srv  server_on_li: listening on http://192.168.1.16:8080</pre><h4>Important runtime configurations</h4><p>-cis the context size (--ctx-size). It sets the total number of tokens the model can hold in its working memory at once: your prompt, the conversation history, and the generated reply all count toward this limit. A bigger value lets you have longer conversations or feed in larger files, but it uses more VRAM. Also, this context is shared across all parallel slots (if you use -np/--parallel, each slot gets c / np tokens). In my case, I am the only one using the local LLM server, so I dont need to worry about parallel requests to the LLM server.</p><p>-nis the max tokens to predict (--n-predict). It caps how many tokens the model will generate in a single response. Once it hits 512 new tokens, it stops, even mid-sentence. The default is -1, which means unlimited (until the model emits an end-of-sequence token or the context fills up).</p><p>-ngl stands for number of GPU layers. A value of 99 offloads maximum model layers to the GPU, and execute with CUDA; rest that do not fit the GPU, are handled by the CPU.</p><p>-hf downloads the model from Hugging Face.</p><p><strong>Tips to select ideal value for these config</strong></p><ul><li>We have 16 GB VRAM. Lets calculate how much memory is required to run the model and support a reasonable token size. As per the Hugging Face documentation <a href="https://huggingface.co/bartowski/Qwen2.5-Coder-7B-Instruct-GGUF">here</a>, this model is derived from <a href="https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF">Qwen/Qwen2.5-Coder-7B-Instruct-GGUF</a> . Browsing through both these documentation pages, and the parent <a href="https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct/raw/main/config.json">config</a> file, we can conclude the below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2CSJOBIM4nhDgBqHAo1ug.png" /></figure><ul><li>Using the above table, approximate size of the bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M in memory would be:</li></ul><pre>Model size = 4.68 GB</pre><p>This is clearly mentioned as the Quantization size for q4_K_M</p><ul><li>Let’s calculate the size of each token:</li></ul><pre>bytes_per_token = 2 × n_layers × <br>                  n_kv_heads × <br>                  (hidden_size/num_attention_heads) × <br>                  bytes_per_element (default KV cache type in llama is f16, which is 2 bytes)<br>                = 2 * 28 * 4 * (3584/28) * 2 <br>                = 56 KB per token</pre><ul><li>So, with -c 32768 , would need:<br>56KB * 32768 ~ 1.8 GB; and the model itself needs 4.68 + 1.8 = 6.48 GB, ie fits comfortably within 16 GV VRAM.</li></ul><h3>Footnotes</h3><h4>Check if the LLM GPU is getting used</h4><p>Notice how the GPU VRAM usage percentage of the NVIDIA Rtx 4060 Ti has gone up from 13 Mb to 4703Mb.</p><pre><br>$ nvidia-smi<br>Fri Nov  6 11:09:36 2026<br>+-----------------------------------------------------------------------------------------+<br>| NVIDIA-SMI 580.178.04             Driver Version: 580.178.04     CUDA Version: 13.0     |<br>+-----------------------------------------+------------------------+----------------------+<br>| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |<br>| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |<br>|                                         |                        |               MIG M. |<br>|=========================================+========================+======================|<br>|   0  Quadro P400                    Off |   00000000:04:00.0 Off |                  N/A |<br>| 34%   36C    P8            N/A  /  N/A  |     279MiB /   2048MiB |      0%      Default |<br>|                                         |                        |                  N/A |<br>+-----------------------------------------+------------------------+----------------------+<br>|   1  NVIDIA GeForce RTX 4060 Ti     Off |   00000000:0A:00.0 Off |                  N/A |<br>|  0%   41C    P8             10W /  165W |    4703MiB /  16380MiB |      0%      Default |<br>|                                         |                        |                  N/A |<br>+-----------------------------------------+------------------------+----------------------+<br><br>+-----------------------------------------------------------------------------------------+<br>| Processes:                                                                              |<br>|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |<br>|        ID   ID                                                               Usage      |<br>|=========================================================================================|<br>|    0   N/A  N/A            2577      G   /usr/bin/gnome-shell                    241MiB |<br>|    0   N/A  N/A            2698      G   /usr/bin/Xwayland                         1MiB |<br>|    1   N/A  N/A            2577      G   /usr/bin/gnome-shell                      2MiB |<br>|    1   N/A  N/A            4388      C   ./build/bin/llama-cli                  4682MiB |<br>+-----------------------------------------------------------------------------------------+</pre><p>You can also use the nvtop command to show live GPU statistics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2qbDa2idLfl9AIJxD-u-rA.png" /></figure><h4>Check if the llama.cpp inference server is accessible</h4><p><strong>Using Open API compatible API</strong></p><pre><br>$ curl http://192.168.1.4:8080/v1/models | jq .<br>  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br>                                 Dload  Upload   Total   Spent    Left  Speed<br>100   816  100   816    0     0  24300      0 --:--:-- --:--:-- --:--:-- 24727<br>{<br>  &quot;models&quot;: [<br>    {<br>      &quot;name&quot;: &quot;bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;,<br>      &quot;model&quot;: &quot;bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;,<br>      &quot;modified_at&quot;: &quot;&quot;,<br>      &quot;size&quot;: &quot;&quot;,<br>      &quot;digest&quot;: &quot;&quot;,<br>      &quot;type&quot;: &quot;model&quot;,<br>      &quot;description&quot;: &quot;&quot;,<br>      &quot;tags&quot;: [<br>        &quot;&quot;<br>      ],<br>      &quot;capabilities&quot;: [<br>        &quot;completion&quot;<br>      ],<br>      &quot;parameters&quot;: &quot;&quot;,<br>      &quot;details&quot;: {<br>        &quot;parent_model&quot;: &quot;&quot;,<br>        &quot;format&quot;: &quot;gguf&quot;,<br>        &quot;family&quot;: &quot;&quot;,<br>        &quot;families&quot;: [<br>          &quot;&quot;<br>        ],<br>        &quot;parameter_size&quot;: &quot;&quot;,<br>        &quot;quantization_level&quot;: &quot;&quot;<br>      }<br>    }<br>  ],<br>  &quot;object&quot;: &quot;list&quot;,<br>  &quot;data&quot;: [<br>    {<br>      &quot;id&quot;: &quot;bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;,<br>      &quot;aliases&quot;: [<br>        &quot;bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;<br>      ],<br>      &quot;tags&quot;: [],<br>      &quot;object&quot;: &quot;model&quot;,<br>      &quot;architecture&quot;: {<br>        &quot;input_modalities&quot;: [<br>          &quot;text&quot;<br>        ],<br>        &quot;output_modalities&quot;: [<br>          &quot;text&quot;<br>        ]<br>      },<br>      &quot;created&quot;: 1793945007,<br>      &quot;owned_by&quot;: &quot;llamacpp&quot;,<br>      &quot;meta&quot;: {<br>        &quot;vocab_type&quot;: 2,<br>        &quot;n_vocab&quot;: 152064,<br>        &quot;n_ctx&quot;: 4096,<br>        &quot;n_ctx_train&quot;: 32768,<br>        &quot;n_embd&quot;: 3584,<br>        &quot;n_params&quot;: 7615616512,<br>        &quot;size&quot;: 4677120000,<br>        &quot;ftype&quot;: &quot;Q4_K - Medium&quot;<br>      }<br>    }<br>  ]<br>}</pre><p><strong>Using Anthropic compatible API</strong></p><pre>curl http://192.168.1.4:8080/v1/models | jq .<br>  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br>                                 Dload  Upload   Total   Spent    Left  Speed<br>100   817  100   817    0     0  72083      0 --:--:-- --:--:-- --:--:-- 74272<br>{<br>  &quot;models&quot;: [<br>    {<br>      &quot;name&quot;: &quot;bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;,<br>      &quot;model&quot;: &quot;bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;,<br>      &quot;modified_at&quot;: &quot;&quot;,<br>      &quot;size&quot;: &quot;&quot;,<br>      &quot;digest&quot;: &quot;&quot;,<br>      &quot;type&quot;: &quot;model&quot;,<br>      &quot;description&quot;: &quot;&quot;,<br>      &quot;tags&quot;: [<br>        &quot;&quot;<br>      ],<br>      &quot;capabilities&quot;: [<br>        &quot;completion&quot;<br>      ],<br>      &quot;parameters&quot;: &quot;&quot;,<br>      &quot;details&quot;: {<br>        &quot;parent_model&quot;: &quot;&quot;,<br>        &quot;format&quot;: &quot;gguf&quot;,<br>        &quot;family&quot;: &quot;&quot;,<br>        &quot;families&quot;: [<br>          &quot;&quot;<br>        ],<br>        &quot;parameter_size&quot;: &quot;&quot;,<br>        &quot;quantization_level&quot;: &quot;&quot;<br>      }<br>    }<br>  ],<br>  &quot;object&quot;: &quot;list&quot;,<br>  &quot;data&quot;: [<br>    {<br>      &quot;id&quot;: &quot;bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;,<br>      &quot;aliases&quot;: [<br>        &quot;bartowski/Qwen2.5-Coder-7B-Instruct-GGUF:Q4_K_M&quot;<br>      ],<br>      &quot;tags&quot;: [],<br>      &quot;object&quot;: &quot;model&quot;,<br>      &quot;architecture&quot;: {<br>        &quot;input_modalities&quot;: [<br>          &quot;text&quot;<br>        ],<br>        &quot;output_modalities&quot;: [<br>          &quot;text&quot;<br>        ]<br>      },<br>      &quot;created&quot;: 1793978047,<br>      &quot;owned_by&quot;: &quot;llamacpp&quot;,<br>      &quot;meta&quot;: {<br>        &quot;vocab_type&quot;: 2,<br>        &quot;n_vocab&quot;: 152064,<br>        &quot;n_ctx&quot;: 32768,<br>        &quot;n_ctx_train&quot;: 32768,<br>        &quot;n_embd&quot;: 3584,<br>        &quot;n_params&quot;: 7615616512,<br>        &quot;size&quot;: 4677120000,<br>        &quot;ftype&quot;: &quot;Q4_K - Medium&quot;<br>      }<br>    }<br>  ]<br>}</pre><p>👉 <em>llama.cpp implements both OpenAI-compatible and Anthropic compatible HTTP API to simplify integration with the existing ecosystem of AI applications. Applications that already support the OpenAI/Anthropic API can communicate with locally hosted models through llama.cpp with minimal or no changes to their client-side integration.</em></p><blockquote>The key takeaway: OpenAI/Anthropic compatible API does not mean the model is running on OpenAI/Anthropic infrastructure. It describes the API interface, not the model provider or hosting location.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acf1633ae209" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mysteries of macOS]]></title>
            <link>https://medium.com/@binitabharati/mysteries-of-macos-3b52ac884a6f?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b52ac884a6f</guid>
            <category><![CDATA[macos-networking]]></category>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Thu, 05 Nov 2026 16:48:36 GMT</pubDate>
            <atom:updated>2026-11-05T16:59:14.415Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is this about ?</h3><p>I have started this blog to write down all mysterious issues that I have faced (or will face) while working on MacOS version 27.2 (26B123)</p><h4>Mysterious Case 1</h4><p>I have this home lab set up where my MAC is used as a client and ssh’s into all other machines on my home network. I have done this because some of the other machines on my home network are desktops, which do not have a dedicated terminal.</p><p>I faced this intriguing issue wherein all the machines in my network could reach (ping) each other, except this MAC. It just could not reach the other machines, even though the other Linux based machines on my network could ping the MAC 😕</p><h4>The Solution</h4><p>I realized the ARP table of the MAC did not even contain the entry for the other desktop machine(s). So, seems like something was blocking the ARP request from being broadcasted into the home network (ARP entries are made into the ARP table after broadcast response is received)</p><p>Now, coming to the fix! Mac OS has this weird configuration where access needs to be granted at individual app level to be allowed to communicate with devices on my local network 🙃</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Id_YH8lNNeTQiu0TBszXYg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b52ac884a6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ticket Booking System Design]]></title>
            <link>https://medium.com/@binitabharati/system-design-usecases-81fefcf31def?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/81fefcf31def</guid>
            <category><![CDATA[ticketing-system]]></category>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Thu, 05 Nov 2026 14:50:29 GMT</pubDate>
            <atom:updated>2026-11-05T17:01:35.862Z</atom:updated>
            <content:encoded><![CDATA[<h3>Train ticket booking system</h3><h4>Functional requirement</h4><ul><li>User should be able to search for trains passing through the source station, destination station and the travel date.</li><li>User should be able to book specified number of tickets on selecting the preferred train.</li><li>User enters the passenger information on each ticket like the passenger name, age, ID proof, and also enters the payment source details.</li><li>Ticket(s) gets booked, and money gets deducted.</li><li>In case, when ticket booking fails due to whatever reason, the money should be safe in the user’s bank account. In case, money was deducted and booking does not go through, then the money should be refunded back to the user within a stipulated time.</li></ul><h4>Non functional requirement</h4><ul><li>Search should be performed with low latency; search results should come quickly.</li><li>The system should be consistent (CP). User should never loose money in cases where the ticket(s) is not booked. It’s ok for the system to not be always available. <em>As per CAP theorem, when a network partition occurs, we can either have consistency or availability. It’s always a choice between CP or AP.</em></li></ul><h4>Scale</h4><ul><li>Taking <a href="https://www.irctc.co.in/">irctc</a> itself as an example, as of October 2026, it runs 25,000 trains daily.</li><li>Total number of stations across India is about 8000.</li></ul><h3><strong>Architecture</strong></h3><h4><strong>Use Case 👉 Searching for a train between source and destination stations</strong></h4><p><strong>Functional requirements</strong></p><ul><li>User will input the date of journey, source and destination stations; the date of journey is the date of travel from source station.</li><li>We need to find all trains that match this criteria.</li><li>Only show trains that have seat availability; also show availability count. There is no point listing trains that have no vacant seats between the source and destination stations.</li></ul><p><strong>DB Design</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*7tfM2W2mIwt5aVx2YbJcBA.png" /></figure><p><strong>Solution</strong></p><pre>SELECT<br>    a.train_id,<br>    a.station_code AS src_station,<br>    b.station_code AS destn_station,<br>    -- the total seats available between src and destn station<br>    -- will be the minimum seats available across all stations<br>    -- in the path.<br>    MIN(c.vacant_seats) available_seats<br>FROM train_route a<br>INNER JOIN train_route b<br>    ON a.train_id = b.train_id<br>INNER JOIN train_route c<br>    ON c.train_id = a.train_id<br>WHERE<br>    a.station_code = &lt;src_station_code&gt;<br>    AND b.station_code = &lt;destn_station_code&gt;<br>    AND a.sequence &lt; b.sequence<br>    AND c.sequence &gt;= a.sequence<br>    AND c.sequence &lt; b.sequence<br>    AND a.day_of_week = EXTRACT(ISODOW FROM DATE &#39;2026-01-05&#39;)<br>GROUP BY<br>    a.train_id,<br>    -- we have to group by station_code as we are using min operator<br>    -- group by station_code does not really do anything here<br>    -- as station_code within a train_id is unique<br>    -- else min operator on vacant_seats will complain.<br>    a.station_code,<br>    b.station_code;<br></pre><p><strong>DB scale</strong></p><p>Consider the case where we have 1 billion rows in the table. Without the right indexes, this search query will have huge latency.</p><p>Lets define the indexes that we would need so that search results appear in a timely manner. Look at the fields that we are filtering on.<br>- station_code<br>- train_id<br>- sequence<br>- day_of_week</p><p>Since, train_id and sequence are composite PKs, a B tree index already gets defined on these columns. Multi column indexes are stored sorted in the order of column declarated in the index.Hence, we are still defining composite index with these columns, as we want the index to be stored first sorted by station_code, day_of_week, train_id and lastly sequence.</p><p>Create composite index on source route:</p><pre>CREATE INDEX idx_route_source<br>ON train_route (station_code, day_of_week, train_id, sequence);</pre><p>Similar thought goes behind creating composite index on destination route:</p><pre>CREATE INDEX idx_route_destination<br>ON train_route (station_code, train_id, sequence);</pre><p><strong>Concurreny consideration<br></strong>No special guard rails is required in this case.</p><p><strong>Use Case 👉 Booking a ticket</strong></p><p>Now that, we are able to display the search results to the user with the train numbers and available seats, we will try to book a ticket.</p><p><strong>Functional requirement<br>- </strong>User is not allowed to select any particular seat during booking; seat gets auto allotted.<br>- Same seat number should not get alloted to multiple users.<br>- For simplicity, let us ignore payment requirement, ie tickets will be booked while ignoring the payment status.</p><p><strong>Db Design</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2u1HLhCylOhxCRkhAoEl6Q.png" /></figure><p><strong>Solution<br></strong>- For the sake of simplicity, we will assume that the seat number values can be obtained by mere increment.<br>- Example, in a train with total seats 100, the seat numbers start from 1 and go upto 100.<br>- Everytime booking is attempted, the bookings table will be looked up for the maximum value of assigned seat number so far in the train.<br>- If the assigned seat number is less than the total seats, then, we can just increment the current max assigned seat number to get the seat number for the current booking.<br>- However, in cases, where seat number already has reached the max seat number, get entries from seat_bookings where destination station code falls before the source station code of the booking. You can reuse the seat number from such entries, as the passenger would be getting down in a station that comes before the source station code.</p><p><strong>Concurrency concern<br>- </strong>We have to be carfeul here so that same seat number does not get assigned to passengers in overlapping route.</p><p>Pseudo logic to find seat number (booking_seat_no) given below:</p><pre>--Decide the seat number that you want to grab. It may happen that same<br>--seat number is chosen by concurrent transactions. Since, same seat number<br>--could be allocated, later while actually allocating the seat, <br>- we will deal with this side effect.<br><br>SELECT s.seat_no<br>FROM train_seats s<br>WHERE s.train_id = &lt;train_id&gt;<br><br>AND NOT EXISTS (<br>    SELECT 1<br>    FROM bookings b<br>    WHERE b.train_id = s.train_id<br>      AND b.assigned_seat_no = s.seat_no<br><br>      AND (<br>          b.booking_status = &#39;CONFIRMED&#39;<br>          OR (<br>              b.booking_status = &#39;PENDING_PAYMENT&#39;<br>              AND b.hold_expires_at &gt; CURRENT_TIMESTAMP<br>          )<br>      )<br><br>      AND b.source_seq &lt; &lt;destn_station_code_seq&gt;<br>      AND b.destination_seq &gt; &lt;src_station_code_seq&gt;<br>)<br>ORDER BY s.seat_no<br>LIMIT 1;<br></pre><p>Now, that we have got the seat number, we will assign this seat number to a ticket while ensuring that this seat number does not conflict with other bookings. Basically, what it means is that more than 1 transaction may decide to book the same seat number on a train. If you wonder how, just look at the afore block that explained the pseudo logic to arrive on a seat number.</p><pre>--start transaction<br><br>SELECT seat_no<br>FROM train_seats<br>WHERE train_id = &lt;train_id&gt;<br>  AND seat_no = &lt;booking_seat_no&gt;<br>FOR UPDATE;<br><br>-- double check that the booking_seat_no does not collide with any other <br>-- booking for overlapping stations in the same train. <br>-- we are double checking because some other preceding transaction may<br>-- have already made a booking with this seat number.<br>-- Lock is STILL held here<br><br>-- Check availability<br>SELECT NOT EXISTS (<br>    SELECT 1<br>    FROM bookings b<br>    WHERE b.train_id = &lt;train_id&gt;<br>      AND b.assigned_seat_no = &lt;booking_seat_no&gt;<br><br>      AND b.source_seq &lt; (<br>          SELECT sequence<br>          FROM train_route<br>          WHERE train_id = &lt;train_id&gt;<br>          --seq num for destn_station_code will always be greater <br>          --than src_station_code seq<br>            AND station_code = &lt;destn_station_code&gt;<br>      )<br><br>      AND b.destination_seq &gt; (<br>          SELECT sequence<br>          FROM train_route<br>          WHERE train_id = &lt;train_id&gt;<br>            AND station_code = &lt;src_station_code&gt;<br>      )<br>);<br><br>-- If no such booking exists, then insert booking<br>insert into bookings values <br>(&lt;train_id&gt;, &lt;src_station_code&gt;, &lt;src_station_code_seq&gt;, <br>&lt;destn_station&gt;, &lt;destn_station_code_seq&gt;, <br>&lt;booking_seat_no&gt;, &lt;passengerId&gt;);<br>-- update available seats in train_route for source station_code till<br>-- destination code<br>UPDATE train_route<br>SET vacant_seats = vacant_seats - 1<br>WHERE train_id = &lt;train_id&gt;<br>  AND sequence &gt;= (<br>      SELECT sequence<br>      FROM train_route<br>      WHERE train_id = &lt;train_id&gt;<br>        AND station_code = &lt;src_station_code&gt;<br>  )<br>  AND sequence &lt; (<br>      SELECT sequence<br>      FROM train_route<br>      WHERE train_id = &lt;train_id&gt;<br>        AND station_code = &lt;destn_station_code&gt;<br>  )<br> AND vacant_seats &gt; 0;<br>COMMIT;  -- Lock released here<br>--commit transaction</pre><p>select for update locks the matched row, ie only one transaction can execute this statement at a time, any other transaction gets blocked.So, no other transactions can enter the transaction block where select for update is executed until the transaction completes.</p><h4>Footnote</h4><p>Although, in this case, we are maintaining the consistency of the ticket booking process by using select for updateand locking the row for a particular (train_id,seat_number). However, supposing we were not using select for update, and used plain update queries, in which case lets talk about how Postgres handles concurrent updates. <br>So, if an update query’s selected row(s) collides with any other ongoing update query, then the update query needs to hold on till the transaction containing the colliding row(s) complete. After that, the blocked update query is executed freshly. The phenomenon is known as <a href="https://github.com/postgres/postgres/blob/master/src/test/isolation/specs/eval-plan-qual.spec">Eval Plan Qual</a></p><p><a href="https://github.com/postgres/postgres/blob/master/src/test/isolation/specs/eval-plan-qual.spec">Eval Plan Qual</a> (often abbreviated as EPQ) is PostgreSQL’s internal infrastructure used to prevent lost updates and re-evaluate row qualifications under the READ COMMITTED isolation level. When a command (UPDATE, DELETE, SELECT FOR UPDATE, or SELECT FOR SHARE) attempts to lock or modify a row that has already been concurrently updated by another committed transaction, PostgreSQL triggers an EPQ recheck. <br>Also, update query can be used with RETURNING &lt;modified_columns&gt;. From a client perspective, if the expected count of &lt;modified_columns&gt; does not match what is expected, then client knows that full update failed, and transaction can be rolled back.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81fefcf31def" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hop, Walk or Run — What Kind of Processor Are You Running On?]]></title>
            <link>https://medium.com/@binitabharati/hop-walk-or-run-what-kind-of-processor-are-you-running-on-5f167327d3c9?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f167327d3c9</guid>
            <category><![CDATA[gpu-computing]]></category>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Sat, 12 Sep 2026 19:51:52 GMT</pubDate>
            <atom:updated>2026-10-29T11:11:51.118Z</atom:updated>
            <content:encoded><![CDATA[<h3>Scope</h3><p>In this article, I’ll focus on three processor environments that are particularly relevant when discussing application performance and AI workloads as of 2026:</p><p><strong>CPU</strong> — General-purpose processors designed to handle a wide variety of workloads.</p><p><strong>Apple Silicon</strong> — Apple’s ARM-based processors, which use a System-on-Chip (SoC) design that integrates CPU cores, GPU cores, and other specialized processing units, such as the Neural Engine, into a single chip.</p><p><strong>NVIDIA GPU</strong> — Highly parallel processors designed to execute large numbers of operations concurrently, making them particularly well suited to workloads such as image/video processing, machine learning, and scientific computing.</p><p>The goal is not to declare one category universally “better” than another. Instead, I want to understand why the same piece of software can perform very differently depending on the processor it runs on.</p><p>That difference in how computation is performed ultimately determines which processor is best suited to a particular workload. A processor isn’t fast or slow in isolation; it’s the workload that determines which architecture can exploit its strengths.</p><h3>Experiment 1 — Highly parallel media processing — GPU advantage</h3><p>We will take a 4K MP4 video as input and apply Sobel edge detection to every frame, producing an edge-detected MP4 video as the output.</p><p>Sobel edge detection is a good choice for this experiment because the calculation for each output pixel can be performed independently. Although each pixel needs to read a small neighborhood of surrounding pixels, the result for one output pixel does not depend on the result computed for another output pixel. This makes Sobel a good example of a workload that can be parallelized across multiple CPU threads or thousands of GPU threads.</p><p>Here, 4K resolution refers to a video with a resolution of <strong>3840 × 2160 pixels</strong>. The “4K” name comes from the approximate 4,000-pixel horizontal width of the image; 3840 pixels is approximately 4K.</p><p>This experiment will be performed on the three processor environments described above.</p><h3>Experiment Code Base</h3><h3>CPU-Based Code</h3><p>All image-processing operations in this version of the C code are performed on the CPU.</p><p>The overall processing pipeline looks like this:</p><pre>4K MP4<br>   │<br>   ▼<br>FFmpeg MP4 demuxer<br>(Separates streams from the MP4 container)<br>   │<br>   │ compressed video packets<br>   ▼<br>FFmpeg decoder<br>   │<br>   │ decoded YUV420P frame<br>   ▼<br>Extract Y (luma) plane<br>   │<br>   ▼<br>Copy Y → CPU grayscale buffer<br>   │<br>   ▼<br>Multithreaded Sobel<br>   │<br>   ├── Thread 0 → part of image rows<br>   ├── Thread 1 → part of image rows<br>   ├── Thread 2 → part of image rows<br>   ├── ...<br>   └── Thread n → part of image rows<br>   │<br>   ▼<br>Sobel output<br>   │<br>   ▼<br>Put Sobel result into Y plane<br>U = 128<br>V = 128<br>   │<br>   ▼<br>YUV420P frame<br>   │<br>   ▼<br>libx264 encoder<br>   │<br>   │ compressed H.264 packets<br>   ▼<br>FFmpeg MP4 muxer<br>(Combines streams into an MP4 container)<br>   │<br>   ▼<br>Output MP4</pre><h3>GPU-Based Code</h3><p>This version was written for an NVIDIA GeForce RTX 4060 Ti GPU using the CUDA toolkit.</p><p>The video decoding, Sobel processing, and encoding are performed using NVIDIA hardware; hence, the decoded video frames remain in GPU memory during the main processing pipeline. However, FFmpeg handles the demuxing and muxing on the CPU.</p><p>The overall processing pipeline looks like this:</p><pre>4K H.264 MP4<br>   │<br>   ▼<br>FFmpeg demuxer<br>   │<br>   ▼<br>NVIDIA NVDEC<br>   │<br>   │ decoded CUDA frame<br>   │ AV_PIX_FMT_CUDA / NV12<br>   │<br>   │ frame remains in GPU memory<br>   ▼<br>CUDA Sobel kernel<br>   │<br>   ├── CUDA thread → pixel<br>   ├── CUDA thread → pixel<br>   ├── CUDA thread → pixel<br>   └── ... thousands of CUDA threads<br>   │<br>   ▼<br>Sobel output<br>   │<br>   │ Y = Sobel result<br>   │ U = 128<br>   │ V = 128<br>   ▼<br>CUDA NV12 frame<br>   │<br>   ▼<br>NVIDIA NVENC H.264 encoder<br>   │<br>   ▼<br>H.264 packets<br>   │<br>   ▼<br>FFmpeg MP4 muxer<br>   │<br>   ▼<br>Output MP4</pre><p>One important difference between the CPU and GPU implementations is that the GPU implementation keeps the video frames in GPU memory between decoding, Sobel processing, and encoding. This avoids copying every frame between CPU memory and GPU memory for the main processing path.</p><h3>Results</h3><h3>CPU-Based Code</h3><p>The CPU-based code was tested in the following processor environments.</p><h3>Linux VM with 16-Core CPU and No GPU</h3><p><strong>Total Sobel threads:</strong> 10</p><pre>Total processing time: 7.60 seconds<br>Average Sobel time: 5.401 ms/frame</pre><p>It was observed that further increasing or decreasing the number of Sobel threads did not produce any significant change in the total processing time.</p><h3>MacBook Air with M4 and 10-Core CPU</h3><p><strong>Total Sobel threads:</strong> 6</p><pre>Total processing time: 6.54 seconds<br>Average Sobel time: 2.289 ms/frame</pre><h3>GPU-Based Code</h3><p>The GPU-based code was tested on an Ubuntu system with the below config:<br> GPU ? NVIDIA GeForce RTX 4060 Ti — 16 GB</p><p>CPU ?</p><pre>Average Sobel time:      0.097 ms/frame<br>Total processing time:   1.320 seconds</pre><p>The complete GPU-based pipeline took only about <strong>1.3 seconds</strong> to generate the edge-detected output video for the same input video.</p><p>The Sobel kernel itself took only about <strong>0.097 ms per frame</strong> on average. This illustrates the advantage of using a highly parallel GPU for a workload where the same operation needs to be performed across millions of pixels.</p><h3>Sobel Edge Detection</h3><p>The <strong>Sobel operator</strong> is a simple image-processing technique used to detect edges in an image. An edge is a location where the brightness of neighboring pixels changes significantly, such as the boundary between an object and its background. For each pixel, Sobel examines a small <strong>3×3 neighborhood</strong> around it and applies two kernels: one detects changes in the horizontal direction and the other detects changes in the vertical direction. These produce two values, Gx and Gy, which are then combined to calculate the strength of the edge at that pixel. Repeating this operation for every pixel produces a new matrix of edge-strength values. A threshold can then be applied to these values to determine which pixels represent strong edges and which do not. <strong>Because the calculation for each pixel is largely independent of the others, Sobel is also a good example of an image-processing operation that can be parallelized across multiple CPU threads or GPU threads.</strong></p><p>Take the below as a sample of a image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*skzGSH0Yhd0JAe2tno5HJg.png" /></figure><p>There is a sharp boundary between the 10 and 100 regions.</p><p>1. Pick one pixel<br>Take the pixel marked X:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*YxAURgns0JF_UMbppazjCQ.png" /></figure><p>Here X = 10. Sobel looks at this <strong>3×3 neighborhood</strong> around the pixel.</p><p>2. Apply the Gx kernel.</p><p>Sobel has two kernels.</p><p>For detecting <strong>horizontal changes</strong> (actually the gradient in the x direction):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/1*WpxUyr9k-K4x3tdEdkI8Rg.png" /></figure><p>Multiply the two matrices element-by-element:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*ldIQPp0Slz61S74LylsdxQ.png" /></figure><p>Then add everything:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*HiJ857G32L2JQdn1_BJTtA.png" /></figure><p>So, Gx = 270</p><p>2. Apply the Gy kernel.</p><p>The second Sobel kernel is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*q4WAoFn1g12D9O-6fnmbMA.png" /></figure><p>Again multiply:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*qZroRShWCTY_3d-f8QQVmA.png" /></figure><p>So, Gy :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*FSBdJCaG54r7B_1XNUJ7ug.png" /></figure><p>Therefore Gy = 90.</p><p>4. Combine Gx and Gy</p><p>The gradient magnitude is normally:</p><pre>magnitude = sqrt(Gx² + Gy²)</pre><p>Here:</p><pre>sqrt(270² + 90²)<br>≈ 284.6</pre><p>So this pixel has a <strong>strong edge</strong>. Usually the magnitude is normalized, like if the value is more than 255, we can consider this to be 255 itself, which is white, and is a edge.</p><pre>0   → black   → little/no edge<br>↓<br>128 → gray    → moderate edge<br>↓<br>255 → white   → very strong edge</pre><h4>Splitting the input image to parallely compute Sobel magnitude</h4><p>The idea is to split the image by rows. Example:</p><pre>For a 4K frame: 2160 rows (Resolution: 3840 x 2160)</pre><pre>Thread 0 → rows 1–540<br>Thread 1 → rows 541–1080<br>Thread 2 → rows 1081–1620<br>Thread 3 → rows 1621–2158<br>...</pre><p>Each thread reads the same input image but writes to its own output rows, so there is no write conflict.</p><h3>Experiment 2 — Deep, few edges graph traversal — CPU advantage</h3><p>For the second experiment, we will move away from video processing and look at a completely different type of workload: graph traversal.</p><p>We will use Breadth-First Search (BFS) to traverse a very large graph with extremely large depth but relatively few neighbours per node.</p><p>We have deliberately chosen a graph with few neighbours per node because this limits the amount of independent work available at each BFS level. Here, independent work means that the neighbours of multiple nodes at the same BFS level can be discovered concurrently, since discovering the neighbours of one node does not depend on discovering the neighbours of another node at that same level.</p><p>BFS can therefore be parallelized: multiple nodes at the same level can be processed concurrently, and their neighbours can be discovered in parallel. This can provide a significant advantage on a GPU when the BFS frontier contains a large number of nodes.</p><p>However, in our graph, each node has only a small number of neighbours and the graph has very large depth. As a result, each BFS level exposes only a small amount of independent work, while the traversal has to progress through a large number of levels.</p><p>This creates a workload with limited parallelism and a strong sequential dependency between BFS levels, providing a useful contrast to the highly parallel video-processing workload in Experiment 1.</p><h4>Strategy</h4><p><strong>CSR (Compressed Sparse Row)</strong> is a way of storing a graph efficiently in memory, especially useful for BFS when the graph has many nodes but relatively few edges per node.</p><p>Instead of storing every possible connection, CSR stores only the edges that actually exist.</p><p>A graph is stored in CSR format using two 1 D arrays: row_offsets and col_indices</p><p>Consider a directed graph as below:</p><pre>                                0<br>                               / \<br>                              1   2<br>                              |  / \<br>                              3     4<br>                               \   /<br>                                 5</pre><p><strong>It is important to note that every node has a numerical ID starting from 0, 1, 2, 3, 4, 5 etc.</strong></p><p><strong>col_indices</strong></p><p>List all the neighbors of each node consecutively:</p><pre>Node 0 → 1, 2<br>Node 1 → 3<br>Node 2 → 3, 4<br>Node 3 → 5<br>Node 4 → 5<br>Node 5 → nothing</pre><p>Putting those neighbor IDs into one continuous array gives:</p><p>col_indices = [1, 2, 3, 3, 4, 5, 5]</p><p>So, col_indices contains the actual neighbor node IDs.</p><p><strong>row_offsets</strong></p><p>Now we need a way to know where each node’s neighbors begin and end inside col_indices. i.e we need to know the array index range which will point us to start and end of neighbors for a input node. This leads us to arow_offsets array like below :</p><p>row_offsets = [0, 2, 3, 5, 6, 7, 7]</p><p>Now, row_offset is not self explanatory, right ? Let us delve into the relation between col_indices and row_offset to understand row_offset better.</p><p><strong>Finding neighbors of Node with ID = 0</strong></p><ul><li>Look at row_offset to get the array index range in col_indices that holds the neighbor node values.</li><li>So, we need to look at row_offset[0] to row_offset[0+1] as the Node has ID = 0.</li><li>row_offset[0] to row_offset[0+1] is 0 to 2. This gives us the indices within col_indices that has the neighbor nodes for Node with ID = 0, which is col_indices[0] to col_indices[2–1].</li><li>col_indices[0] = 1 and col_indices[1] = 2.</li><li>So, node with ID = 0 has neighbor nodes 1 and 2.</li></ul><p><strong>Finding neighbors of Node with ID = 1</strong></p><ul><li>Look at row_offset to get the array index range in col_indices that holds the neighbor node values.</li><li>So, we need to look at row_offset[1] to row_offset[1+1] as the Node has ID = 1.</li><li>row_offset[1] to row_offset[2] is 2 to 3. This gives us the indices within col_indices that has the neighbor nodes for Node with ID = 1, which is col_indices[2] to col_indices[3–1].</li><li>col_indices[2] = 3. So, in this case Node with ID = 1 has only one neighbor node.</li></ul><p><strong>Finding neighbors of Node with ID = 5</strong></p><ul><li>Look at row_offset to get the array index range in col_indices that holds the neighbor node values.</li><li>So, we need to look at row_offset[5] to row_offset[5+1] as the Node has ID = 5.</li><li>row_offset[5] to row_offset[6] is 7to 7. But, notice that , there is no element at index 7 at all. This means node with ID = 5 has no children.</li></ul><h4>If not for CSR, how else could a graph be represented ?</h4><p>Answer: <strong>Adjacency Matrix.</strong></p><p>If we don’t use CSR, one very straightforward way to represent a graph in a 2D array is an adjacency matrix.</p><p>For our graph:</p><pre>0 → 1, 2<br>1 → 3<br>2 → 3, 4<br>3 → 5<br>4 → 5<br>5 → nothing</pre><p>You create a 2D array where:</p><p>row = source node<br>column = destination node<br>1 means an edge exists<br>0 means no edge exists</p><p>So, we would get a 2D array like below:</p><pre>        Destination<br>          0  1  2  3  4  5<br>        +-------------------<br>Source 0 | 0  1  1  0  0  0<br>       1 | 0  0  0  1  0  0<br>       2 | 0  0  0  1  1  0<br>       3 | 0  0  0  0  0  1<br>       4 | 0  0  0  0  0  1<br>       5 | 0  0  0  0  0  0</pre><p>So, we would need a 2D array of 6X6 dimensions. Imagine, if we had 10 million nodes, but each node has only 2–3 neighbors. Then, we would need a adjacency matrix of 10,000,000 × 10,000,000 = 100,000,000,000,000 entries. Most of those entries would simply be 0, because the graph is sparse. <strong>CSR</strong> avoids storing all those zeros. It stores essentially just the edges plus the offsets needed to locate them.</p><h3>Footnote</h3><p>Code samples to demonstrate CPU vs GPU based sobel edge detection is available here: <a href="https://github.com/BinitaBharati/hop-skip-run">https://github.com/BinitaBharati/hop-skip-run</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f167327d3c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building RAG Search Pipeline — Choosing a Vector Database]]></title>
            <link>https://medium.com/@binitabharati/building-rag-search-pipeline-choosing-a-vector-database-b89dabc6960a?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/b89dabc6960a</guid>
            <category><![CDATA[vectordb]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Sat, 05 Sep 2026 19:39:21 GMT</pubDate>
            <atom:updated>2026-09-06T07:37:58.496Z</atom:updated>
            <content:encoded><![CDATA[<p>In a recent project, I faced the dilemma of choosing where to store embeddings for my RAG pipeline.</p><p>I initially used Qdrant for this workload, but after running into performance and indexing issues, I decided to evaluate pgvector more seriously. After much back and forth, I concluded that PostgreSQL with pgvector was the ideal choice for my use case.</p><p>Based on my experiments, I found pgvector to be a better fit for my requirements, particularly in terms of ingestion speed, HNSW index construction time, index size, and query latency.</p><p>Here are a few areas where pgvector clearly stood out for me:</p><ul><li><strong>Ingestion and index-building time:</strong> In my experiments, ingesting the same set of embeddings took significantly longer in Qdrant — almost 100 times longer in one of my tests — than in pgvector. With pgvector, I could first populate the table with the raw embeddings without an HNSW index and build the index after the ingestion was complete. This allowed the ingestion process to remain fast while the index was built separately. With Qdrant, the indexing process happens as part of the collection’s indexing workflow, so I couldn’t use the same simple “load everything first, build the HNSW index afterward” approach.</li><li><strong>HNSW index construction with binary quantization:</strong> I also found HNSW index construction to be considerably faster in pgvector when using binary_quantize. In my experiments, the pgvector HNSW index was built within a few minutes, whereas the equivalent Qdrant indexing process took hours for a similar HNSW configuration.</li><li><strong>Index size:</strong> My embeddings were generated using qwen3-embedding:8b. Each embedding produced by this model contains 4,096 floating-point values. A float32 representation requires 4 bytes per value, so the raw vector requires approximately:</li><li>4,096 × 4 bytes ≈ 16 KB</li><li>With pgvector’s binary_quantize, the values used for the binary HNSW index are represented using a single bit per dimension. Therefore, a 4,096-dimensional binary representation requires:</li><li>4,096 × 1 bit = 4,096 bits = 512 bytes</li><li>This substantially reduces the amount of data that the binary HNSW index needs to work with compared with a full-precision 4,096-dimensional vector.</li><li><strong>Remarkably similar search results with binary quantization:</strong> I was particularly impressed by the mechanism behind converting a 4,096-dimensional floating-point embedding into just 4,096 bits. Even more interestingly, in my experiments, querying the HNSW index built using binary_quantize() produced essentially the same search results as querying using the original, full-precision embeddings. Despite reducing each dimension to a single bit, the binary representation retained enough of the semantic information for the retrieval results to remain remarkably similar.</li><li><strong>Query latency<br></strong>In my experiments, pgvector also delivered lower query latency than Qdrant for my workload. In one case, Qdrant returned results in 6 secs while pgvector took 27 ms.</li></ul><h4>Semantic search result quality: pgvector vs. Qdrant</h4><p>In Qdrant, each point returned by a vector search has a score associated with it. With cosine similarity, higher scores indicate greater similarity. In my experience, scores closer to 1.0 generally indicate highly similar results, while lower scores indicate weaker matches.</p><p>In pgvector, there is no generic score attribute returned by the database. Instead, the quality of an output row in the search query depends on the distance metric used for the search. In my case, because I am using binary_quantize() with the HNSW index, I use <strong>Hamming distance</strong> to measure similarity between the query and each result.</p><p>A lower Hamming distance means that fewer bits differ between the query’s binary representation and the result’s binary representation, indicating that the result is closer to the query.</p><h4><strong>Test environment</strong></h4><ul><li>Postgres running as a docker container. Image tag: pgvector/pgvector:pg17</li><li>Qdrant running as a docker container. Qdrant version: 1.19.0</li><li>Total number of embeddings : 460K</li></ul><h4>How to get good results for semantic search ?</h4><p>Getting a vector database to return <em>some</em> semantically relevant results is relatively easy. Getting consistently good results at scale is a different problem.</p><p>In my case, I had around 460K embeddings, and I found that simply creating an HNSW index did not guarantee good search results. I had to experiment with the HNSW configuration and compare approximate search results against exact search results.</p><p>Here is the step-by-step process I followed.</p><ol><li>Table definition containing raw embeddings:</li></ol><pre>CREATE TABLE document_chunks (<br>    id BIGSERIAL PRIMARY KEY,<br>    page_id BIGINT,<br>    title TEXT,<br>    webUri TEXT,<br>    chunk_id INTEGER,<br>    content TEXT,<br>    embedding vector(4096)<br>);</pre><p>Notice, how I have also stored document related metadata like page_id, title and webUri etc in this table.</p><p>2. Populate this table.</p><p>3. Now, try creating hnsw index on this table with populated data:</p><pre>CREATE INDEX document_chunks_embedding_hnsw_idx ON document_chunks USING hnsw ( (binary_quantize(embedding)::bit(4096)) bit_hamming_ops ) WITH ( m = 16, ef_construction = 64 );</pre><p>Notice that m and ef_construction are set to 16 and 64, respectively. The CREATE INDEX command runs until the HNSW index has been completely built. In my case, this took a few minutes.</p><p>4. Verify that binary_quantize does not significantly affect retrieval quality.</p><p>First, perform an exact search without using the HNSW index. (In these queries, replace [QUERY_VECTOR] with the raw float array of embeddings.)</p><pre>SELECT page_id, title, chunk_id, webUri, 1 - (embedding &lt;=&gt; &#39;[QUERY_VECTOR]&#39;::vector) AS cosine_similarity FROM document_chunks ORDER BY embedding &lt;=&gt; &#39;[QUERY_VECTOR]&#39;::vector LIMIT 100;</pre><p>Next, perform an exact search using the binary representation.</p><pre>SET enable_indexscan = off; <br>SET enable_bitmapscan = off; <br>SELECT page_id, title, chunk_id, (binary_quantize(embedding)::bit(4096)) &lt;~&gt; binary_quantize(&#39;[QUERY_VECTOR]&#39;::vector)::bit(4096) AS hamming_distance FROM document_chunks ORDER BY (binary_quantize(embedding)::bit(4096)) &lt;~&gt; binary_quantize(&#39;[QUERY_VECTOR]&#39;::vector)::bit(4096) LIMIT 20;</pre><p>In my dataset, the exact search and exact binary search returned the same top results. This gave me confidence that the loss of precision from binary quantization was not significantly affecting retrieval quality for my dataset.</p><p>5. Check if the hnsw index also works as good as exact search.</p><pre>SET enable_indexscan = on; <br>SET enable_bitmapscan = on;<br><br>SET hnsw.ef_search = 100;<br><br>SELECT page_id, title, chunk_id, (binary_quantize(embedding)::bit(4096)) &lt;~&gt; binary_quantize(&#39;[QUERY_VECTOR]&#39;::vector)::bit(4096) AS hamming_distance FROM document_chunks ORDER BY (binary_quantize(embedding)::bit(4096)) &lt;~&gt; binary_quantize(&#39;[QUERY_VECTOR]&#39;::vector)::bit(4096) LIMIT 20;</pre><p>ef_search controls the size of the candidate list explored during an HNSW search. Increasing it generally improves recall at the cost of higher query latency.</p><p>In my case, the results were very poor compared with exact search, indicating that the HNSW configuration was not providing sufficient recall. Also, to verify that indeed hnsw index was used during the query, use below explain analyze . You should be able to see that the created document_chunks_embedding_hnsw_idx was used.</p><pre>EXPLAIN (ANALYZE, BUFFERS) <br>SELECT page_id, title, chunk_id, (binary_quantize(embedding)::bit(4096)) &lt;~&gt; binary_quantize(&#39;[QUERY_VECTOR]&#39;::vector)::bit(4096) AS hamming_distance FROM document_chunks ORDER BY (binary_quantize(embedding)::bit(4096)) &lt;~&gt; binary_quantize(&#39;[QUERY_VECTOR]&#39;::vector)::bit(4096) LIMIT 20;</pre><p>6. Drop and recreate hnsw index with updated config.</p><pre>DROP INDEX IF EXISTS document_chunks_embedding_hnsw_idx;<br><br>CREATE INDEX document_chunks_hnsw_idx ON document_chunks USING hnsw ( (binary_quantize(embedding)::bit(4096)) bit_hamming_ops ) WITH ( m = 32, ef_construction = 200 );</pre><p>Here, m and ef_construction are set to 32 and 200, respectively.</p><p>After rebuilding the HNSW index with the updated configuration, the indexed search results closely matched the exact-search results.</p><p>7. This experiment showed me that simply creating an HNSW index is not enough. The HNSW configuration needs to be tuned against exact search results to achieve an acceptable balance between search quality, index-building time, and query latency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b89dabc6960a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What to Know Before You Pick an AI Model: The Hidden Hardware and Software Choices]]></title>
            <link>https://medium.com/@binitabharati/what-to-know-before-you-pick-an-ai-model-the-hidden-hardware-choices-19f07bcf9120?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/19f07bcf9120</guid>
            <category><![CDATA[ai-model]]></category>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Sat, 15 Aug 2026 11:36:51 GMT</pubDate>
            <atom:updated>2026-11-06T02:36:40.823Z</atom:updated>
            <content:encoded><![CDATA[<p>When you look for an AI model on websites like Hugging Face, it is easy to focus only on how smart the model is. You check the benchmarks, look at the accuracy scores, and hit download.</p><p><strong>Choosing an AI model is not just about the model’s brain power — it is completely dictated by your server’s hardware and software capabilities.</strong></p><p>If you do not plan ahead, you will run into massive deployment walls. Let’s unwrap the hidden choices you need to make before picking your next AI model.</p><h4>The API Trap: Same Model, Different Doors</h4><p>Many beginners assume that an AI model works like an app on a phone. You download it, open it, and it always behaves the exact same way. <strong>This is a myth.</strong></p><p>An AI model is just a quiet file of math equations sitting on a hard drive. It cannot talk to the internet by itself. To use it, you must load it into an <strong>AI Server Software</strong> engine (like Ollama, vLLM, or llama.cpp).</p><p>Because different people use different server software, <strong>the exact same AI model can offer completely different APIs depending on the engine hosting it.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2cs3M_fH-66FMwhgRtAUjw.png" /></figure><p><strong>Case Study: The Ollama Reranker Wall</strong></p><p>Take search systems like RAG (Retrieval-Augmented Generation). You might download a highly rated model like <strong>Qwen3-Reranker-8B</strong> to sort your documents. The model file is packed with the smart math needed to rank your data.</p><p>But if you load it onto your existing <strong>Ollama</strong> server, your application will throw a <strong>404 Error: Not Found</strong>.</p><p>Why? Because the programmers behind Ollama built it for text generation and basic embeddings. They did not build a native /api/rerank doorway into the software code. The model is capable, but the server software blocks you from using it. To fix this, you have to switch your server engine to something like <strong>vLLM</strong> or <strong>llama.cpp</strong> which natively supports reranking APIs.</p><h4>GPU VRAM: The AI’s Speed Engine</h4><p>When setting up an AI server, you will see a lot of memory terms thrown around. Let’s clear up the jargon first:</p><ul><li><strong>System RAM:</strong> Slower memory used by the CPU for general computer multitasking.</li><li><strong>NVRAM (Non-Volatile RAM):</strong> Permanent flash memory used only to store critical system startup rules. It has nothing to do with running AI.</li><li><strong>VRAM (Video RAM):</strong> Ultra-fast memory built directly onto your graphics card (GPU) chip. <strong>This is where your active AI model must live.</strong></li></ul><p>AI chips need thousands of simple cores to process billions of math calculations at the exact same millisecond. This is called <strong>Parallel Processing</strong>. To feed these hungry cores, data must sit in the ultra-fast VRAM highway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1lNLjvD2xPRE0l6HHZwMGQ.png" /></figure><p><strong>Why VRAM Capacity Must Be High</strong></p><p>If your model is too big for your VRAM, you hit two major roadblocks:</p><ul><li>⚠️ <strong>The “Out of Memory” (OOM) Crash:</strong> Trying to force a 16 GB model into an 8 GB VRAM card will cause the server to crash instantly.</li><li>🐌 <strong>The Snail’s Pace (Offloading):</strong> Some server software avoids a crash by splitting the model. It puts half in the VRAM and dumps the rest into your slow CPU RAM. Because data now has to crawl across the motherboard, your AI’s speed will drop from a few seconds to several minutes per reply.</li></ul><h4>Hardware &amp; Runtime-Specific Model Formats</h4><p>AI models aren’t always distributed as a single universal file. The same underlying model can be packaged, quantized, or optimized differently depending on the hardware and inference engine you want to use.</p><p>You’ll often see names containing tags such as <strong>avx2</strong>, <strong>onnx</strong>, <strong>gguf</strong>, <strong>int8</strong>, or <strong>Q4</strong>.</p><p>These tags don’t all mean the same thing:</p><ul><li><strong>Hardware/CPU optimization — </strong><strong>avx2:</strong> avx2 indicates CPU-specific optimization, whereas formats such as ONNX and quantization schemes such as INT8 are not inherently CPU-specific.<br>Example: bge-reranker-v2-m3-onnx-int8-avx2</li><li><strong>Model format — </strong><strong>onnx:</strong> ONNX is a standardized format for representing machine-learning models. It is <strong>not inherently CPU-only</strong>. An ONNX model can potentially run on CPUs or GPUs depending on the inference runtime and execution provider.</li><li><strong>Model format — </strong><strong>gguf:</strong> GGUF is a model file format commonly used by llama.cpp and tools built around it. It is particularly popular for running LLMs locally and can support both CPU execution and GPU offloading.</li><li><strong>Quantization — </strong><strong>int8, </strong><strong>int4, </strong><strong>Q4, </strong><strong>Q5, etc.:</strong> These indicate that the model&#39;s numerical representation has been reduced from higher precision to use less memory and, in many cases, improve inference speed. Quantization is <strong>not inherently CPU-specific</strong>. CPUs and GPUs can both run quantized models when their inference software supports the format.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PTQ5B3VNyfzIkz_LL9iykw.png" /></figure><p>The important thing to understand is that <strong>these naming conventions are not a universal standard</strong>. Different model publishers and inference frameworks use different names.</p><p><strong>The Golden Rule</strong></p><p>Don’t choose a model solely by looking for words like CPU, GPU, GGUF, or ONNX.</p><p>Instead, consider <strong>three separate questions</strong>:<br>1. What hardware do I have?<br>- CPU (x86_64, ARM)<br>- NVIDIA GPU (CUDA)<br>- AMD GPU (ROCm)<br>- Apple Silicon (MLX)</p><p>2. What AI server am I using?<br>- Ollama<br>- llama.cpp<br>- vLLM<br>- TEI<br>- ONNX Runtime<br>- Transformers</p><p>3. Does that framework support the model’s format and hardware?</p><p>That’s what ultimately determines whether the model will run efficiently.</p><p>Below is a reference table that shows inference server support for various model naming conventions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DFZoUISEMnnORomDwNoAug.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19f07bcf9120" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Unspoken Realities Behind AI Models and the Servers That Run Them]]></title>
            <link>https://medium.com/@binitabharati/the-unspoken-realities-behind-ai-models-and-the-servers-that-run-them-d01c821cd40d?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/d01c821cd40d</guid>
            <category><![CDATA[ai-model]]></category>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Sat, 15 Aug 2026 10:13:45 GMT</pubDate>
            <atom:updated>2026-08-15T10:13:45.884Z</atom:updated>
            <content:encoded><![CDATA[<p>An AI model is a math file. A server is a computer. The model needs the server to work.</p><h3>The AI Model</h3><ul><li>It is a large file of numbers and rules.</li><li>It cannot do anything by itself.</li><li>It holds the brain power of the AI.</li></ul><h3>The Server</h3><ul><li>It is a powerful computer in a data center.</li><li>It has strong parts like GPUs and lots of memory. While some AI models can run on a regular CPU, they will run significantly slower than they would on a GPU. Please refer to foot note to understand factors contributing to this speed gain in detail.</li><li>It turns on the AI model and loads it into memory.</li></ul><h4>The Big Trap: Same Model, Different APIs</h4><p>Many newbies like me assume that an AI model is like an app on your phone — you download it, open it, and it always looks and works the exact same way. <strong>This is actually a myth!</strong></p><p>An AI model is just a static file of math equations sitting on a hard drive. By itself, it cannot talk to the internet, and it doesn’t know how to receive text prompts. To make it usable, you have to load that model into <strong>AI Server</strong>.</p><p>Because different people use different server software, <strong>the exact same AI model can offer completely different APIs depending on where it is loaded. </strong>I have tried to illustrate this problem with a simple pictorial representation below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2cs3M_fH-66FMwhgRtAUjw.png" /></figure><p>So, choosing the right AI model is only part of the equation. You also need to find an AI inference server that can efficiently run the model and expose the APIs you need.</p><h4>Case Study: The Reranker Trap</h4><p>Let’s look at a real-world trap that many developers fall into when building AI search systems (like RAG).</p><p>You decide you want to improve your search results using a “reranker” model. You go to the official model repository, find a highly rated one like <strong>Qwen3-Reranker-8B</strong>, and download it using your server terminal. The model downloads perfectly.</p><p>But when you try to send data to it, your application throws a <strong>404 Error: Not Found</strong>.</p><p><strong>Why did this happen?</strong></p><ol><li><strong>The Model is Capable:</strong> The Qwen3-Reranker-8B file contains all the smart math needed to rank and sort your documents perfectly.</li><li><strong>The Server is Blind:</strong> The Ollama Server Software was originally built just for text generation and basic embeddings. Its programmers have not built a native /api/rerank doorway into the code.</li></ol><p>Because Ollama lacks that specific API endpoint, it has no way to pass your data into the reranker model — making the model completely useless on that specific server.</p><h3>Foot notes</h3><h4><em>Why GPUs are Faster than CPUs for AI</em></h4><p>The Secret Weapon: Thousands of Cores Working as One</p><p>The biggest difference between a CPU and a GPU is how their cores are built. A “core” is the part of a chip that does the actual math thinking.</p><ul><li><strong>The CPU (Few &amp; Fast):</strong> A standard server CPU has about <strong>16 to 128 cores</strong>. These cores are large, super-smart generalists. They can switch between reading an email, loading a webpage, and running background software instantly.</li><li><strong>The GPU (Thousands &amp; Specialized):</strong> A modern AI GPU has <strong>thousands of cores</strong> (for example, a top-tier Nvidia AI chip has over 18,000 CUDA cores). These cores are tiny and simple. They can only do basic math, but they do it together; making the processing faster than with CPU.</li></ul><h4>V-RAM</h4><p>When you look at the specs of an AI server, you will see a term called <strong>VRAM (Video Random Access Memory)</strong>. Do not confuse this with regular CPU RAM or NVRAM (permanent system memory). VRAM is the specialized, ultra-fast memory built directly onto the graphics card chip.</p><p>In the world of AI, VRAM is the ultimate bottleneck. It determines two major things: <strong>which models you can run</strong>, and <strong>how fast they can think</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d01c821cd40d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maze traversal]]></title>
            <link>https://medium.com/@binitabharati/maze-traversal-9ff6a8be00ba?source=rss-36749511fb38------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ff6a8be00ba</guid>
            <category><![CDATA[fb]]></category>
            <category><![CDATA[maze-runner]]></category>
            <dc:creator><![CDATA[Binita Bharati]]></dc:creator>
            <pubDate>Thu, 18 Jun 2026 07:20:52 GMT</pubDate>
            <atom:updated>2026-06-18T08:37:51.349Z</atom:updated>
            <content:encoded><![CDATA[<p>I was spending lots of time trying to navigate a maze in one of my personal projects. That’s when I got to know about the practical use of <a href="https://en.wikipedia.org/wiki/Breadth-first_search">Bread First Search</a> (BFS).</p><p>A maze can be considered programmatically to be a 2D array holding 1’s and 0’s. We can consider 1 to be a wall (ie no pathway), and 0 to be a path.</p><p>While in BFS we deal with tree data structure like below :</p><pre>                                   123<br>                                    /\<br>                                   /  \<br>                                  45  63<br>                                  /    \<br>                                 /      \<br>                                89      987<br>                                 \       /<br>                                  \     /<br>                                    789<br>                                    / \ <br>                                   /   \<br>                                  45   87</pre><p>The pathways in the maze can be considered to be the nodes of a graph. Example, if we have a 2d array like below:</p><pre>int maze[4][5] = {<br>    {1,0,0,1,1},//1 indicates wall 0 indicates path<br>    {1,0,0,0,1},<br>    {1,1,0,1,1},<br>    {1,1,0,0,1}<br>}</pre><p>We can transform this maze into a tree structure by considering all 0’s to be a node. The connection from any node1 to adjacent node2 is determined by the directions in which one can move in the maze. The movement can occur only in the left, right, upward and downward direction; no diagonal movements allowed. Based on this fact, below is the tree structure for the 2D array.</p><pre><br>                         (0,1) <br>                         /   \<br>                       (0,2) (1,1) <br>                           \    /<br>                            (1,2) <br>                              /  \<br>                           (1,3) (2,2) <br>                                   \<br>                                  (3,2)<br>                                    \<br>                                   (3,3) <br></pre><h4>BFS to reach from one point to another in maze</h4><p>We need below data structures:</p><ul><li>visited_cells that will keep track of already discovered positions.</li><li>queue to push all positions that the traversal logic will see.</li><li>parent_info that will keep track of the immediate parent of a node.</li></ul><p>Let’s walk through procedure involved in this traversal:</p><ol><li>Init the queue; add (0,1) into queue.</li><li>In a loop, check if queue is not empty. If not empty then: <br>2.1) Pop from queue<br>2.2) If popped node is the destination node, then exit loop.<br>2.3) Else, if the popped node is not present in visited<br>- Add popped item to visited.<br>- Discover its left, right, up and down neighbor.<br>- A valid neighbor (a open pathway from popped node to the immediate neighbor node) is considered for processing only if its not already present in visited . This check ensures that only a single parent_info exists for any node. i.e. even if a neighbor node has more than 1 adjacent parent nodes, only one of the parent node is considered. In the example 2D array, look at the node (1,2); it has two parents — (0,2) and (1,1). But, during BFS search only one among these two nodes will be picked as the parent; the other parent node will be ignored.<br>- Add every such valid neighbor to the queue.<br>- Add parent_info of this valid neighbor. parent_info holds the info that the neighbor node’s parent is the popped node, as we reached the neighbor node from the popped node.<br>- Go back to step no 2 and repeat popping from queue until queue runs out of items.</li><li>Now, we can use the parent_info to trace the path from source node to destination node. Keep looking in parent_info starting from the parent p1 of destination_node, parent p2 of p1, parent p3 of p2 and so on, till you reach parent of X node = source node. With parent_info, you have the path starting from destination node to source node as the end. If you reverse this result, you will find the final answer from source node to destination node.</li></ol><p>Let us try to determine the route from (0,1) to (3,2).</p><ul><li>Add (0,1) to queue.queue has (0,1)</li><li>Pop queue — Got (0,1). queue is empty</li><li>(0,1) is not visited, add to visited.</li><li>Discover neighbors for (0,1).</li><li>Right neighbor = (0,2). (0,2) is not in visited; hence push (0,2) to queue. queue has (0,2)<br>Add parent_info. parent(0,2) = (0,1)</li><li>Down neighbor = (1,1). (1,1) is not in visited; hence push (1,1) to queue. queue has (0,2), (1,1)<br>Add parent_info. parent(1,1) = (0,1)</li><li>Pop queue — Got (0,2). queue has (0,1)</li><li>Discover neighbor for (0,2).</li><li>Down neighbor is (1,2). (1,2) is not in visited; hence push (1,2) to queue.queue has (1,1), (1,2)<br>Add parent_info. parent(1,2) = (0,2)</li><li>Pop queue — Got (1,1). queue has (1,2)</li><li>Discover neighbor for (1,1).</li><li>Right neighbor is (1.2). However (1,2) is already in visited; hence not adding to queue.</li><li>Pop queue — Got (1,2). queue is empty.</li><li>Discover neighbor for (1,2).</li><li>Right neighbor = (1,3). (1,3) is not in visited; hence push (1,3) to queue. queue has (1,3)<br>Add parent_info. parent(1,3) = (1,2)</li><li>Down neighbor = (2,2). (2,2) is not in visited; hence push (2,2) to queue. queue has (1,3), (2,2)<br>Add parent_info. parent(2,2) = (1,2)</li><li>Pop queue — Got (1,3). queue has (2,2)</li><li>Discover neighbor for (1,3). No neighbor which are not already visited.</li><li>Pop queue — Got (2,2). queue is empty.</li><li>Discover neighbor for (2,2).</li><li>Down neighbor = (3,2). (3,2) is not in visited; hence push (3,2) to queue. queue has (3,2)<br>Add parent_info. parent(3,2) = (2,2)</li><li>Pop queue — Got (3,2) which is the destination node! . queue is also empty. Stop further iteration.</li><li>Now use parent_info to get the path from (0,1) to (3,2)<br>parent(3,2) = (2,2) -&gt; parent(2,2) = (1,2) -&gt; parent(1,2) = (0,2) -&gt; parent(0,2) = (0,1)</li><li>if we reverse this info we get the path from (0,1) to (3,2)<br>(0,1) -&gt; (0,2) -&gt; (1,2) -&gt; (2,2) -&gt; (3,2)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ff6a8be00ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>