<?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 Kumar Pratik on Medium]]></title>
        <description><![CDATA[Stories by Kumar Pratik on Medium]]></description>
        <link>https://medium.com/@kumarpratik?source=rss-61a96acba0c1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QkY56eBIvb-oTA0jdQ3p8g.png</url>
            <title>Stories by Kumar Pratik on Medium</title>
            <link>https://medium.com/@kumarpratik?source=rss-61a96acba0c1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:08:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kumarpratik/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[Design Your LLM Prompts for KV Cache Reuse: Prompt Architecture Is Infrastructure Architecture]]></title>
            <link>https://medium.com/@kumarpratik/design-your-llm-prompts-for-kv-cache-reuse-prompt-architecture-is-infrastructure-architecture-a0e95fa26dbb?source=rss-61a96acba0c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0e95fa26dbb</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Kumar Pratik]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 10:19:18 GMT</pubDate>
            <atom:updated>2026-11-15T10:19:18.297Z</atom:updated>
            <content:encoded><![CDATA[<p>One timestamp at the top of a prompt can throw away 20,000 tokens of cached work.</p><p>When we tune an LLM inference server, the checklist is predictable: GPU memory, quantization, context length, batching, concurrency. But while building AntFabric.ai, an AI-native workspace powered by Digital Twins of the people in an organization, we keep learning that some of the most valuable optimizations happen much earlier, in how the prompt itself is assembled.</p><p>Inference engines like vLLM keep the attention keys and values they compute for a prompt, in fixed-size token blocks, and reuse them when the next request starts with an identical prefix. A Digital Twin request carries 30K to 60K tokens of context, and around 20K of that (system instructions, organization policies, the twin’s definition, tool schemas) is the same on every request. Reuse it, and prefill drops from 30K tokens to 10K.</p><p>The catch: the cache matches a prefix, not a set. Each block’s hash depends on every block before it, so one changed token near the top invalidates everything after it. Put “Current time: 10:21:32” or a request ID on the first line, and two prompts that look identical to a human share nothing as far as the cache is concerned.</p><p>The fix costs nothing at build time:</p><ul><li>Order every prompt by how often its content changes: global instructions, policies, agent definition and tool schemas first; memory, retrieved documents, timestamps, conversation and the current request last.</li><li>Make prompt construction deterministic: sorted tool lists, one canonical JSON serializer, schemas generated once.</li><li>Snapshot-test the stable prefix, and measure the prefix hit rate, not just latency.</li><li>Keep anything user-specific out of shared prefixes. Performance and trust boundaries have to agree.</li></ul><p>Same tokens, same meaning, roughly 10x less prefill work. At 10,000 Digital Twins, that is about 11.5 billion prompt tokens a day the GPU would otherwise recompute.</p><p>In the full post I cover how chained block hashing works, thinking in cache layers instead of “a 64K prompt”, why — max-num-batched-tokens does not change reuse, the security side of shared prefixes, and the 8-point checklist we are standardizing on.</p><p>Originally published on kumarpratik.com: <a href="https://kumarpratik.com/blog/design-llm-prompts-for-kv-cache-reuse">https://kumarpratik.com/blog/design-llm-prompts-for-kv-cache-reuse</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0e95fa26dbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 3D Prompting Framework: How to Unlock Expert-Level Answers from Any LLM]]></title>
            <link>https://medium.com/@kumarpratik/the-3d-prompting-framework-how-to-unlock-expert-level-answers-from-any-llm-2d3667a4d252?source=rss-61a96acba0c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d3667a4d252</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kumar Pratik]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 10:06:04 GMT</pubDate>
            <atom:updated>2026-11-15T10:06:04.037Z</atom:updated>
            <content:encoded><![CDATA[<p>Most people ask LLMs questions. Advanced users give them coordinates.</p><p>You open ChatGPT, Claude, or Gemini, type a question, and get a decent answer. Most people stop there, and in doing so use maybe 10% of what these models can do. The way you ask determines the depth of what you receive.</p><p>After 20+ years in technology, and years of working with AI alongside my team of 450+ engineers at GeekyAnts, I have come to see an LLM not as a search engine but as a multi-dimensional knowledge space. The quality of the answer depends on the coordinates you give it. I call this the 3D Prompting Framework:</p><p>Subject: what you are asking about. Be specific: not “databases” but “PostgreSQL index optimization.”</p><p>Expertise level: who should be answering. A 4th grader, a working practitioner, or a PhD.</p><p>Domain: the field you are applying it in. A circle means something different to a mathematician, a GPU engineer, an architect, and a UX designer.</p><p>Try it: ask any LLM to explain a circle to a 4th grade student, then to a 12th grade student, then to a mathematics PhD. Same subject, three completely different answers. The model had all three inside it the whole time. Only the coordinate changed.</p><p>A generic prompt asks the model to average across everything it knows. Precise coordinates send it to the exact region that matters for your problem.</p><p>In the full article I walk through the 2D knowledge matrix, real-world examples from database performance and SaaS strategy, and a 3-question checklist to run before every prompt.</p><p>Read more: <a href="https://kumarpratik.com/blog/the-3d-prompting-framework"><em>https://kumarpratik.com/blog/the-3d-prompting-framework</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d3667a4d252" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Your Own — Private Mobile Cloud (Android | Vysor)]]></title>
            <link>https://medium.com/@kumarpratik/creating-your-own-private-mobile-cloud-android-vysor-8dcee83fe8b0?source=rss-61a96acba0c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dcee83fe8b0</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[private-cloud]]></category>
            <category><![CDATA[mobile-testing]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[mobile-device-management]]></category>
            <dc:creator><![CDATA[Kumar Pratik]]></dc:creator>
            <pubDate>Thu, 30 Mar 2017 07:56:38 GMT</pubDate>
            <atom:updated>2017-04-04T19:23:54.595Z</atom:updated>
            <content:encoded><![CDATA[<p>Before I jump start on to the problem &amp; solution, I want to brief about us.</p><ul><li>We are team of 65+ members and growing (<a href="http://geekyants.com/">GeekyAnts</a>)</li><li>25+ Developers are <a href="http://react.geekyants.com/">mobile application developer using React Native</a> (Android &amp; iOS)</li><li>Nearly 6 QA people and they write the functional test cases using Appium and Selenium</li><li>Our Team has build a <a href="https://nativebase.io/">UI Framework/Library on top of React Native</a> to make the development much easier which is called as <a href="https://nativebase.io/">NativeBase.io</a></li><li>We have 50+ Mobile devices in our office for the developers and the QA team.</li></ul><p>We never had this problem when we were a small team of 10 members, it was easy for us to ask the next person to pass the device and it was working great.</p><p>We started struggling as the team size grew slowly and it became unmanageable to physically pass the device to the person in need. So, finally we needed a solution to fix this problem and move the organisation to the next level with smarter way of doing it.</p><p><strong>Problem:</strong></p><ul><li>Managing mobile device allocation to team member and sometimes multiple member needs multiple devices to test run their application.</li><li>Android has more than 100 different types of devices (Majorly 4–6 types which is a must for any QA team), with iOS, simulator works fine for us because everyone uses Mac in our office.</li><li>Mobile accidental damage</li></ul><p><strong>Solution:</strong></p><p>We tried with multiple cloud mobile testing platform but the cost of using them was quite high and it did not make sense for us from a business point of view, until you are very smart to use the cloud mobile instance in efficient way.</p><p>As we already had nearly 50+ devices with us, we though that we should get a vendor to setup a private mobile cloud in our office which we can share internally but again, we found that such companies charge you a bomb $$$$$.</p><p>So, for us the next step was lets-do-it-ourself and assemble it.</p><p>We used the following listed things to setup our private cloud</p><ul><li>A Mac Mini</li><li>10 Port USB Hub with External Power (x 2)</li><li>Vysor Enterprise which costs you $2 per active user, per month</li></ul><p>And the rest of the things was quite simple. And also, to add, we are no way related to Vysor. We are just a happy customer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_FlinF2XJ5AOQU2KtZjVg.jpeg" /></figure><p>We connected the devices to our Mac Mini Server and started the Vysor app and it does everything just works out of the box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0lunn355Oh12eaqbWs5qQQ.png" /></figure><p>Vysor saved us big time! Special thanks to them: simple to use and scale.</p><p>Below is another screenshot of connected devices from my laptop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pyp0OAOhQjMIzqOtkAlfOQ.png" /></figure><p>Note: Incase, if you are a <a href="http://react.geekyants.com/">React Native Developer</a>, you will need to shake your device to open the developer setting console and you can do that by using the command below:</p><pre>adb shell input keyevent 82</pre><p>Few of the great features of Vysor:</p><ul><li>You can access the Private Cloud From Anywhere</li><li>You can use the adb tool as the device is connected to your local system (Vysor does creates a tcp port mapping to provide the adb access)</li><li>You can drag &amp; drop the files directly from your system to Device</li><li>And it works with almost all kinds of application</li></ul><p>Finally we had our first private mobile cloud setup for Android up and running.</p><p>We love exploring new things at <a href="http://www.geekyants.com/">GeekyAnts</a>, if you have a better solution, please share it in the responses section below. We would love to explore more.</p><p>Cheers!</p><p>Thanks <a href="https://medium.com/u/2bdf3d787af0">Sanket Sahu</a> for editing my article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dcee83fe8b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hikvision Raspberry PI as Viewer]]></title>
            <link>https://medium.com/@kumarpratik/hikvision-raspberry-pi-as-viewer-9500369a6e8b?source=rss-61a96acba0c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9500369a6e8b</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[geekyants]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[hikvision]]></category>
            <dc:creator><![CDATA[Kumar Pratik]]></dc:creator>
            <pubDate>Fri, 17 Feb 2017 11:47:01 GMT</pubDate>
            <atom:updated>2017-03-27T06:43:12.189Z</atom:updated>
            <content:encoded><![CDATA[<p>We love exploring new things at <a href="http://www.geekyants.com/">GeekyAnts</a> &amp; an innovation always leads a solution. One of the experiments which actually solved our problem with Raspberry PI &amp; a bit of scripting.</p><p>We just got our security cameras installed in our office (GeekyAnts) and we wanted an additional viewer on our reception desk with limited number of camera display. The solution from the vendor was quite complex and required wiring from the Hikvision DVR to Reception desk. And we wanted some quick solution for it</p><p>Unfortunately, I wasn’t able to find anything quick to do the things. So we built our custom solution with Raspberry pi 3.</p><p>Here is my solution for creating extended Hikvision Viewer over IP network. You will need the following things:</p><ul><li>Raspberry PI 3 running OS raspbian</li></ul><pre>pi@pi-resp:~ $ cat /etc/os-release</pre><pre>PRETTY_NAME=&quot;Raspbian GNU/Linux 8 (jessie)&quot;</pre><pre>NAME=&quot;Raspbian GNU/Linux&quot;</pre><pre>VERSION_ID=&quot;8&quot;</pre><pre>VERSION=&quot;8 (jessie)&quot;</pre><pre>ID=raspbian</pre><pre>ID_LIKE=debian</pre><pre>HOME_URL=&quot;http://www.raspbian.org/&quot;</pre><pre>SUPPORT_URL=&quot;http://www.raspbian.org/RaspbianForums&quot;</pre><pre>BUG_REPORT_URL=&quot;http://www.raspbian.org/RaspbianBugs&quot;</pre><ul><li>Monitor Full HD with HDMI</li><li>You will need your IP Address of your Hikvision DVR and the username &amp; password.</li><li>Do make sure that your Hikvision and Raspberry PI are on the same network and you know the IP :D</li></ul><p>You will need to install the following softwares (make sure your OS is updated to latest)</p><ul><li>omxplayer — which you can install by running sudo <strong>apt-get install omxplayer</strong></li><li>omxplayer is the video player which uses GPU</li></ul><p>Next, lets start configuring the raspberry pi system</p><ul><li>sudo raspi-config</li></ul><blockquote>As omxplayer is going to use lots of GPU, lets increase the GPU Ram to 256Mb</blockquote><p>Advance Option -&gt; Memory Split -&gt; Change the Value to 256 -&gt; Save and Reboot</p><pre>Optionally, you can keep the system running in CLI Mode. So you don’t burn your CPU and RAM is other unwanted things.</pre><pre>To do so, again open the raspi-config<br>-&gt; Boot Options -&gt; Desktop / CLI -&gt; Console (Text Console, requiring user to login)</pre><p>Next, lets make the display always active. by default the display turns off after 10 mins incase of no interaction on the console.</p><p>edit the file <strong>/etc/kbd/config</strong> by using sudo nano /etc/kbd/config</p><pre># screen blanking timeout.  monitor remains on, but the screen is cleared to<br># range: 0-60 min (0==never)  kernels I&#39;ve looked at default to 10 minutes.<br># (see linux/drivers/char/console.c)<br><strong>BLANK_TIME=0</strong></pre><p>change the value of <strong>BLANK_TIME to 0</strong>, as shown in the above example.</p><p>To start the video you can just write</p><pre>omxplayer --live --refresh --video_queue 4 --fps 30 --win “0 0 1920 1080” rtsp://&lt;username&gt;:&lt;password&gt;@&lt;ip-hikvision&gt;/h264/ch1/main/av_stream</pre><blockquote>with the above command you should be able to start your live video from channel 1 camera.</blockquote><blockquote>#ref: <a href="http://www.cctvforum.com/viewtopic.php?t=37239">http://www.cctvforum.com/viewtopic.php?t=37239</a></blockquote><blockquote>Main stream: <br><a href="/service/rtsp://admin:12345@192.0.0.64/h264/ch1/main/av_stream">rtsp://admin:12345@192.0.0.64/h264/ch1/main/av_stream</a> <br><a href="/service/rtsp://admin:12345@192.0.0.64/MPEG-4/ch1/main/av_stream">rtsp://admin:12345@192.0.0.64/MPEG-4/ch1/main/av_stream</a> <br><br>Sub stream: <br><a href="/service/rtsp://admin:12345@192.0.0.64/mpeg4/ch1/sub/av_stream">rtsp://admin:12345@192.0.0.64/mpeg4/ch1/sub/av_stream</a> <br><a href="/service/rtsp://admin:12345@192.0.0.64/h264/ch1/sub/av_stream">rtsp://admin:12345@192.0.0.64/h264/ch1/sub/av_stream</a></blockquote><p>Next, I wanted to display my 3 cameras on the screen</p><ul><li>Main Passage Camera (that is on channel 4)</li><li>Another Floor Passage View (that is on channel 3)</li><li>Parking Area (that is on channel 1)</li></ul><p>here is my script which does the job for me! It runs every min via cronjob to make sure all the streams are running and incase if its close / crashed by any reason it auto restarts.</p><pre>#Script for checking and starting the camera display, setup to runs via cronjob everymin.</pre><pre>setterm -cursor off</pre><pre>#stream1<br>st1=`ps -ef | grep omxplayer | grep stream1 | cut -d&#39;-&#39; -f2 | cut -d&#39; &#39; -f2`<br>echo &quot;Checking &amp; Starting Screen 1&quot;;<br>if [ &quot;$st1&quot; = &quot;stream1&quot; ]; <br> then <br>  echo &quot;Running Stream1..&quot;;<br> else <br>  echo &quot;Starting Stream1..&quot;;<br>  screen -dmS stream1 sh -c &#39;omxplayer --live --refresh --video_queue 4 --fps 30 --win &quot;0 0 1280 1080&quot; rtsp://&lt;username&gt;:&lt;password&gt;@&lt;ip-hikvision&gt;/h264/ch4/main/av_stream&#39;;<br>fi</pre><pre>#stream2<br>st2=`ps -ef | grep omxplayer | grep stream2 | cut -d&#39;-&#39; -f2 | cut -d&#39; &#39; -f2`<br>echo &quot;Checking &amp; Starting Screen 2&quot;;<br>if [ &quot;$st2&quot; = &quot;stream2&quot; ];<br> then<br>  echo &quot;Running Stream2..&quot;;<br> else<br>  echo &quot;Starting Stream2..&quot;;<br>  screen -dmS stream2 sh -c &#39;omxplayer --live --refresh --video_queue 4 --fps 30 --win &quot;1280 0 1920 720&quot; rtsp://&lt;username&gt;:&lt;password&gt;@&lt;ip-hikvision&gt;/h264/ch3/main/av_stream&#39;;<br>fi;</pre><pre>#stream3<br>st3=`ps -ef | grep omxplayer | grep stream3 | cut -d&#39;-&#39; -f2 | cut -d&#39; &#39; -f2`<br>echo &quot;Checking &amp; Starting Screen 3&quot;;<br>if [ &quot;$st3&quot; = &quot;stream3&quot; ];<br> then<br>  echo &quot;Running Stream3..&quot;;<br> else<br>  echo &quot;Starting Stream3..&quot;;<br>  screen -dmS stream3 sh -c &#39;omxplayer --live --refresh --video_queue 4 --fps 30 --win &quot;1280 720 1920 1080&quot; rtsp://&lt;username&gt;:&lt;password&gt;@&lt;ip-hikvision&gt;/h264/ch1/main/av_stream&#39;;<br>fi;</pre><p>Save it as <strong>start-stream.sh</strong> and All done :-)</p><p>Below is the screenshot of the output from our viewer!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8kh6d5CvI_vbwxbV1RePZA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9500369a6e8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>