AI 资讯
AI人工智能最新资讯、模型发布、研究进展
共 15373 篇 · 第 550/769 页
The Normalization of Deviance in AI
Why an encrypted config backup breaks when you move servers — and how I fixed it in laravel-config-backup
Imagine you write a letter in a secret code that only your old house key can read. Then you move. You photocopy the coded letter, carry it to the new house… and realise the new key can't decode any of it. The letter is valid, just useless. That's effectively what happens when you back up encrypted values from a Laravel database and restore them onto a different server. I hit exactly this while working on laravel-config-backup today, so here's the problem and the fix. The real cause: Crypt is bound to APP_KEY When you store sensitive settings (think API tokens or OAuth secrets) in the database, you typically encrypt them with Crypt::encryptString() . Lovely — until you remember Crypt uses your app's APP_KEY as the key. A naive backup copies that ciphertext straight across: // Naive approach — move the ciphertext as-is $value = DB :: table ( 'settings' ) -> where ( 'key' , 'some.secret' ) -> value ( 'value' ); // this value is encrypted with the OLD server's APP_KEY The new server has a different APP_KEY . Try to decrypt → DecryptException: The payload is invalid . Your backup is technically complete but practically dead. The fix: decrypt on the way out, re-encrypt on the way in The decision is easy to state, hard to stay disciplined about: never carry ciphertext across a server boundary. Instead — On create : decrypt the values with the source server's APP_KEY , store plaintext inside the archive. Protect that archive with AES-256 and a password (a human-held secret, not the APP_KEY). On restore : re-encrypt the values with the destination server's APP_KEY before writing to the DB. Back to the analogy: you decode the letter, carry the plain letter in a locked briefcase (the password-protected archive), and re-encode it with the new house's lock on arrival. The briefcase handles security in transit — not the old code that's no longer relevant. I made that intent explicit right where the behaviour lives, in ConfigBackupService : /** * Config Backup & Restore. * * Bundl
Shipping a Livewire 4 + Flux admin UI inside a package: four gotchas that 500'd on me
Bundling an admin UI inside a Laravel package is a different game from building one in an app. The app's conveniences — a compiled Vite manifest, a registered layout, your own Livewire components — aren't there. Today, getting the bundled admin UI in laravel-config-webhook to actually render meant walking through four separate 500s. Each one is a small, sharp lesson about the boundary between a package and its host app. 1. A Livewire 4 component name can't contain :: I registered the component with a namespaced-looking name and got a ComponentNotFoundException at runtime. The cause is subtle: under Livewire 4, a name containing :: triggers namespace resolution that ignores singly-registered components. So a "nice looking" name silently routes to a lookup that will never find it. The fix is to register a plain, dotted name: // ❌ looks tidy, but the "::" sends Livewire down a namespace path Livewire :: component ( 'config-webhook::webhooks' , Webhooks :: class ); // ✅ a flat dotted name resolves to the singly-registered component Livewire :: component ( 'config-webhook.webhooks' , Webhooks :: class ); Lesson: in a package, treat the component name as an identifier with framework-reserved characters — :: is not yours to use. 2. Flux ships Heroicons, not Pro/Lucide names The free tier of Flux ships Heroicons . Reach for a Pro-only or Lucide-style name and it throws at runtime. I'd used webhook , ellipsis , and list ; the free equivalents are bolt , ellipsis-horizontal , and queue-list . This is the same trap that bit my SSO package — which is exactly why I now guard it with a static test that reads the Blade and checks every icon against Flux's actual stub files. (Separate post on that.) If you ship a package UI with Flux, assume free-tier icons only unless you require Pro. 3. Don't @vite host assets that don't exist The bundled fallback layout @vite -d the host app's assets. In a fresh consumer (or the package's own workbench) there's no compiled manifest, so you get a
A test that catches the bug your feature tests can't see
There's a class of bug that's maddening: it passes every test you have, then crashes in the user's face. I hit one in the admin UI of laravel-config-sso today, and the real fix wasn't changing an icon name — it was writing a test that could see the bug in the first place. The bug: wrong icon name, crashes only at runtime The admin UI uses Flux . Flux resolves icons through <flux:delegate-component> , and it throws for a name that doesn't exist: Flux component [icon.ellipsis] does not exist. It's an easy mistake. Flux ships Heroicons , not Lucide. So your Lucide reflexes lie to you: You type (Lucide) Flux wants (Heroicon) ellipsis ellipsis-horizontal trash-2 trash eye-off eye-slash Why feature tests don't catch it Here's the interesting part. I had a feature test that hits the admin route and asserts 200. Green. But the real UI crashes. How? Because in the headless test harness, Flux renders icons as no-ops. No real <flux:delegate-component> boots, so the icon name never gets resolved. The crash only surfaces under a full boot ( testbench serve ) — exactly where your automated tests don't go. Analogy: it's like a spell-checker that only runs when you print the document, not while you type. Your tests type away happily. The crash waits at the printer. The fix: a static test that reads the Blade and validates every icon Instead of relying on runtime, I wrote a Pest test that reads the Blade view, extracts every icon name (static and inside dynamic expressions), and asserts Flux actually ships a stub for each one: $fluxIconStubs = base_path ( 'vendor/livewire/flux/stubs/resources/views/flux/icon' ); it ( 'only references Flux icons that exist' , function () use ( $fluxIconStubs ) { expect ( is_dir ( $fluxIconStubs )) -> toBeTrue ( "Flux icon stubs not found" ); $view = file_get_contents ( __DIR__ . '/../../resources/views/livewire/sso-providers.blade.php' ); // Static `icon="name"` plus quoted tokens inside dynamic // `icon="{{ $cond ? 'eye-slash' : 'eye' }}"` expressio
Making encrypted Laravel config backups portable across APP_KEYs
Here's a fun one. You build a package that backs up an app's config — the .env plus the settings stored encrypted in the database — into a single password-protected ZIP. The whole selling point is portability : take a backup on server A, restore it on server B, even when the two servers have different APP_KEY s. Then you write a test that actually changes the key during a restore, and it fails. The DB settings come back garbled. Turns out the bug wasn't in the encryption at all. It was in a cache I forgot was there. Today I shipped 1.1.0 of laravel-config-backup and this portability fix was the headline. Let me walk through it, because the lesson generalizes way beyond this package. Why APP_KEY portability is even a thing Laravel encrypts things with APP_KEY . Encrypted Eloquent casts, signed cookies, sessions — all of it keys off that value. So if you naively mysqldump a table with encrypted columns and load it onto another server, every encrypted column is now ciphertext that the new key can't decrypt. Dead data. The trick this package uses is to store the archive contents decrypted . When I export the database, rows go out through their casts , so an encrypted column becomes a plain value inside the ZIP (the ZIP itself is AES-256 password-encrypted, so it's not sitting around in plaintext). On import, each row is written back through the model , which means the cast re-encrypts it with whatever APP_KEY is active on the destination. Server A (key A) Archive (decrypted) Server B (key B) ──────────────── ─────────────────── ──────────────── settings.payload ──decrypt──▶ "Portable" ──import──▶ settings.payload (ciphertext A) (cast) (cast) (ciphertext B) Think of it like shipping furniture: you don't ship the assembled wardrobe through a doorway it doesn't fit, you flat-pack it and reassemble at the destination with the screws you have there. The restore sequence A restore that also brings a new .env has to be careful about ordering . Here's the real flow: public func
AI Observability: Logs, Prompts, Tool Calls, And Cost
Here's a five-line function. It calls an LLM, logs the answer, returns it. async function ask ( question : string ) { const res = await openai . responses . create ({ model : " o4-mini " , input : question }); console . log ( " answer: " , res . output_text ); return res . output_text ; } This compiles. It passes tests. It ships. And it will quietly cost you four figures a month before anyone notices, because nothing in that log tells you the model burned 8,000 hidden reasoning tokens to produce a 40-token reply. That's the gap this article is about. AI calls are not regular HTTP calls. The interesting state isn't the response body - it's the messages you sent, the tools the model picked, the tokens it consumed (visible and otherwise), and the dollars that drained out of the budget. If your observability story is "we log the answer," you're flying a plane with one gauge and that gauge is the altimeter. Let's talk about what to actually capture. The four signals that matter Every AI system has the same four dimensions worth instrumenting, and most teams only track one or two of them: Logs - the request/response pair, the error, the latency. The boring stuff that traditional APM already covers. Prompts - the actual text that went in and the actual text that came out. Including system prompts, tool definitions, and history. Tool calls - which tool the model picked, with what arguments, what came back, in what order, with what retries. Cost - input tokens, output tokens, cached tokens, reasoning tokens, model, and the per-million-token price for each. Multiplied per user, per feature, per request. Lose any one of these and you're working blind on a different axis of the problem. Lose the cost signal and you wake up to a Slack message from finance. Lose the tool-call signal and you can't tell why your agent kept booking the wrong flight. Lose the prompt signal and a prod regression becomes a guessing game. Lose plain logs and you don't even know the call happened. The go
Because in a Life-Threatening Situation, Every Millisecond Counts
Removing expf() from a fire detector: one header, 1.95x faster, zero accuracy loss A smoke detector is not a demo project. When it fires, someone either evacuates in time or doesn't. The firmware running on that microcontroller has one job, and it needs to do it without hesitation, without bloat, and without dependencies that can fail in unexpected ways. Last May 28th I published a bare-metal fire detection system built with Hasaki 刃先 — a neural network trainer that exports standalone C headers with no runtime, no Python, no TensorFlow. The model is a 12-8-4-1 MLP trained on 28,596 sensor readings. It fits in 3.8 kB of Flash and achieves 99.93% accuracy on held-out data, with a single missed fire event out of 3,599. But there was something in that header that bothered me. static inline float sigmoid ( float x ) { return 1 . 0 f / ( 1 . 0 f + expf ( - x )); } expf() . Right there in a life-safety application. On a microcontroller that may not have a hardware FPU. The problem with expf() on bare metal On processors with a hardware FPU — like the ESP32-C3 — expf() is fast. But the moment you deploy to an ATmega328P, an ATtiny85, or any Cortex-M0 target, that call becomes software floating-point. The CPU has to simulate the operation in firmware, cycle by cycle. It works. But it carries hidden cost: unpredictable latency, dependency on math.h , and a transcendental function sitting in the critical path of every single inference. For a smoke detector running at 1 Hz this might seem irrelevant. But inference latency compounds with sensor reads, normalization, and communication overhead. And more importantly — if you're deploying to a truly constrained target, expf() might be the difference between fitting in Flash or not. The fix: one header from kigu-quant kigu-quant(comming soon) is a new tool in the Rosito Bench ecosystem. It generates ready-to-include C headers for evaluating mathematical functions on microcontrollers — no FPU, no libm, no dependencies. One command: k
Parallel AI Coding with Git Worktrees: Run Multiple Agents Without Conflicts
Parallel AI Coding with Git Worktrees: Run Multiple Agents Without Conflicts Most parallel AI development problems stem from a single architectural mistake: multiple agents sharing the same working directory. Teams spin up three Claude Code instances, point them at the same project folder, and watch as file writes collide, branch checkouts interrupt each other, and lock files corrupt. The symptom looks like a race condition. The root cause is filesystem design. Git worktrees solve this by giving each agent its own isolated working directory while sharing a single .git repository. This distinction is critical. Developers get parallel execution without the storage overhead of full clones, and agents operate on separate branches without stepping on each other's file handles. The pattern has existed since Git 2.5, but AI coding workflows finally make it essential infrastructure. The Collision Problem: Why Multiple AI Agents Can't Share a Working Directory When you run git checkout feature-A in a directory where another process is reading files, the filesystem state changes underneath that reader. The other process doesn't see atomic transitions—it sees partial writes, missing files, and inconsistent dependency graphs. TypeScript compilers fail with "Cannot find module" errors. Dev servers crash because watched files disappeared mid-read. Lock files from package managers become corrupted when two agents run npm install simultaneously on different branches with different dependency trees. The obvious solution—staggering agent execution so only one runs at a time—defeats the purpose of parallel development. Teams that try this pattern end up with AI agents waiting in queue, each one blocking the next until it finishes. The bottleneck shifts from human typing speed to serial execution, and the productivity gains evaporate. Full repository clones work but waste disk space. A 2GB monorepo cloned five times for five agents consumes 10GB of redundant Git objects. Sparse checkou
Bob's CLI
A local-first AI coding CLI that adapts to you Discussion | Link
MCP Java SDK – Build Model Context Protocol servers in Java
Hi HN, I built an open-source Java SDK for building Model Context Protocol servers: https://github.com/6000fish/mcp-java It is intended for Java developers who want to expose tools, resources, or prompts to MCP-compatible agents without implementing the protocol plumbing from scratch. The project includes: Core MCP server SDK stdio transport SSE transport Java API and annotation-based tool registration Spring Boot starter 5-minute quick-start example Copyable custom server template Ready-to-use MySQL and Redis MCP servers The SDK is available on Maven Central: <dependency> <groupId> io.github.6000fish </groupId> <artifactId> mcp-sdk </artifactId> <version> 0.1.1 </version> </dependency> <dependency> <groupId> io.github.6000fish </groupId> <artifactId> mcp-spring-boot-starter </artifactId> <version> 0.1.1 </version> </dependency> The MySQL and Redis servers are local stdio MCP servers, because database/cache connectors are usually safer to run inside the user's own environment instead of exposing credentials to a hosted remote endpoint. GitHub: https://github.com/6000fish/mcp-java Release: https://github.com/6000fish/mcp-java/releases/tag/v0.1.1 Feedback is welcome.
How I Built a Prompt-to-Music AI Agent & Browser-Based Karaoke Separator with React & ONNX
Tags: react , webdev , onnx , audio Introduction Music generation, vocal separation, and intelligent arrangement have traditionally been server-side tasks requiring complex pipelines and expensive GPU clusters. But what if we could bring the entire interactive music-creation experience—both real-time preview , offline export , prompt-based AI music generation , and local Karaoke processing —directly into the browser? In this post, I'll share how I built AI Groove Pad , a client-side React and Tone.js application featuring: A Prompt-to-Music AI Agent: Enter any prompt (e.g., "Create an energetic Tamil Kuthu beat with a driving bassline and a Nadaswaram melody" ), and the agent composes and adds the tracks directly to the arrangement. A Client-Side Karaoke Separator: Runs a local neural network with 84% accuracy using ONNX Runtime Web to separate vocals and accompaniment locally. 3. High-Performance Audio Engine: Tone.js scheduling, synth fallbacks, and real-time playback. The Tech Stack Frontend UI: React + TypeScript + Tailwind CSS for a premium, glassmorphic dark-mode interface. Audio Engine: Tone.js v15 (built on top of the Web Audio API) for sample playback, precise timing scheduling, and synthesis. Client-Side AI: ONNX Runtime Web ( onnxruntime-web ) executing a local neural network with 84% accuracy for vocal/accompaniment separation (Karaoke mode). AI Music Agent: A natural language agent interface that takes user prompts to compose midi sequences, beats, harmony, and arrangements in real-time. * Offline Rendering: OfflineAudioContext for high-speed, non-realtime rendering of arrangements straight to .wav files. 🤖 The Prompt-to-Music AI Agent With AI Groove Pad , users don't need to be music theory experts. They simply write what they want to hear. The AI Agent interprets the prompt and generates a multi-track composition containing: Groove & Beats: Automatically maps drum samples and rhythmic patterns (e.g. Parai drum, Pambai hits for Kuthu). Melody & Harmony
KTransformers的5个隐藏用法,17K Star的MoE推理框架背后没写在README里的能力
你知道吗?2026 年中期,在生产环境部署 671B 参数的 DeepSeek-R1 仍然需要 8 张 H100,硬件成本约 20 万美元。但清华大学 MADSys 实验室的开源项目早在 2024 年就能在单台工作站上跑 236B 参数 MoE 模型,2025 年 2 月甚至在普通硬件上实现了 671B DeepSeek-R1 286 tokens/s 的 Prefill 速度。这个项目就是 kvcache-ai/ktransformers,截至 2026-06-12 已有 17,264 Stars、1,313 Forks、Apache-2.0 协议。2026 年的 AI 基础设施叙事被 NVIDIA 机架级系统和越来越贵的显存账单主导。KTransformers 是一条被严重低估的反击路线:它让你在消费级 GPU 和 CPU 内存的混合硬件上跑前沿 MoE 模型,而且提供了五个几乎没人讨论的生产级技巧。 背景:2026 年为什么 CPU/GPU 混合推理至关重要 2026 年,混合专家(Mixture-of-Experts,MoE)已经成为前沿开源模型的默认架构。DeepSeek-V3/R1、Qwen3-235B-A22B、Kimi-K2.5、GLM-4.7 以及最新的 DeepSeek-V4-Flash 全是 MoE。直觉上 MoE 推理仍然需要 H100 级 GPU,因为每个 token 只激活少量专家,活跃参数量虽小,但总参数量巨大(DeepSeek-R1 671B,Kimi-K2.5 上万亿)。CPU-GPU 混合方案把"冷"专家放在 CPU 内存,把"热"专家留在 GPU。KTransformers 把这个想法变成一个生产级框架,截至 v0.6.2(2026-05-03 发布)已支持 9 种不同的 MoE 模型。2026 年 ACM SIGOPS 论文《KTransformers: Unleashing the Full Potential of CPU/GPU Hybrid Inference for MoE Models》正式发表了这一架构。 隐藏用法 #1:基于频率感知的 CPU-GPU 专家调度 大多数人的做法: 把 GPU 当黑盒,试图把整个 MoE 模型塞进显存。模型太大时,要么买更多 GPU,要么换更小的模型。 隐藏技巧: KTransformers 通过 --kt-expert-placement-strategy 标志暴露四种显式专家放置策略。 frequency 策略会记录专家激活统计信息,然后把 最常被激活的专家 放在 GPU,把冷专家留在 CPU 内存。配合 --kt-enable-dynamic-expert-update 还能在运行时根据 prefill token 数重新分配专家。 # 启动频率感知放置的服务 python -m sglang.launch_server \ --model /path/to/qwen3-next-80b \ --kt-num-gpu-experts 8 \ --kt-expert-placement-strategy frequency \ --init-expert-location /path/to/activation_stats.pt # 长上下文场景下加入动态再分配 python -m sglang.launch_server \ --model /path/to/qwen3-next-80b \ --kt-num-gpu-experts 8 \ --kt-expert-placement-strategy frequency \ --init-expert-location /path/to/activation_stats.pt \ --kt-enable-dynamic-expert-update \ --kt-gpu-prefill-token-threshold 512 效果: 在 Qwen3-Next-80B-A3B-Instruct-FP8 + 4 张 RTX 4090 + Intel Xeon Gold 6454S 的官方基准测试中,50% GPU 专家比例下, frequency 策略达到 76.19 tokens/s, dynamic-expert-update 进一步推到 81.17 tokens/s(对比默认 uniform 策略的 65.25 tokens/s)。80% GPU 比例时,frequency 策略冲到 100.67 tokens/s。 数据来源: kvcache-ai/ktransformers GitHub 17,264 Stars、1,313 Forks、Apache-2.0 协议,2026-06-
KTransformers: 5 Hidden Uses of the 17K-Star MoE Inference Stack from Tsinghua That 90% of AI Infra Teams Miss in 2026
Here's a fact that should stop every AI infrastructure engineer in their tracks: as of mid-2026, the de facto standard for serving a 671B DeepSeek-R1 model in production still requires 8x H100 GPUs and roughly $200,000 of hardware . Meanwhile, an open-source project from MADSys Lab at Tsinghua University has been quietly running 236B-parameter MoE models on a single workstation since 2024, and hit 286 tokens/s prefill on DeepSeek-R1 671B on commodity hardware. That project is kvcache-ai/ktransformers , and as of 2026-06-12 it has 17,264 Stars, 1,313 Forks, and an Apache-2.0 license. The 2026 AI infrastructure conversation has been dominated by NVIDIA rack-scale systems and the ever-growing VRAM bill. KTransformers is the open-source counter-narrative: it lets you run frontier-class MoE models on a mix of consumer GPUs and CPU RAM, and it does this with five production-grade techniques that almost nobody talks about. Context: Why CPU/GPU Hybrid Inference Matters in 2026 In 2026, Mixture-of-Experts (MoE) has become the default architecture for frontier open-weight models. DeepSeek-V3/R1, Qwen3-235B-A22B, Kimi-K2.5, GLM-4.7, and the new DeepSeek-V4-Flash are all MoE. The naive assumption is that MoE inference still needs H100-class GPUs because each token only activates a few experts, so the active parameter count is small, but the total parameter count is enormous (671B for DeepSeek-R1, 1T for Kimi-K2.5). The CPU-GPU hybrid approach moves the "cold" experts to CPU RAM and keeps the "hot" experts on the GPU. KTransformers has turned this idea into a production framework that supports nine different MoE models as of v0.6.2 (released 2026-05-03). The 2026 ACM SIGOPS paper "KTransformers: Unleashing the Full Potential of CPU/GPU Hybrid Inference for MoE Models" formally published the architecture. Hidden Use #1: CPU-GPU Expert Scheduling with Frequency-Aware Placement What most people do: They treat the GPU as a black box and try to fit the entire MoE model into VRAM. Whe
Why Your AI Engineer Hire Costs 56% More Than You Budgeted
The Budget You Approved Isn't the Budget You'll Pay You approved $180K for a senior AI engineer. Eighteen months later, you've spent $282K and you're still not sure the hire is working out. This isn't unusual. It's the rule. Companies hiring AI engineers for the first time routinely underestimate total cost by 40–60%. Here's a breakdown of where that gap comes from — and why most founders don't see it until it's too late. The 56% Gap: Where It Comes From 1. Recruiting Costs Are Higher Than You Think (~12–18% of first-year salary) AI engineer recruiting isn't like standard software recruiting. Specialized headhunters charge 20–25% of first-year salary. Even if you find someone through your network, you'll spend founder or VP time on 15–30 hours of interviewing, plus take-home evals that the best candidates increasingly decline. If you use a staffing firm, add the markup. If you DIY it, add the opportunity cost. Typical recruiting overhead: $22,000–$40,000 per hire 2. Onboarding Takes Longer for AI Roles (~2–3 months of ramp) An AI engineer hired to build production agent systems isn't productive on day 1. They need to understand your domain, your data, your existing architecture, and your risk tolerance for AI-generated outputs. The ramp is real — most teams see 60–90 days before meaningful output. At $180K salary, two months of ramp is $30,000 in salary with limited ROI. Add engineering time for mentoring (typically 20% of a senior engineer's time during ramp), and you're adding another $15,000–$20,000. Ramp cost: $30,000–$50,000 3. Infrastructure Spend Scales With Experiments AI engineers experiment. That's the job. Every experiment has a GPU bill, an API bill, and a storage bill. Early-stage teams routinely see $3,000–$8,000/month in AI infrastructure spend once they've hired their first AI engineer — much of it from exploratory work that doesn't ship. Over a year: $36,000–$96,000 in infra costs that weren't in the original headcount budget 4. Tooling and Data Cos
Fylun.ai – All-in-one AI workspace (chat, notes, apps, automation, search)
AI isn't making developers more productive – it's making them busier
Perfai Security
Find & fix live vulnerabilities in Vibe Apps with 1-prompt. Discussion | Link
Theker just raised $85M to build the factory robot that doesn’t specialize in anything
Unlike humanoid robots designed around a fixed form — think Boston Dynamics — Theker's machines are built to be reconfigured.
Human in the Love
The world's first MCP dating app inside Claude. Discussion | Link