Painel de Notícias

Tecnologia

7045 posts · 26 feeds · tópicos e interesse por Jev

Filtros
dev.to

Codex Cloud Pricing 2026: 5-Hour Window Math, Plus to Pro 500

Codex has no price per task, only a rolling 5-hour window and a weekly cap, and the same Plus plan gives you anywhere from 15 to 160 GPT-6.1 Sol messages per window. OpenAI sells no separate Codex subscription. It is included in ChatGPT plans from $0 to $500 a month, so what you buy is an allowance, and what you plan is how fast you burn it. Short answer: a solo developer who codes with Codex a few hours a day fits on Plus at $20 or Pro at $100, and moves to Pro 500 only if Ultrafast speed is worth burning the allowance eight times faster. A five-person team is cheaper per head on Business at $20 a user billed annually than on five Pro 100 seats, but the allowance per seat is the Plus-sized one. The API-key path is billed per token, has no window, and skips cloud features such as GitHub review and Slack. The numbers below come from OpenAI's help pages and October coverage; the planner math is mine and labelled as derived. Per-token APIs price what you use. Codex plans price access to a pool. Since April 2026 OpenAI meters Codex as token credits against a rolling 5-hour window plus a weekly cap. The 5-hour window is the one you feel: you hit it mid-afternoon, wait, and carry on. The weekly cap is the one that ends your Thursday. The message counts people quote are estimates, not guarantees. OpenAI publishes ranges per model, and the range is wide because a message that reads one file costs far less than a message that rewrites a module. Cloud tasks are the sharper edge: OpenAI says cloud chats may use more allowance than local messages, and you cannot change the default model for Codex cloud chats. I could not find a published weekly cap figure in my sources, so I do not give one. When you run past the window you can buy credits. The going estimate is about $0.04 per credit. That makes overflow predictable in dollars even when the messages-per-credit rate is not, and it sets a ceiling on how much a bad day costs you. Credits bought on Pro 100 or Pro 200 do not unlock

IA
Interesse
dev.to

Building Type-Safe Biometric Authentication for React Native with Nitro Modules

Biometric authentication has become a standard part of modern mobile applications. Face ID, Touch ID, fingerprint authentication, and device credentials give users a convenient way to verify their identity before accessing sensitive functionality. For React Native applications, implementing these flows still requires communication with native iOS and Android authentication APIs. That was the motivation behind building react-native-nitro-biometrics, an open-source biometric authentication library for React Native powered by Nitro Modules. In this article, I'll explain the design decisions behind the library, how the API works, and how it can be used in real-world React Native applications. react-native-nitro-biometrics? There are already biometric authentication libraries available for React Native. The goal of this project wasn't simply to create another wrapper around native APIs. I wanted to build a library around a few principles: Simple API Strong TypeScript support Native platform authentication React Native New Architecture support iOS and Android support Minimal developer setup Reusable authentication APIs Clear authentication results The result is react-native-nitro-biometrics. Nitro Modules provide a modern approach for building native modules for React Native applications using the New Architecture. For a library that needs to communicate with native platform APIs, this provides a clean way to expose native functionality through a TypeScript-facing API. The architecture can be thought of as: React Native / TypeScript ↓ react-native-nitro-biometrics ↓ Nitro Modules ↓ Native iOS / Android APIs ↓ Platform Authentication System The JavaScript API stays simple while the native implementation handles platform-specific authentication behavior. The library supports common biometric authentication methods available on supported devices. Authentication Platform Face ID iOS Touch ID iOS Optic ID Supported Apple devices Fingerprint Android Face Android devices where s

DevMobile
Interesse
dev.to

Three Clocks Pick Local or Server

A model call should stay local until three clocks agree. Latency, secrets, and offline need are those clocks. A free server wins only inside that narrow overlap. The laptop is a workshop with the lights already on. The network is a ferry with a posted schedule. You board when the cargo is clean and the crossing fits the deadline. Habit is a bad dispatcher for this choice. A fast demo last week does not price today's hop. A free seat does not make a secret safe to move. Latency is the first clock on the desk. Interactive completion dies when the pause outlasts the thought. Batch work can spend more time and still stay useful. Write the budget before you choose a host. A completion loop might allow four hundred milliseconds. A nightly rename can allow several seconds of delay. Measure the hop with a probe you control. Keep the median of five runs from the same network. Discard a blog number that names a different city and hour. # Proposed probe. Point it at a host you operate or trust. for i in 1 2 3 4 5; do curl -o /dev/null -s -w '%{time_total}\n' https://example.invalid/health done Sort those five totals and take the middle value. That middle value is your median round trip. Compare it with the budget you wrote down first. If the median already consumes the budget, the server cannot win. Local execution or a plain deferral is the honest result. Do not average away a failure with a lucky first sample. Cold start is a separate reading on the same clock. The first call often pays a load cost later calls skip. Warm the process once, then record the five interactive samples. Use the warm median for a loop that stays open. Use the cold reading when each task starts a fresh process. Mixing those two numbers produces a policy that lies. Secrets are the second clock on the same desk. A prompt can carry keys, rows, and unreleased diffs. Those fields do not become harmless because a server invoice is zero. Scan the payload before any client opens a socket. A keyword hit is a

IAInfraDev
Interesse
dev.to

Refuse the Round You Have Not Sent

You do not control spend when the invoice shows up. You control it in the quiet second before the next model round leaves your process. A meter that has not moved is not permission to widen the loop. If that lane is free, the round still costs time, context, and the tool you are about to fire. Picture a kitchen that has already called the next plate. The check in your hand describes the last plate, not the one on the grill. An agent run behaves the same way. The person typed one message. Behind it sits a chain of rounds: prompt, completion, tool result, prompt again. That chain is the unit you should fence. A user turn is a poor proxy, because one turn can hide several model calls, and the later prompt is carrying tool text it did not start with. The round tends to get heavier, not lighter. You feel this when a short lookup starts pasting file bodies back into the prompt, and the next answer is mostly a recap of what the tool just returned. The mistake is to treat a quiet meter as slack. Free model access feels like an empty pan, so you add another tool call, then another, because the dollar field stayed at zero. Free capacity is the wrong bet when the thing you are buying with it is a wider loop. Your caller still waits. Your tools still run. When the run starts, write down a ceiling in tokens and in milliseconds. After each completed round, keep the observation: prompt tokens, completion tokens, elapsed milliseconds, and the size of any tool payload you are about to attach. Before you send the next round, project it from the last observation plus that payload, and add the projection to what you have already spent. If the sum crosses the ceiling, return the partial result. Do not send the call and hope the other side is gentle. The module below is a proposal you can run on your own machine. It is not a provider client, and it is not a bill. This article does not include a live model run. Token fields are observations you pass in. The byte divisor is a stand-in for

IADev
Interesse
dev.to

Propagating Deadlines from VIN Form Submit to NHTSA Proxy Without Orphaned Work

A free VIN form that abandons a slow decode still often leaves a DecodeVinValues call running behind the proxy. The user navigated away, a client timeout fired, or a newer submit superseded the old one -- yet the edge kept waiting on NHTSA and burned quota on a response nobody will display. Per-request budgets (covered elsewhere) decide how long a serverless handler may wait. This post is about propagating that deadline as an AbortSignal from form submit through your BFF so orphaned upstream work is cancelled early. The goal is narrow: one submit, one deadline, one cancellable fetch chain. Do not confuse this with hedged dual-fire, idempotency keys, or jittered retries. Here the job is: when the UI no longer wants the result, stop waiting on the proxy path that would call NHTSA. Orphans appear when deadlines live only at one layer: Browser AbortController aborts the BFF fetch, but the BFF ignores req.signal and keeps calling DecodeVinValues BFF has a hard setTimeout that returns 504 to the client while the outbound NHTSA promise is still pending A second form submit starts a new decode without aborting the first in-flight attempt Serverless budgets shrink remaining time, but nobody wires that remaining budget into fetch(..., { signal }) Each case spends free-quota units on work the card will never show. Propagation means the same abort reason travels from submit handler to outbound proxy call. Create the controller when the user submits (or when the form auto-decodes once). Attach a wall-clock deadline, pass signal to your BFF, and abort on unmount, navigation, or superseding submit. export type DecodeSubmitOpts = { vin: string; deadlineMs: number; // e.g. 8_000 from UX budget fetchProxy: (vin: string, signal: AbortSignal) => Promise ; }; export function submitDecodeWithDeadline( opts: DecodeSubmitOpts, ): { promise: Promise ; abort: (reason?: unknown) => void } { const ctrl = new AbortController(); const timer = setTimeout(() => { ctrl.abort(new Error("CLIENT_DEADL

Dev
Interesse
dev.to

Your intent classifier is 12 points worse in Portuguese: benchmarking Laya, Strands Decider and Qwen3 embeddings

A conversational agent first has to decide what the customer wants. I measured that step for customer-service messages in Brazilian Portuguese (PT-BR), using two small "decider" models and two embedding models. Then I translated the whole dataset into English and ran everything again. Decider vs Laya. Off the shelf, the Strands Decider (2B) gets 84.9–85.8% top-1 accuracy, against 50.9–51.8% for Laya multilingual. Its accuracy does not depend on how the options are ordered. Embeddings alone win. Qwen3-Embedding-4B similarity, with no decider at all, reaches 94.7%, and no decider improves on it. The Portuguese tax. Every component is less accurate in PT-BR than on the same phrases in English. The 0.6B embeddings lose 12 points (p = 0.0014), and the full Decider pipeline loses 8.4 points. The checkpoint's language is the biggest lever. Laya's English checkpoint beats its multilingual sibling by 24 points on English text. Laya has no Portuguese checkpoint, which makes a case for PT-BR fine-tuning. Figure 1. Top-1 accuracy in PT-BR (blue) and in a line-by-line English translation (grey). Bold differences are significant in every seed (exact McNemar test). Goal-oriented agents route each message to one of many goals ("pay a bill", "block a card", "talk to a human"). Each goal is defined by a one-line description and a few example phrases. The decision gates everything after it: High confidence: the agent acts. Middle band: it asks for confirmation. Low confidence: it asks a clarifying question. So you want two things from the classifier: accuracy, and probabilities you can trust. A new class of small models is built exactly for this. Laya and the Strands Decider answer typed questions ("pick one of these N options") and return a probability per option from a dedicated head, instead of generating text. Most of their published evaluations are in English. I wanted to know how they behave in Portuguese. The setup mirrors a production pipeline: Shortlist. An embedding model (Q

IA
Interesse
dev.to

Optimizing Kubernetes Cluster Costs: Spot Instances, Autoscaling, and Resource Quotas

Introduction & Industry Context In the competitive landscape of 2026, managing cloud infrastructure is no longer merely a system engineering concern—it is a critical driver of business unit economics and corporate valuation. As organizations scale their microservice architectures to support increasingly complex workloads, Kubernetes has cemented itself as the operating system of the modern cloud. With the release of Kubernetes 1.37, the platform's orchestration capabilities have reached unprecedented levels of maturity. However, this power introduces a significant risk: the compounding cost of unoptimized, over-provisioned infrastructure. For Chief Technology Officers (CTOs) and finance leaders, unchecked cloud spend functions as a silent tax on innovation. Capital that should be allocated toward hiring, product experimentation, or market expansion is instead absorbed by idle compute capacity. To achieve true capital efficiency, modern engineering organizations must transition from static provisioning models to dynamic, cost-aware architectures. This blueprint outlines the strategic integration of Karpenter, AWS Spot Instances, and Kubernetes Resource Quotas to construct a high-performance, self-optimizing infrastructure layer that aligns cloud expenditure directly with real-time application demand. The fundamental challenge of cloud-native infrastructure is the discrepancy between requested resources and actual resource utilization. Historically, engineering teams have over-provisioned CPU and memory configurations to avoid performance degradation during traffic spikes. This safety margin, while logical at an individual service level, aggregates into massive systemic waste across enterprise clusters. This inefficiency stems from three core architectural vulnerabilities: The Over-Provisioning Bias: Developers, prioritizing application uptime, routinely request double or triple the compute capacity their workloads actually consume. Without strict enforcement mechanis

InfraDev
Interesse
dev.to

From Document Upload to Provenance Chain: Architecting Verifiable Evidence for AI-Assisted KYC

A customer uploads an identity document. OCR extracts the name and document number. A model classifies the image. Another component detects suspicious regions. AI compares extracted attributes with application data, and eventually the customer becomes KYC-approved. From the application perspective, this can look simple: Document Upload ↓ OCR ↓ AI ↓ KYC Approved Architecturally, that hides an important question: Can we reconstruct exactly what evidence, transformation, model, rule, and human decision produced the final result? That is where KYC starts becoming an evidence provenance problem rather than only a document-processing problem. A document is evidence. An OCR result is a derived interpretation of that evidence. An AI-generated conclusion is another derived claim. A final KYC status is a policy or human decision based on some combination of those artifacts. These should not be treated as equivalent. For example, OCR may correctly extract: Name: Rahul Sharma Document Number: ABC12345 That does not prove the document is genuine. Similarly, a cryptographic hash can help establish that stored bytes have not changed, but it does not establish that the underlying document is authentic. The architecture needs to preserve these distinctions. Suppose OCR initially extracts the wrong document number and a later model produces the correct value. If the system simply updates: document_number = corrected_value the historical reasoning disappears. A better model keeps the lineage: SOURCE_DOCUMENT:v1 ↓ OCR_RESULT:v3 ↓ ATTRIBUTE_SET:v2 ↓ POLICY_EVALUATION:v7 ↓ KYC_DECISION:v1 If OCR is rerun later using another model version, it should create another branch rather than rewrite the evidence used by the original decision. AI may be useful for: comparing names, identifying inconsistent fields, classifying unusual layouts, summarizing discrepancies, prioritizing manual reviews. But an AI result should remain a derived claim. If one document contains: VAIBHAV S SHAKYA and another

IA
Interesse
dev.to

Smart Contract Vulnerability Surface Analysis: SparkLend

Smart Contract Vulnerability Surface Analysis: SparkLend Target Protocol: SparkLend (TVL: $5414.9M) Smart Contract Vulnerability Surface Analysis TVL: ≈ $5.4 B (Ethereum + L2) Date: 8 Oct 2026 SparkLend is a high‑throughput, permission‑less money‑market protocol that aggregates liquidity across Ethereum L1 and multiple roll‑ups (Arbitrum, Optimism, zkSync). Its core architecture consists of: Component Primary Contracts Function Pool Manager PoolCore, PoolConfigurator Deploys and configures market contracts (aUSDC, aWETH, …). Interest Rate Model InterestRateStrategy Calculates borrow & supply rates based on utilization. Oracle Layer PriceOracle, ChainlinkAggregatorWrapper Supplies asset price feeds to collateral‑valuation engine. Liquidation Engine LiquidationManager, FlashLiquidator Executes under‑collateralized position liquidations, optionally via flash loans. Governance SparkGovernor, TimelockController On‑chain DAO for protocol upgrades and parameter changes. Upgrade Proxy TransparentUpgradeableProxy (OpenZeppelin) Enables contract upgrades via admin role. The protocol’s attack surface is large because it must: Accept arbitrary deposits/withdrawals from any address. Interact with external price oracles and third‑party token contracts. Perform complex state transitions (borrow, repay, liquidation) in a single transaction. Allow upgrades and governance actions that can modify core logic. Our analysis focuses on runtime (on‑chain) risks that could be exploited by an adversary with either a single transaction or a multi‑step campaign. We do not audit the entire codebase line‑by‑line; instead we map known design patterns, external dependencies, and recent public incidents to SparkLend’s architecture to surface the most likely vectors. Metric Rating (1‑10) Rationale Attack Surface Breadth 8 Multiple markets, cross‑chain bridges, flash‑loan‑enabled liquidations, upgradeability. Criticality of Assets 9 $5.4 B TVL, many high‑value stablecoins and ETH‑based assets. Histor

Segurança
Interesse
dev.to

Fine-tuning Qwen2.5-1.5B on a Mac to fix a parroting chatbot (and halve the prompt)

By Georgii Kharlampiiev, Mindscend Our company website is a single chat page backed by a model we host ourselves. This post walks through how we fine-tuned that model with LoRA on a MacBook, how we checked it was better, and how we shipped it to a CPU-only server. All the numbers are from our own runs. Model: Qwen2.5-1.5B-Instruct, GGUF, Q4_K_M (about 1 GB). Serving: llama.cpp llama-server on an AWS EC2 t4g.medium (2 Graviton vCPUs, 4 GB RAM, no GPU, about $29/month). API: a Node.js Lambda with a streaming Function URL that calls llama-server's OpenAI-compatible /v1/chat/completions. Infra: AWS CDK. The model is downloaded from a URL in CDK context at first boot. Three different messages, "Tell me a joke", "could you tell me a joke?" and "can you help with ats?", got the same answer word for word. Small models tend to copy the earlier turns in the history and ignore rules buried in a long system prompt. Our first fixes were in the prompt and in code: A system prompt with facts, rules and few-shot examples: 1,333 tokens. A 91-token reminder appended to the last user turn (Qwen echoed a trailing system message back, so the reminder had to ride inside the user turn). An off-topic classifier: a second llama-server call constrained by a GBNF grammar to answer only YES or NO, with canned, rotating refusals. History cleanup: off-topic exchanges dropped, earlier answers trimmed to their first sentence. // classifier call (abridged) body: JSON.stringify({ messages: [system, ...fewShotTurns, { role: "user", content: question }], grammar: 'root ::= "YES" | "NO"', max_tokens: 3, temperature: 0, cache_prompt: true, }) That worked, but the prompt was long and slow to process on two cores, and tuning one rule regularly broke another. A 1.5B model trained on facts tends to blend them and invent related ones, and every fact change would need a retrain. So the training data teaches behavior only: answer as "we", decline off-topic requests, say "I don't know" for unlisted tools, keep

IAInfraDev
Interesse
dev.to

A pixel-ratio governor for Three.js that doesn't trust 60 fps

The home page of my portfolio is a WebGL scene: a ray-marched black hole and 1 render pixel per CSS point. The obvious fix is renderer.setPixelRatio(window.devicePixelRatio). On this So the scene doesn't guess. It tries. The governor starts at 1, which I already knew worked, and tries 1 → 1.25 → 1.5, never above devicePixelRatio. It measures windows of 45 and that ceiling stays for the rest of the visit. That last part matters more than it looks. Every resolution change resets the Because on phones you can't. Almost no mobile browser exposes EXT_disjoint_timer_query. The only clock you have is the interval between requestAnimationFrame calls, and that clock saturates at the refresh some My first version used a fixed bar: p75 ≤ 18.5 ms meant "fast", step up. half The fix: the bar is relative to the device. The governor remembers the This is the whole thing, dependency-free (comments trimmed): const TOUCH_DPR_STEPS = [1, 1.25, 1.5] as const; export const WINDOW_FRAMES = 45; export const SETTLE_FRAMES = 30; const FAST_MS = 18.5; // p75 below this: room to step up (≥ ~54 fps) const SLOW_MS = 26; // p75 above this: step down (≤ ~38 fps) const PACE_TOLERANCE = 1.15; const GAP_MS = 250; // a gap like this is a paused tab or a GC, not a slow frame export function createResolutionGovernor(deviceRatio: number) { const steps = TOUCH_DPR_STEPS.filter( (step, index) => index === 0 || step GAP_MS) { restart(); last = timestamp; return false; } if (settle > 0) { settle -= 1; return false; } intervals.push(interval); if (intervals.length a - b); const p75 = sorted[Math.floor(sorted.length * 0.75)]; intervals.length = 0; pace = Math.min(pace, p75); const held = p75 0 && (p75 >= SLOW_MS || !held)) { index -= 1; ceiling = index; // never try this step again restart(); return true; } if (held && p75 { const governor = createResolutionGovernor(3); let t = run(governor, 1000 / 120).end; expect(governor.dpr).toBe(1.25); // 16.7 ms passes the fixed 18.5 ms bar, but it's half the screen's r

DevMobile
Interesse
dev.to

Duplicate Image Processing: Debug Why Event Promo Costs Spiked

TL;DR: Put a deterministic content fingerprint in front of every expensive image rendition, but keep moderation decisions versioned separately. For event photos feeding short promo videos, the skip condition should be “this exact asset, rendition recipe, and moderation policy already reached an accepted terminal state,” not merely “this filename exists.” Log that decision as data. A cost spike then becomes a query over repeated keys instead of a tour through worker logs. This is the smallest design I trust because it attacks duplicate work without weakening moderation coverage. It also keeps configuration small: one key function, one state record, one conditional claim. No sprawling workflow file. The obvious check is usually wrong. An event-photo pipeline sees IMG_0042.jpg twice and skips the second copy, or sees two different object paths and renders both. Neither filename nor path answers the useful question: has this image already passed the required checks and produced this requested output? The moderation policy changes the key. A photo accepted under one policy is not proof that it was checked under a later policy. Likewise, an approved original does not imply that every crop is suitable for a promo frame; a crop can change what is visible. So I would separate immutable asset identity from policy and rendition identity, then require all three at the reuse boundary. That trade-off costs a little metadata. Good. Paying for explicit state is easier to debug than paying repeatedly for opaque processing. Image format belongs in the intake record too. Event uploads may arrive in different file types, and format support varies across image ecosystems. MDN's image format guide is a useful baseline for recognizing common types and their characteristics. Still, a file extension is descriptive metadata, not a deduplication key. Two names can carry identical bytes; identical names can carry different bytes. I start with raw-byte identity because it is deterministic and c

Dev
Interesse
dev.to

API Route Health Checks: Background Worker Heartbeats Guard Logistics Rollbacks

TL;DR: Give the web application a cheap health endpoint, record job_success, job_failure, and last_run for each notification worker, and use an external heartbeat for failed-job detection. For a logistics notification service, that is the least complex design that catches both visible delivery failures and the nastier case: a worker or cron task that never started. Retain enough evidence to compare a release with its predecessor, but don't keep every payload. Rollback safety comes from preserving decision-grade signals, not from hoarding telemetry. The bill is driven first by what you ingest and retain. A useful planning equation is retained bytes = events per interval x bytes per event x retained intervals; query work then grows with how much of that retained set each investigation scans. Before choosing a vendor, measure those terms separately for delivery outcomes, application errors, and payload-like context. The change that moves the dominant term is usually dropping high-cardinality or duplicated context from routine success events while keeping failure detail and aggregate counters. A /api/health route should prove that the web process can answer. It can't prove that the queue consumer ran, that an OTP reached its provider, or that yesterday's delayed-delivery sweep executed. Treating one green URL as proof of all three creates a comforting blind spot. For each email, SMS, or OTP worker, report three operational signals: job_success, job_failure, and a last_run timestamp. Slice them only by dimensions that change an operational decision, such as region, channel, worker name, and release. EU and US separation can matter for routing and compliance review; individual recipient identifiers don't belong in routine metrics. OWASP's logging guidance is a good baseline for excluding tokens, secrets, and sensitive personal data. There is a hard boundary here. Counters can show a rising failure rate, and last_run can show stale work when somebody queries it, but neithe

InfraDev
Interesse
dev.to

CLM: A Decision Model Trained with Contrastive Learning, Not Another Chat Model

The model race today is mostly about generation: longer context, prettier answers, stronger reasoning. But if you actually run agents, the thing that bites you usually isn't "generates poorly" — it's "decides too slowly." Every step an agent takes requires choosing the next action. If that choice also runs the full token-by-token generation pipeline, both latency and cost climb — a single "which button" can burn hundreds of tokens. CLM (Contrastive Language Models, 2913 stars, Apache-2.0, Python) attacks it from a different angle: pull decision-making out and train a model dedicated to it. Its one-liner: a System One model trained with a contrastive objective that connects states and actions directly. A normal LLM is generative: given a state, it writes the action token by token. CLM is contrastive: what it learns isn't "how to write," but "which action fits this state better" — scoring state–action pairs directly. The practical payoffs: Fast: a decision is one scoring pass, not token generation. The authors report performance on par with Jev while being up to 9× lower latency; Good fit for ranking: a contrastive objective is literally "put the right one first," which is exactly what picking from candidate actions needs; Cheap: no token burn per decision. It ships CLM-8B behind a TypeSafe-compatible API (the de-facto interface for this class of decision models), plus a fine-tuning tutorial and models/data on Hugging Face. It targets the real agent pain — decision cost. Anyone who has run an agent knows that "waiting for the model to think at every step" is the biggest UX killer. A dedicated 8B decision model (instead of leaning on a 100B+ model for every choice) is an order-of-magnitude change in latency and cost. "Contrastive learning + state/action" has real theoretical grounding. It doesn't shrink a big model — it changes the learning objective, from generation to contrast. That's defining the problem correctly rather than throwing compute at it. The engineering

IADev
Interesse
dev.to

Low-Cost AI Chatbot Backend: How Startup SaaS Compares 2 Token Budgets

TL;DR: a startup SaaS should choose a low-cost AI chatbot backend by enforcing two budgets on its own support-ticket set: a quality floor for routing decisions and a latency ceiling for the customer-facing reply. Per-token pricing matters only after a candidate clears both. For a one-person SaaS serving Europe and the United States, the practical default is a small synchronous path for obvious tickets, an escalation path for uncertain ones, and batching for work that does not need to block the reply. Path Use it when Quality rule Latency rule Cost lever Fast classify Intent is clear Must clear the routing floor Must fit the interactive ceiling Short output and stable prefix Escalate Confidence is low or impact is high Prefer a stronger judgment Extra delay is explicit Spend only on the hard slice Deferred enrich Tags or summaries can arrive later Evaluate before write-back No customer wait Batch queued work Recommendation: buy neither the cheapest token nor the highest benchmark score in isolation. Run the same ticket replay against every candidate, reject any path that misses a budget, then compare the remaining cost per accepted ticket. That keeps the decision tied to support outcomes instead of a price page. Quality is first because a cheap wrong route creates a second support task. For triage, score the decisions the application consumes: queue, urgency, language, and whether a human must review. A fluent explanation is not the acceptance criterion. A correct structured decision is. Use a fixed, versioned ticket set with terse messages, pasted logs, mixed-language text, billing disputes, security concerns, and near-duplicate intents. Keep a hidden holdout set so prompt edits do not quietly overfit the examples you stare at every week. The quality floor can differ by field: a wrong product-area tag is annoying, while a missed security escalation is unacceptable. Latency is the second criterion, but measure the part users feel. Record end-to-end time from receipt

IADev
Interesse
dev.to

Connect Google's Gemini CLI to your servers over SSH — safely

Gemini CLI speaks MCP, so it runs commands and manages files on your servers through Termalin — one entry in ~/.gemini/settings.json, no key handed over. Google's Gemini CLI is a capable agent in a terminal, and like the other coding agents it eventually needs to leave your laptop and touch a real server — restart a service, tail a log, run the deploy on the box itself. The tempting shortcut is to let it run ssh directly: the CLI already executes shell commands, so if a key sits unlocked in ~/.ssh or a running ssh-agent, ssh prod works for it whether or not you meant to grant that. That's the whole problem in one line — you gave away full server access by default. Gemini CLI has a cleaner path built in: it speaks MCP, the same protocol Claude Code, Cursor and Codex use. Termalin is an SSH client with a built-in MCP server, so you point Gemini at that server and it works your hosts for real — while the agent never holds a key. About twenty minutes, one host. Termalin — the desktop app; the Free tier is fine. Its built-in MCP server is what Gemini talks to. Gemini CLI, on the same machine. One host saved in Termalin — something low-stakes for the first run. Agent access is off by default. In Termalin, open Settings → MCP, enable it, and tick the hosts Gemini may reach. Nothing outside that list exists as far as the agent is concerned — a new host is a decision you make in the app, not something the agent can talk its way into. Under the hood, Termalin writes a host inventory for the MCP server with agent-only auth entries — no passwords or keys land in that file — and authentication stays with the app's key custodian: you unlock once, and Termalin signs on the agent's behalf. There's no key file for Gemini to read, so there's nothing to leak, and the ~/.ssh back door above closes with it. While you're there, set each host's agent policy: full access, an allowlist of commands, or blocked. Start with an allowlist for anything you care about — the least-privilege setup i

IAInfraDev
Interesse
dev.to

Cross-Chain Bridge Risk Assessment: Portal

Cross-Chain Bridge Risk Assessment: Portal Target Protocol: Portal (TVL: $1879.5M) Portal – Cross‑Chain Bridge – Technical Security & Audit Report Prepared by: Senior DeFi Security Researcher Date: 7 Oct 2026 Portal is a high‑value cross‑chain bridge that currently locks ≈ $1.88 B of assets across Ethereum and multiple L2 roll‑ups (Optimism, Arbitrum, zkSync, StarkNet). The bridge’s core architecture consists of: Component Description Lock‑&‑Mint Smart‑Contracts (Ethereum Mainnet) Custodial contracts that lock native assets and emit events for off‑chain relayers. Mint‑&‑Release Contracts (L2s) Minimal proxy contracts that mint wrapped tokens (e.g., wETH‑L2) upon validated proofs. Relayer Network A set of permissioned/permissionless relayers that aggregate signatures from a Validator Committee (≈ 30 members) and submit Merkle proofs to L2 contracts. Validator Committee Off‑chain entities that observe lock events, generate state roots, and sign proofs. Committee members are selected via a staking‑based voting system. Governance Module On‑chain DAO that can add/remove validators, upgrade contracts (via a Timelock), and adjust fee parameters. The bridge’s attack surface is typical of any multi‑chain asset transfer system: smart‑contract logic, cross‑chain message verification, validator consensus, and governance. While Portal’s codebase follows modern Solidity patterns (≥ 0.8.19) and uses OpenZeppelin libraries for access control, several systemic and implementation‑level weaknesses have been identified that could enable asset loss, censorship, or a total bridge freeze. Overall Risk Score: 7.4 / 10 (High). The score reflects the large TVL, the reliance on a relatively small validator set, and the presence of multiple medium‑severity vulnerabilities that are exploitable under realistic threat models. # Vector Description Impact Likelihood CVSS‑3.1 (Base) 1 Validator Collusion / Sybil Attack The validator committee (30 members) is selected via a staking‑based voting syste

SegurançaDev
Interesse
dev.to

How to use the OpenAI Decisions API with Strands Agents

OpenAI shipped a Decisions API. It isn't a chat model you coax into choosing: it answers a bounded question directly. You give it a request and a fixed list of options, it returns one of them with a confidence. No generated text, no option it invents, nothing to parse. The returned choice is always one you supplied. An agent is full of bounded questions, so I wired it into a Strands Agents agent two ways. Both are in the repo and both run. Here they are side by side. Both uses share one request shape, through the official async client: from openai import AsyncOpenAI oai = AsyncOpenAI() # reads OPENAI_API_KEY resp = await oai.decisions.create( model="gpt-6-luna", input="How much is a room at the Cliffside Resort?", questions=[{ "type": "choice", "name": "pick", "instructions": "Which option best answers this request?", "choices": [ # one {value, description} per option {"value": "get_hotel_room_rates", "description": "Nightly room rates for a hotel"}, {"value": "get_weather", "description": "Current weather for a city"}, ], }], ) answer = next(a for a in resp.answers if a.name == "pick") answer.choice # -> "get_hotel_room_rates" answer.confidence # -> 0.97 What changes between the two uses is only what the choices are: tools in one, models in the other. Both are below. One narrows the toolbox a model sees; the other picks which model runs. Pick the one your agent needs, or use both. Give a small model forty overlapping tools and it picks the wrong one or invents one. Every tool is also tokens it pays for on every turn: name, description, schema. Choosing the relevant tool before the model runs fixes both, and in Strands that choice lives in a hook (BeforeModelCallEvent), because it changes what the agent sees: the hook swaps the agent's tool registry down to the pick. The selector is one function; everything else is the hook. oai_choices = [{"value": t.tool_name, "description": t.tool_spec["description"]} for t in ALL_TOOLS] async def openai_select(query): resp = awa

IADev
Interesse
dev.to

Next.js Scheduled Import Alerts: Node.js Logging with Redacted Structured JSON

Short answer: For a Next.js app, put one server-only logging boundary around server actions and API routes, emit a small structured JSON event for each import state, and alert on missing or stale results separately from ordinary request logs. That design keeps the primary decision visible: signal quality versus noise. A log entry saying that an import started is evidence of an attempt. It is not evidence that rows arrived. A completion event with records_written: 0 is a different signal again. Treating those states as one “success” field is how scheduled-import alerts become either silent or exhausting. The rest is careful plumbing. Keep personally identifying data out of the event before serialization, make retries bounded, and attach a correlation ID that survives the server action, API route, and worker path. Start with the event contract, not the destination. A useful envelope for an edtech import might contain event_name, job_name, run_id, request_id, environment, release, observed_at, and a small result summary. The summary can include a row count and a duration; it does not need a student name, email address, uploaded file name, access token, cookie, or raw response body. The scheduled job needs at least three states: started, completed, and failed. Add a fourth state, completed_empty, when an empty result is valid enough to distinguish from a parser or upstream failure. The exact names matter less than keeping the state machine explicit. A dashboard should be able to answer “did the run start?”, “did it finish?”, and “did it produce anything?” without guessing from log text. Use an allowlist at the call site. Recursive redaction is a useful second barrier, but it is not permission to pass a request object into a logger. Redaction rules tend to age better when they cover both sensitive key names and sensitive values whose names are unfamiliar. The source event should still be deliberately small. For server actions and API routes, generate request_id at ingres

Dev
Interesse
dev.to

The Optimal Stopping Illusion

In sequential decision theory, the search problem is framed around optimal stopping. An agent gathers observations sequentially. Each extra query carries a marginal cost: token consumption, API fees, latency, and context degradation. Rational stopping dictates that an agent continues querying only so long as the expected marginal value of information exceeds the marginal cost of acquisition. When incoming data yields nothing, the option value of continuation goes negative, and the search must terminate. Enterprise deployments of tool-using language agents lean heavily on the assumption that models can internalize this calculus. Enterprise architectures hand models a set of search tools, define an operational budget, and embed cost warnings in the system prompt. The thesis is intuitive: as models scale in reasoning capability, they will weigh the quality of retrieved evidence against the expenditure of running another tool turn, pruning unproductive searches before blowing through their token ceilings. A pre-registered empirical study by researchers across Nanyang Technological University, the National University of Singapore, and Carnegie Mellon University directly stress-tests this assumption. Evaluating seven open and frontier model architectures across 90,000 episodes in a controlled retrieval failure environment, the authors isolated how agents judge evidence from how they actually decide to stop. The empirical results reveal a stark operational dissociation. The agents are not blind. When retrieval tools return unhelpful or corrupted results, the tested models correctly identify the incoming information as useless between 97% and 100% of the time. They evaluate the quality of the data with near-flawless accuracy. Yet their stopping decisions completely ignore their own judgments. The authors constructed a time-matched contrast metric, measuring whether an agent was more likely to stop after an unbroken string of useless results than after a sequence containing

IA
Interesse
dev.to

Governance Attack Surface Review: HashKey Exchange

Governance Attack Surface Review: HashKey Exchange Target Protocol: HashKey Exchange (TVL: $1643.1M) Protocol: HashKey Exchange (TVL: $1.64 B on Ethereum & L2) Date of Review: 7 Oct 2026 Prepared by: Senior DeFi Security Researcher – Independent Audit HashKey Exchange (HKX) is a high‑value, cross‑chain DEX that relies on a governance layer built around the HKX token (ERC‑20) and a timelocked upgradeable proxy (UUPS) controlled by a multisignature (Gnosis Safe). The governance model is intended to allow token‑holder proposals, quorum‑based voting, and a 48‑hour execution delay. Our Governance Attack Surface Review focuses on the non‑code (contract‑level) and code‑level mechanisms that could be abused to seize control of the protocol, alter parameters, or execute malicious upgrades. Key findings: # Issue Category Severity (High/Med/Low) Likelihood Impact Overall Risk Score* 1 Token‑holder concentration & voting power centralisation High Medium‑High Full control of governance actions 8 2 Insufficient quorum & proposal threshold enforcement High Medium Ability to pass malicious proposals with a small coalition 7 3 Timelock bypass via “emergency” function Critical Low‑Medium Immediate execution of upgrades, bypassing the 48 h delay 9 4 Upgradeable proxy owner mis‑configuration Critical Low Owner can be changed without a proposal, enabling a hidden backdoor 8 5 Flash‑loan‑driven voting attacks Medium High Short‑term capture of voting power to push malicious proposals 6 6 Proposal injection via off‑chain relayer compromise Medium Medium Malicious proposals can be queued without community scrutiny 5 7 Multisig key‑management weaknesses (single‑point hardware failure, compromised key) High Low‑Medium Multisig can be hijacked, allowing arbitrary upgrades 7 8 L2 bridge governance coupling Medium Medium Governance actions on L2 can be replayed on Ethereum (or vice‑versa) leading to cross‑chain state inconsistency 5 9 Lack of “pause” or “circuit‑breaker” for governance Low Low N

Segurança
Interesse
dev.to

I kept finding the same mess in every vibe-coded repo, so I built a CLI to catch it before I do

I freelance. Half my work lately is taking over projects built with AI tools like Cursor, Claude, Codex. Clients ship fast, then hit a wall and need a real developer. Every single time I open one of these repos, the first two hours look the same: scroll through git history trying to understand what happened grep for hardcoded API keys and secrets figure out what stack is actually being used vs what the package.json claims find the TODOs nobody tracked check if there are tests (usually no) I did this manually maybe 15 times before I got annoyed enough to automate it. What it does rebrief scans a repo and spits out a single REBRIEF.md file with: stack detection filtered git history (the signal, not every commit) a risk map secrets detection tech debt and TODO list test coverage summary pip install rebrief rebrief scan . You get one document instead of two hours of archaeology. Why not just ask the AI tool that built it Because by the time a human dev gets involved, the context is gone. The founder who vibe-coded it doesn't know what questions to ask. The dev taking over doesn't trust a summary written by the same tool that may have introduced the mess. rebrief reads the actual code, not a chat log. It also works in a few other modes if that's useful to you: MCP server mode, so an AI agent can query the report directly scan a remote repo by URL, no clone needed chat mode over the generated report interactive HTML output, or XML if you need it machine-readable State of the project It's open source, live on PyPI and GitHub, past v0.3.2. Built it because I needed it myself, not because I had a grand plan. Still rough in places. I'm looking for people who actually run it on a real repo and tell me where it breaks. GitHub: https://github.com/neracu/rebrief pip install rebrief If you've ever inherited a vibe-coded project, or built one and need to hand it off, I'd genuinely like to know if this saves you the two hours it used to cost me.

Dev
Interesse
dev.to

OCR + LLM Pipeline for Contract Review: What Actually Works in Production

If you’ve ever tried to extract data from legal contracts, financial reports, or dense PDFs, you already know the pain. You throw a standard OCR tool at a 20-page multi-column document, and it spits out a garbled mess. Contracts are notoriously difficult to parse. They aren’t just simple top-to-bottom text. They are a chaotic mix of multi-column layouts, dense tabular data, indented paragraphs, and signature blocks. So, I built a pipeline that actually sees the document the way a human does. By combining Layout Aware OCR (using Docling and PaddleOCR) with an LLM (via Groq, though you can easily swap in OpenAI or Anthropic), I created a system that cleanly extracts key terms, clauses, and structured data from the messiest contracts. Check out the detailed article with code examples and a quick startup guide here: [https://thetechboss.com/ocr-and-llm-pipeline-for-contract-review/]

IADev
Interesse
dev.to

AI Agents for DevOps and SRE: The Changing Face of Operations in 2026

If an alarm goes off at 3 a.m., until now it has been a human who gets up, sifts through logs, and hopes to find the right spot in the runbook. In 2026, AI agents are increasingly taking over – not as friendly summarizing chatbots, but as autonomous actors that correlate alarms, identify root causes, and even execute remediation steps. Microsoft operates over 1,300 Azure SRE agents in production, PagerDuty reports 50 percent faster incident resolution, and the market for agentic operations management is growing rapidly. Time for an overview of what is changing. Traditional DevOps automation follows a simple pattern: if X happens, execute Y. A PagerDuty alarm triggers a runbook, a cron job checks health checks, a Terraform configuration is applied. Every action is predefined, every edge case requires a new rule. AI agents break this pattern. They receive an alarm, read logs, check current deployments, correlate metrics across multiple services, and then decide what the most likely cause is – before they act. If the first hypothesis fails, they try a different approach. This is the core of the ReAct pattern (Reason and Act), which comes from AI research and has established itself as the dominant architectural pattern for operations agents in 2026. The market for AI SRE agents has consolidated to a few major platforms in 2026. Azure SRE Agent (General Availability since March 2026) is the most comprehensive cloud-native SRE agent. Its "Deep Context" function connects code repositories, logs, past incidents, Azure resources, and knowledge documents into a single context graph. The agent has persistent memory and runs background analyses even when no one is actively asking questions. Microsoft states that with over 1,300 of these agents, they save more than 20,000 engineering hours per month. PagerDuty's AI Agent Suite relies on a multi-agent approach: the SRE Agent analyzes incidents and executes automated fixes within policy guardrails, the Scribe Agent transcribes Sla

IAInfraDev
Interesse
dev.to

One key for an agent's tool calls: a prepaid USDC balance on an MCP connection

Most paid MCP tools ask the agent to pay per call on chain: sign an EIP-3009 authorization, broadcast it, wait for confirmations, retry — for a $0.001 weather reading. We measured what that does to adoption on our own marketplace: hundreds of MCP clients listed our tools, none paid. So we added one more door. https://modelmarket.dev/start gives a key (no email), tops it up with USDC on Base from a browser wallet, and shows the config line for Claude Code, Cursor, VS Code, Claude Desktop, or a single URL for claude.ai's custom-connector box. The key rides on the MCP connection as X-API-Key; priced calls are held and captured from the balance; a short balance still gets the free trial; an unknown key is refused rather than served free. We ran it end to end on mainnet with $1: one transaction (transferWithAuthorization to the hub's treasury, ~0.0000005 ETH of gas), a credit, and a $0.001 call paid from the balance. Every record and the transaction, with diagrams: https://github.com/alexar76/aicom/blob/main/docs/start-onboarding-demo.md Disclosure: we run modelmarket.dev.

IADev
Interesse
dev.to

Valkey 9.2's INCREX command removes the crash window between INCR and EXPIRE

I run a lot of rate limiters and quota counters the same way: INCR the key, and if it comes back 1, set an expiry on it so the window resets later. It works, but it is two round trips to the database for something that is conceptually one operation, and there has always been a gap between those two calls where a process could die and leave a counter that never expires. Valkey 9.2.0-rc1 adds a command called INCREX that does both in a single call. I pulled the image, ran it against the pattern it replaces, and tried to find out how much of what I assumed about it was actually true. Most of it was not. The headline speed story turns out to be mostly about round trips rather than the command being intrinsically faster, and the behaviour I ended up caring about most was not speed at all. I ran valkey/valkey:9.2.0-rc1, and for comparison the previous stable valkey/valkey:9.1.2, as plain Docker containers on the same host, talking to them from a Python script using redis-py 8.1.0 over TCP on localhost. This is a release candidate, not a final build: 9.2.0-rc1 is the newest tag Docker Hub has for the valkey/valkey image as of this test, and INCREX is not in 9.1.2 at all: $ docker exec vk91 valkey-cli INCREX bar 10 EX 30 (error) ERR unknown command 'INCREX', with args beginning with: 'bar' '10' 'EX' '30' On 9.2.0-rc1 it exists, and COMMAND DOCS confirms when it landed, although the server's own INFO server reports its version as the plain 9.2.0, with no -rc1 suffix, so you cannot tell a candidate build from a final one by querying it: $ docker exec vk92 valkey-cli COMMAND DOCS INCREX summary Increments the numeric value of a key with an option to expire. Uses 0 as initial value if the key doesn't exist. since 9.2.0 The grammar is INCREX key [NX|XX] [EX seconds|PX ms|EXAT ts|PXAT ts] [BYINT n|BYFLOAT n]. Leave out BYINT/BYFLOAT and it increments by 1. The pattern I actually write in application code is two separate, blocking round trips: val = r.incr(key) if val == 1: r.expi

Dev
Interesse
dev.to

Cleaning OCR Noise from Phone-Photo VIN Captures Before Validation

Buyers photograph the dash plate or door sticker and expect a free VIN tool to "just work." OCR output is not a VIN. It is a noisy string: letter O for digit 0, spaces in the middle, random punctuation from glare, and sometimes an extra VIN label glued to the front. If you run check-digit math or call NHTSA on that raw text, you get false invalids and wasted upstream calls. This post is a practical OCR cleanup pipeline that runs before charset rules, length guards, and DecodeVinValues -- without silently inventing a different vehicle. Typical messy captures: VIN: 1HGCM82633AOO4352 (O/0 confusion) 1HGCM 82633 A004352 (spaces from line breaks) IHGCM82633A004352 (I for 1) 1HGCM82633A004352. (trailing junk) S/N 1HGCM82633A004352 CA (labels and state codes) ISO VIN rules reject I, O, and Q in a true VIN. OCR often introduces those letters by misreading 1 and 0. Cleanup must be deliberate: fix likely illegal confusions, then validate. Do not keep mutating legal letters until the check digit passes. Uppercase and strip known labels (VIN, S/N, NO.) Remove whitespace and common separators Map illegal OCR letters I / O / Q to their usual digit lookalikes Drop remaining non-VIN characters Enforce length 17 and charset (still no I/O/Q) Optional check digit Only then call NHTSA A common mistake is remapping legal letters like B, S, or Z on every capture. Those characters are valid in real VINs. Blind global substitution can change a correct read into a different vehicle identifier. Keep aggressive maps behind an explicit "Did you mean?" confirm step. const LABEL = /\b(VIN|V\.?I\.?N\.?|S\/N|SERIAL|NO\.?)\b[:\s-]*/gi; const SEPARATORS = /[\s\-._:/\\]+/g; const TRAIL_JUNK = /[^A-HJ-NPR-Z0-9]+$/i; // Only map characters that are never legal in a VIN const ILLEGAL_OCR_MAP: Record = { O: "0", Q: "0", I: "1", }; export type OcrCleanResult = | { ok: true; vin: string; applied: string[] } | { ok: false; reason: "empty" | "length" | "charset"; raw: string }; export function cleanOcrVin(ra

Dev
Interesse
dev.to

Building an MCP server in Python on open data: French company lookup, tested end to end

I wanted a small, real MCP server to learn the protocol properly: not a "hello world" tool, but something an assistant could use for an actual task. French public data is a good playground. Two official APIs answer most "who is this company?" questions, need no key, and are published under the Licence Ouverte 2.0 (Etalab's open licence, which allows reuse, including commercial, as long as you credit the source): API Recherche d'entreprises (DINUM, behind annuaire-entreprises.data.gouv.fr), built on INSEE Sirene and the national business register. BODACC, the official gazette of commercial notices (insolvency judgments, deregistrations, accounts filings), published by DILA on OpenDataSoft. The result is mcp-french-company-data: about 460 lines of Python across two modules, three read-only tools, stdio transport, MIT licence. This post covers the choices that mattered: which tools to expose, how the schemas are built, how errors reach the model, how it's tested, and what it can't do. The tempting design is one tool per API endpoint. I went the other way and started from the questions a user actually asks: "What's the SIREN of X?" → search_companies "Tell me everything public about this company" → get_company "Is it in trouble?" → get_bodacc_announcements Three tools with clear, non-overlapping names are easier for a model to choose between than ten thin wrappers. The server also ships an instructions string that tells the model how they chain together: mcp = MCPServer( name="french-company-data", version=__version__, instructions=( "Look up French companies in official open data. Use search_companies to find a " "SIREN from a name, get_company for the full profile, and get_bodacc_announcements " "for legal notices (insolvency, deregistration, accounts filing, changes). " "Data is public and may lag the registries by a few days; always cite the source URL." ), ) The other big choice was what not to return. The search API can include company officers (names, birth month

DevIA
Interesse
dev.to

How I scrape any website in under 5 minutes (Python + Playwright)

python, webdev, tutorial, automation "Here's how to grab a title with BeautifulSoup." Twenty lines of Python. Works on the demo page. Fails on a real website. That bothered me for a long time. Because real websites are messy. They use JavaScript. They block bots. They hide data behind logins. They paginate. They rename their HTML classes every few months and break every script you've written. So instead of writing another "20-line scraper" tutorial, I want to show you what actual production scraping looks like. Not the theory — the workflow I use for real client jobs. What most tutorials skip Step one is an audit. I check the site first. Is it static HTML or JavaScript-rendered? Does it have clear repeating elements like product cards? Does it paginate cleanly? Does robots.txt allow scraping? If I skip this step, I waste hours trying to scrape a site that was never going to work. Five minutes of auditing saves five hours of frustration. Building the audit as a tool Here's what my tool does when I run it: bash Fetches the page using the same fetch strategy I use for scraping (static HTTP first, Playwright second) Checks robots.txt Auto-detects the repeating card block using heuristics Fingerprints the CMS (Shopify, WooCommerce, WordPress, Magento) Prints a verdict: green, yellow, orange, or red Green means I can quote the job today. Red means I politely decline. That one step — automating the audit — saved me more time than any scraper I've written. The actual scraping bash https://shop.example.com/products --preset shopify --max-pages 50 --format csv,json,sqlite Fetches all 50 pages automatically by following the "Next" link Uses the WooCommerce preset to find the right fields (title, price, image, link) Handles the pagination URL changes Merges items into one dataset Writes CSV, JSON, and SQLite files Total time: two minutes. For a 1,000-product catalog. What production scraping actually means Here's what I deliver for every scraping job — no exceptions: Clean CSV,

Dev
Interesse
dev.to

Migrate vue-select to a Vue 3 compatible library

vue-select's stable release (3.20.4) is Vue 2 only. The Vue 3 version has been at 4.0.0-beta.6 since November 2022. If it's one of the things holding back your Vue 3 upgrade, you can replace it before the upgrade. Swap it while you're still on 2.7, then upgrade Vue later without touching your selects again. This walkthrough uses Vue Pick, which runs on both 2.7 and 3 with the same props. npm install vue-pick // main.js, in place of "vue-select/dist/vue-select.css" import "vue-pick/style.css" import { VPick } from "vue-pick/vue2" // while on Vue 2.7 import { VPick } from "vue-pick" // after the upgrade When you move to Vue 3, that import path is the only line that changes. This is the step that causes bugs if you skip it. vue-select puts the whole option object in v-model, unless you pass reduce. If you use reduce, name the field with value-key: c.id" /> If you don't, add value-format="object" so your data keeps the same shape: vue-select is searchable and clearable by default. Vue Pick isn't, which is why both examples above add searchable clearable. In multiple mode, Vue Pick also stays open after each pick. Add :close-on-select="true" if you want the old behavior. Plain string options like ["Apple", "Banana"] need to become objects once: const options = fruits.map((f) => ({ label: f, value: f })) v-model still holds the plain string. The full prop, event and slot mapping is in the vue-select migration guide. The page also has a prompt you can paste into Claude Code, Cursor or Copilot. It points the agent at a plain-text copy of the guide and leaves a TODO wherever there's no match, instead of guessing. If you wrap vue-select in your own component, migrate the wrapper first. Every page that uses it moves over at once.

Dev
Interesse