Urgent.News

What's breaking now, across thousands of outlets.

AI

Summarize Locally, Send Less: A Mobile LLM Pattern for Free-Tier APIs

Your mobile AI assistant has been chatting for ten minutes. Every turn, the client re-sends the entire conversation history to the server, and you have not noticed because the UI stays smooth. Then the error appears: quota exhausted. You check the logs and find that 80% of your token spend was repetition, not new information. This is the hidden cost of naive context management, and it becomes…

The report discusses a mobile LLM (Language Model) client pattern that reduces token waste and latency by summarizing its own conversation history before sending it to the server. This approach, called the On-Device Summarization Pattern, is particularly useful for free-tier APIs that impose strict token limitations, forcing developers to be more mindful of every token used.

The pattern involves splitting the conversation history into old and recent segments, summarizing the old segment locally, and sending the summary along with the recent messages. The summary can be created using extractive heuristics or more sophisticated local transformer models. The report provides a TypeScript implementation for this pattern, demonstrating how to extract the first sentence of each message for summarization.

This approach can significantly cut down on token usage, especially in longer conversations, while still maintaining relevant context.

Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

Una costituzione con diritto di risposta per gli agenti che programmano

Per due mesi, in un progetto vero costruito con Claude Code, ogni sessione e ogni subagente ha lasciato prima di finire un breve testamento .

  • Each session and sub-agent leaves a brief testament before finishing
  • Testaments become guardians, hooks, and a record of decisions
  • Human must read and respond to testaments for the method to work

Score Your Model Access Decision Before You Argue

Every week, another team discovers that its AI feature costs more than the rest of its infrastructure combined. The advice that follows splits into two camps.

  • Decision matrix evaluates constraints against hosted free tier, self-hosted model, paid API
  • 30-minute diagnostic test gauges practicality of decision before commitments

It Ran Every Morning and Still Broke: Failure Modes of a Free-Tier AI Job

The cron log said exit 0 every morning. The summary file updated on schedule. The job was running. The output was wrong. This is an autopsy of a small automation that failed without crashing.

  • AI model provided incomplete answers, fixed with schema check
  • Quota messages misread as summaries, fixed by validating response body
  • Cron environment mismatch caused dependency issues, resolved with absolute paths

More from Friday 4 September →