SShortSingh.
Back to feed

Tenant-Attributed LLM Summaries in Node.js: Batch Jobs vs Streaming Requests

0
·3 views

The article argues that the choice between batch and streaming LLM processing for large document summaries should follow the tenant's workflow, with both transports writing to a shared usage ledger. Large imports or bulk refreshes are best handled as asynchronous batch jobs, while an editor awaiting a single result benefits from a streamed chat completion. Regardless of transport, each document, chunk, retry, and partial result should stay attributable to one tenant, recording fields such as tenant ID, document identity, prompt version, input size, mode, and job state. The author stresses creating the local record and counting tokens before submission, chunking oversized inputs, and keeping provider acceptance distinct from the product's own tenant commitments. Cancellations, retries, and disconnects are to be modeled as explicit state transitions, with idempotency rules to prevent duplicate jobs.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Designing a One-Tap Mobile App for Connecting AI Tools via MCP

An article from DEV Community argues that the Model Context Protocol (MCP), which links AI assistants to outside tools and data, should not require a desktop setup. It explains MCP as a standard connection language between AI clients and external services, while noting that it does not by itself guarantee security or reliability. The author points out that current setup often involves installing runtimes, editing JSON configs, and managing credentials, which is especially awkward on phones. The proposed remedy is a mobile-first interface where users pick a connector, sign in, review permissions, and use tools without manual configuration. The piece presents this as a design goal rather than a finished product.

0
ProgrammingDEV Community ·

Kafka vs AWS SQS for Fintech Retries: Three Recovery Boundaries to Weigh

A DEV Community article argues that for fintech reservations with fixed hold windows, the key design question is where the expiration decision is made and how failed attempts are recovered, not which queue retries fastest. It contends that a retry mechanism only redelivers work and cannot determine whether a state transition is still valid, so expiration should be driven by a stored deadline and guarded by idempotent, version-checked state changes. The piece compares Kafka's durable log with replay control, Amazon SQS's visibility-timeout redelivery, and RabbitMQ's direct acknowledgement and requeue semantics. It recommends treating the database as the authority on reservation state while the broker serves only as a delivery envelope, with recovery records that let operators inspect failures without reconstructing them from logs.

0
ProgrammingDEV Community ·

Developer builds Schengen day-counter checked against EU Commission calculator and automated tests

After an unexpected one-day overstay risk at the EU border, a developer created Ninety, a tool that tracks Schengen 90/180-day limits against the EES entry/exit record. It can draft an Article 52 correction letter when the border's count appears wrong. The project's accuracy is validated against the European Commission's own short-stay calculator, which the tests use as the source of expected values. The test suite includes 408 unit tests, fuzzed travel histories, and an independent reference implementation, with TestSprite running end-to-end and API checks on every pull request. The article reports that 14 pull requests failed TestSprite runs before turning green, and that the project's pipeline gates merges on full test passage.