SShortSingh.

Programming

0
ProgrammingDEV Community ·

Single TPU Chip Runs Gemma 4 AI Agent Backend at Under $0.11 per Million Tokens

A developer has published a detailed build log showing that Google's Gemma 4 E2B model can be self-hosted on a single Google Cloud TPU v5e chip using vLLM, achieving 1,496 output tokens per second at roughly $0.107 per million output tokens. The setup costs approximately $0.58 per hour on spot pricing and delivers 8.02 ms per-token latency, making it capable of supporting 8 to 16 concurrent lightweight AI agents. The guide covers three provisioning models — spot, on-demand, and flex-start — noting that flex-start is the only option that automatically stops billing after a set duration. A key finding is that flex-start provisioning for a v5litepod-1 instance is only accepted in the us-west4-a zone, with other zones rejecting the configuration at the API level regardless of available quota. The author also highlights that four of their initial performance predictions were disproved by actual benchmarks, calling those discrepancies the most instructive part of the exercise.

0
ProgrammingDEV Community ·

Most directory listings offer nofollow links unless you pay or meet engagement thresholds

A developer who submitted a product to over 20 online directories found that only 5 of those listings provided dofollow backlinks. Several directories were found to tie followed links to paid upgrades or engagement conditions, such as reaching a minimum of 10 upvotes before a free listing's link becomes dofollow. One directory offered a dofollow link in exchange for displaying their badge on the submitter's site, but the outbound link was already set to nofollow before the condition was met. The developer concluded that followed links are effectively a monetization tool for these platforms rather than a standard feature of free listings. The key takeaway offered is to check a directory's pricing structure before submitting, and to treat free listings only for what they reliably provide, such as brand visibility and name-based search presence.

0
ProgrammingDEV Community ·

Claude Has Two Independent Rate Limits — Here's How They Actually Work

Anthropic's Claude AI enforces two separate rolling usage limits: a 5-hour session limit based on message volume and a 7-day cumulative limit, both of which reset relative to a user's first message rather than on a fixed schedule. These limits are measured in tokens, not messages, meaning heavy tasks like pasting large code files can exhaust a session window far faster than expected. A developer discovered that Claude's browser interface quietly queries an internal usage endpoint that returns exact utilization percentages and reset timestamps for both windows. The token-based model also means Claude Opus consumes quota significantly faster than lighter models like Sonnet or Haiku. Additionally, response quality reportedly begins to degrade before the hard limit is reached, as the model's attention mechanism deprioritizes older context in very long conversations.

0
ProgrammingDEV Community ·

Developer builds privacy-first browser tools for QR, images, and PDFs without uploads

A developer has expanded UsefulAtlas, a browser-local toolbox, with new tools including QR Studio, an Image Toolbox, and a PDF Toolbox supporting merging, splitting, and reordering. The core design principle is that private files remain on the user's device and are never sent to a remote server. Building these tools presented engineering challenges such as PDF coordinate transforms, metadata parsing, and managing memory through Blob lifecycle cleanup. The developer deliberately avoided remote upload APIs and agent layers, prioritizing a well-functioning human-facing tool above all else. UsefulAtlas is currently live and the developer is inviting others working on browser-local utilities to share their own edge-case experiences.

0
ProgrammingHacker News ·

School Districts Build Affordable Homes to Attract and Retain Teachers

Some school districts in the United States are constructing affordable housing as a strategy to recruit and retain teachers. The initiative addresses the challenge of educators being unable to afford homes near the schools where they work, particularly in high-cost areas. By offering below-market housing, districts aim to make teaching positions more attractive amid ongoing staffing shortages. The approach represents a growing recognition that competitive salaries alone may not be sufficient to draw qualified educators to certain regions.

0
ProgrammingDEV Community ·

Fix broken heading hierarchies by making heading levels dynamic, not hardcoded

A BigCommerce accessibility audit revealed skipped and inconsistent heading levels across page templates, confusing screen-reader navigation. The root cause was not incorrect tags but an architectural flaw: each template hardcoded its own heading level with no awareness of the broader page structure. The recommended fix is to create a single reusable heading component that receives its level as an input from whatever controls the page hierarchy, rather than embedding a fixed level in each template. This approach works across stacks — Handlebars, Liquid, React, and Astro — using different mechanisms but the same principle. A contextual heading level stays correct when components are reused or templates are copied, whereas a hardcoded level will eventually break.

0
ProgrammingDEV Community ·

Four Design Principles That Stop LLMs From Misusing Agent Tools

A software engineer writing for DEV Community argues that most bugs in LLM-based agents originate not in the model itself but in poorly designed tool schemas. Because a language model can only infer how a tool works from its parameter names, types, and descriptions, ambiguous schemas cause the model to guess incorrectly and misuse the tool. The author identifies four properties that make tools harder to misuse: a legible schema, a validating boundary, recoverable errors, and idempotency. Practical examples show how replacing vague field types with enums, adding numeric bounds, and writing precise descriptions can eliminate entire categories of invalid inputs. The core recommendation is to treat the schema as the complete specification, since the model has no access to source code or external documentation.

0
ProgrammingDEV Community ·

Debugging LLM Agent Failures Costs Far More Than the Failed Run Itself

Unlike deterministic software, LLM agents produce non-reproducible failures because model outputs are stochastic and external data sources change between runs, making re-running a failed agent effectively a new experiment rather than a replay. This means engineers cannot simply re-run a failed job to reproduce and isolate a bug, as the original failure conditions no longer exist. The true cost of an agent failure lies not in the token spend of the failed run, but in the repeated attempts required to reproduce the failure for inspection. For a bug that occurs just 2% of the time, reproducing it once could require roughly 50 re-runs, costing over $69 in combined token and engineer time before any fix is even attempted. The article argues that agentic systems demand a fundamentally different debugging strategy — one centered on comprehensive logging and trace capture at the time of failure, rather than after-the-fact reproduction.

0
ProgrammingDEV Community ·

How to Safely Roll Back AI Agent Config Changes Without Breaking Live Work

Changing an AI agent's configuration mid-operation is riskier than a standard code deployment, since agents can send messages, spend money, edit code, or control browsers while work is already in flight. Simply restoring an old config file does not reverse side effects already triggered under the previous settings, and can create unresolvable conflicts with recorded intents. A safer approach involves storing every config revision with a unique ID, digest, schema version, and validation result, so each agent action can be traced back to the exact policy that authorized it. Config changes should be promoted in controlled stages — from candidate to canary to active — using deterministic validation checks and isolated probe environments with mock credentials and fake APIs. At the moment of dispatch, agents must re-verify the active revision and policy, marking any intent created under a revoked config as stale and requiring replanning rather than proceeding automatically.

0
ProgrammingDEV Community ·

ICPC Champion Shares Which Competitive Programming Habits Help in Real Engineering

A software engineer who won the ACM-ICPC Asia Topi regional championship in 2021 and qualified for the World Finals has reflected on how competitive programming shaped his professional career. He argues that the discipline's greatest benefit is not algorithmic knowledge but the ability to stay calm and methodical when facing completely unknown problems. Working across XR platforms, AR fire-response systems, and AI voice agents, he found that habits like rigorous edge-case testing and careful constraint analysis translated directly into production work. However, he also acknowledges that two mindsets from competitive programming had to be actively unlearned before he could function effectively on a real engineering team. His conclusion is that contests are valuable not because they teach specific data structures, but because they repeatedly train a reliable problem-solving process under pressure.

0
ProgrammingDEV Community ·

How a Dispatch Table Pattern Can Replace Messy If-Else Chains in Code

A software developer shared how repeated copy-paste logic in a large if-else chain handling third-party API payloads prompted a refactoring exercise. The codebase processed different JSON event types — orders, refunds, and shipments — using nearly identical logic duplicated across each conditional branch. The developer identified that each branch shared the same function signature, making it a classic candidate for a dispatch table or strategy pattern. By mapping event type discriminators to individual handler functions stored in a plain object, the sprawling conditional block could be replaced with a single lookup. The approach improves testability, reduces duplication, and makes adding new event types significantly simpler.

0
ProgrammingDEV Community ·

How Claude Code hooks can enforce strict directory boundaries for unattended agents

Claude Code offers two mechanisms to restrict where an AI agent can write files, but they serve different purposes and are not interchangeable. The permissions.deny setting works as a block-list, but cannot replicate an allow-list because its precedence rules cause a blanket deny to override any exceptions. For finer control — such as limiting an agent to a specific subdirectory within a project — developers need to implement a PreToolUse hook, a command that intercepts file-writing tool calls before they execute. The hook receives the pending operation as JSON on stdin and can respond with an allow, deny, ask, or defer decision, along with a reason passed back to the model. This approach provides binding, code-enforced scope control that remains active even when no human is monitoring the agent.

0
ProgrammingDEV Community ·

How to Detect a Song's BPM and Key: Manual, DAW, and Tool Methods

Finding a song's tempo and musical key is essential for producers, DJs, and remixers working with audio. The quickest manual method involves counting the beat for 15 seconds and multiplying by four, though ambiguity can arise when a track feels half or double its actual tempo. DAW-based grid alignment offers a more precise approach, revealing tempo changes, live timing drift, and misaligned samples across an arrangement. Dedicated analysis tools like KeyFinder can automate the process, detecting BPM, musical key, scale type, and Camelot code from audio files or live system audio. Each method suits different workflows, with manual counting offering speed, DAW alignment offering accuracy, and software tools offering efficiency for batch processing or session prep.

0
ProgrammingDEV Community ·

Developer Migrates Jenkins Freestyle Jobs to Declarative Pipelines on AWS

A developer documented their process of setting up Jenkins on an AWS Ubuntu EC2 instance, configuring Docker-out-of-Docker to allow Jenkins to build images via the host machine's Docker socket. The project initially used Freestyle jobs to run Node.js commands, but their limitations in handling multi-step workflows prompted a migration to Pipeline jobs written in Groovy. The new declarative pipeline, stored as a Jenkinsfile directly in the repository, defined clear stages for code checkout, dependency installation, testing, artifact packaging, and pushing Docker images to DockerHub. Credentials were secured using Jenkins' Secret text plugin within a withCredentials block to prevent sensitive data from appearing in build logs. The developer plans to extend the setup with Multibranch Pipelines and Jenkins Parameters to further automate and configure builds across multiple repository branches.

0
ProgrammingDEV Community ·

Sunverse AI Builds In-Memory PDF Pipeline for Cryptographically Sealed Legal Docs

Sunverse AI, developing Lawyie — a legal infrastructure platform for Africa — has engineered a document generation pipeline that moves beyond standard AI chat interfaces. The system creates legally formatted PDF contracts entirely in-memory using Python's fpdf2 library and io.BytesIO, avoiding file-write conflicts common in cloud environments like Streamlit. Each document is assigned a unique SHA-256-based hash tied to the user's name and generation timestamp, serving as a cryptographic fingerprint to verify authenticity. Any alteration to the document's content would produce a different hash, making tampering detectable. The team positions this approach as a step toward reducing legal access barriers for Africa's 1.4 billion people by enabling verifiable, low-cost digital contracts.

0
ProgrammingDEV Community ·

How One Team Built a WhatsApp AI Agent Serving 20 Industries With 99.7% Uptime

An engineering team has shared 18 months of lessons from running SARA, an open-source WhatsApp AI agent deployed across businesses in 20 industries. The system uses a four-provider AI chain — Groq, Cerebras, SambaNova, and Mistral — with automatic failover and exponential backoff, achieving 99.7% uptime over six months at near-zero inference cost by leveraging free tiers. SARA can execute over 30 real-world actions such as booking reservations, checking inventory, and generating invoices, with a risk-assessment gate that requires human approval for high-stakes operations. The architecture addresses WhatsApp-specific challenges including message ordering, multilingual date parsing, and privacy by anonymizing personal data before it reaches any language model. SARA is released under the AGPL-3.0 license on GitHub, with industry-specific agent definitions available separately under Apache-2.0.

0
ProgrammingHacker News ·

No Reports of AI Systems Forcing Companies to Recognize Worker Unions

A social media post on Mastodon by user Neil highlighted a notable absence in AI-related incident reports. Despite widespread concerns about AI going rogue or causing unintended consequences, no documented cases exist of an AI system compelling a company to recognize a workers union. The observation gained traction on Hacker News, accumulating 34 points and 8 comments. The post appears to draw an ironic contrast between feared AI risks and the kinds of outcomes that might actually benefit workers.

← NewerPage 7 of 1090Older →