<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: iwan rustiawan</title>
    <description>The latest articles on DEV Community by iwan rustiawan (@iwan_rustiawan_a4c47c8a13).</description>
    <link>https://dev.to/iwan_rustiawan_a4c47c8a13</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4029002%2Fc0052f58-f503-4dba-a4ee-c374a6abdd12.jpg</url>
      <title>DEV Community: iwan rustiawan</title>
      <link>https://dev.to/iwan_rustiawan_a4c47c8a13</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iwan_rustiawan_a4c47c8a13"/>
    <language>en</language>
    <item>
      <title>Tips on Handling Files in LLMs</title>
      <dc:creator>iwan rustiawan</dc:creator>
      <pubDate>Fri, 17 Jul 2026 06:38:56 +0000</pubDate>
      <link>https://dev.to/iwan_rustiawan_a4c47c8a13/tips-on-handling-files-in-llms-390b</link>
      <guid>https://dev.to/iwan_rustiawan_a4c47c8a13/tips-on-handling-files-in-llms-390b</guid>
      <description>&lt;p&gt;&lt;strong&gt;Tips on Handling Files in LLMs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You might want to pull information (especially from doc/text documents) out of a file and then interact with an LLM about its contents. The easiest approach is to let a multimodal LLM extract the file and feed it straight into the context for discussion.&lt;/p&gt;

&lt;p&gt;That's not wrong — but picture the token waste: your context gets dominated by image tokens, because every page is rendered as an image that burns far more tokens than its text would. For multi-page files, the cost climbs fast.&lt;/p&gt;

&lt;p&gt;For cases like this, it's better to handle the file inside your own backend, where you have far more control. You can extract the text separately and assemble the LLM context more deliberately — for example, only injecting the parts you actually consider necessary.&lt;/p&gt;

&lt;p&gt;Here's a quick comparison from my own experience:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;OCR / Text-Extraction Pipeline&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Direct LLM/Vision&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Stability&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ &lt;strong&gt;Winner.&lt;/strong&gt; OCR is consistent — the same input tends to produce the same text. The LLM only reasons over the extracted text, so there are fewer sources of variance and the failure modes are more bounded and well understood.&lt;/td&gt;
&lt;td&gt;⚠️ Vision extraction varies run-to-run; it can silently drop rows on dense tables or hallucinate digits.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ &lt;strong&gt;Winner at scale.&lt;/strong&gt; Open-source engines (Tesseract/PaddleOCR) are free to self-host, or you can use a proven managed OCR with predictable per-page pricing.&lt;/td&gt;
&lt;td&gt;❌ Image tokens dominate — every page rendered as an image costs far more tokens than its text (unless you downscale aggressively, which then sacrifices digit accuracy).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Numeric Accuracy&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ &lt;strong&gt;Winner.&lt;/strong&gt; If accuracy on numbers is the goal, you can use OCR with a custom model purpose-built for tabular digits.&lt;/td&gt;
&lt;td&gt;❌ Weaker on dense financial tables; digit-level errors are exactly the kind of failure you can't tolerate.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Document Classification&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;⚠️ OCR strips out visual cues (logos, stamps, layout). But usually the text alone is enough.&lt;/td&gt;
&lt;td&gt;✅ &lt;strong&gt;Winner here.&lt;/strong&gt; Vision sees logos/layout/scanned docs/handwriting that OCR struggles with.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One important caveat: this isn't about "vision being bad." There are cases where Direct Vision is actually the better call — low-quality scans, handwriting, or highly unstructured layouts where building a clean OCR pipeline is more trouble than it's worth. The point is to match the tool to the nature of your data, not to paint with one brush.&lt;/p&gt;

&lt;p&gt;For any system that touches numbers or finances, my rule is simple: &lt;strong&gt;hand numeric extraction to a layer that's deterministic and auditable — not to a model that "thinks it's probably right."&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  LLM #AIEngineering #SoftwareEngineering
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>backend</category>
      <category>llm</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Building Production-Grade LLM Applications</title>
      <dc:creator>iwan rustiawan</dc:creator>
      <pubDate>Tue, 14 Jul 2026 16:16:25 +0000</pubDate>
      <link>https://dev.to/iwan_rustiawan_a4c47c8a13/building-production-grade-llm-applications-271</link>
      <guid>https://dev.to/iwan_rustiawan_a4c47c8a13/building-production-grade-llm-applications-271</guid>
      <description>&lt;p&gt;&lt;strong&gt;Building Production-Grade LLM Applications&lt;/strong&gt;&lt;br&gt;
A short note, just sharing some experience that might be useful for those who are starting to explore building LLM applications. A few things I've come to understand that have become important notes for me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. LLMs are stateless.&lt;/strong&gt;&lt;br&gt;
Don't assume that once you've successfully integrated with an LLM vendor's API, you automatically get the same experience as interacting with ChatGPT directly. ChatGPT is a product; what we call through the API is a model — and the model has no memory at all.&lt;/p&gt;

&lt;p&gt;You say "my name is Iwan" in turn 1? Don't expect the LLM to remember it in turn 2. What actually happens: the entire conversation history is re-sent with every request. So "memory management" isn't the model's job — it's ours :D&lt;/p&gt;

&lt;p&gt;And this brings its own challenges, because it isn't as simple as big vs. small memory; it's about keeping accuracy, cost, and performance in balance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. RAG is not part of the LLM.&lt;/strong&gt;&lt;br&gt;
RAG is an architecture around the model, not a built-in capability. We first retrieve the relevant documents, then inject them into the context. The model itself knows nothing about our database.&lt;/p&gt;

&lt;p&gt;A simple example: say we have an FAQ document we want to use as a reference for our app. We chunk that document, turn it into embeddings, and store it in a vector database. Later, when a user asks a question, we turn the question into an embedding too, use it to find the most relevant FAQ chunks — and only then inject the results into the context before sending it to the model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The LLM is an orchestrator, not a calculator.&lt;/strong&gt;&lt;br&gt;
This is the one I emphasize most. Never hand calculations over to an LLM, especially anything financial.&lt;/p&gt;

&lt;p&gt;Not because the AI isn't smart enough, but because structurally it predicts the next token probabilistically — it doesn't execute arithmetic. When we ask it to add two numbers, it isn't calculating. It's guessing the most likely-looking answer.&lt;br&gt;
The solution: function calling. The model's job is to understand the user's intent and choose which function to call. The computation is handed off to a deterministic backend — one that can be tested and audited.&lt;/p&gt;

&lt;p&gt;It's not just about accuracy, it's also about auditability. If someone asks, "why is the number this?", the answer has to be traceable to a function whose code we can actually show. Not to a model that "thinks it's probably that."&lt;/p&gt;

&lt;p&gt;There's still a lot I haven't figured out on my end, especially around evaluation and cost. If anything here is off, or if you've had a different experience, I'd be glad to hear your input.&lt;/p&gt;

&lt;h1&gt;
  
  
  LLM #AIEngineering #SoftwareEngineering
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>llm</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
