今日已更新 227 条资讯 | 累计 26210 条内容
关于我们

标签:#ai

找到 4659 篇相关文章

AI 资讯

The Technology Behind Viral AI Image Generators

Scroll through social media today, and you'll likely come across AI-generated images everywhere. From anime-style portraits and fantasy landscapes to hyper-realistic photographs of places that don't even exist, AI image generators have quickly become one of the most fascinating applications of artificial intelligence. What makes this technology so impressive is its accessibility. A few years ago, creating professional-quality artwork required design skills, expensive software, and hours of effort. Today, anyone can generate stunning visuals simply by typing a few words. But what actually happens behind the scenes when you enter a prompt and click "Generate"? Turning Ideas into Images At a basic level, AI image generators convert text into visuals. When a user enters a prompt such as: "A futuristic Mumbai skyline at sunset with flying cars" the AI doesn't search for an existing image online. Instead, it creates a completely new image based on patterns it learned during training. These models are trained using millions of image-text pairs, allowing them to understand concepts such as objects, colors, lighting, artistic styles, and even relationships between different elements within a scene. As a result, the AI can interpret the user's description and transform it into a visual representation. Starting with Random Noise One of the most interesting aspects of modern AI image generation is that the process usually begins with random noise. Imagine the static pattern seen on an old television screen. Initially, the AI starts with something similarly meaningless. It then gradually removes the noise while adding details that match the prompt. This process is known as a diffusion model , and it is the foundation of many modern AI image generators. To understand the idea, consider the following simple Python example: import random prompt = " A futuristic Mumbai skyline at sunset " noise_level = random . randint ( 1 , 100 ) print ( f " Prompt: { prompt } " ) print ( f " Start

2026-06-01 原文 →
AI 资讯

I open-sourced a modern acts_as_tenant alternative for Rails 7+

--- title : " Introducing rails-tenantify: Row-Level Multi-Tenancy for Rails 7+" published : true description : " A modern, safe, and robust row-level multi-tenancy gem for Ruby on Rails. Prevent data leaks, protect bulk writes, and preserve tenant context in background jobs." tags : rails, ruby, opensource, saas --- ## The Problem Every multi-tenant SaaS app eventually needs to answer the same questions: * How do we make sure School A never sees School B's data? * How do we scope every query to the right organization? * How do we keep tenant context alive in background jobs and Sidekiq retries? * How do we stop a careless `update_all` from wiping another tenant's rows? The typical answer is *"use acts_as_tenant"* or *"switch to Apartment."* But in modern Rails development, that often means: * Fighting unmaintained APIs on Rails 7+ * Losing tenant context when a background job retries * Dealing with schema-per-tenant complexity (Apartment) and heavy DevOps overhead * Rolling your own `default_scope` and crossing your fingers that nobody calls `unscoped` For most Rails apps, you just need **row-level tenancy** : one database, one `organization_id` column, and strict scoping. The pattern is simple. Getting it **safe** in production is not. --- ## What I Built **`rails-tenantify`** is a Ruby gem that adds row-level multi-tenancy directly to your Rails models and controllers. No external services, no extra databases per tenant—just your own PostgreSQL (or SQLite in dev). ruby class Project < ApplicationRecord include Tenantify::Scoped belongs_to_tenant :organization end ### Set the tenant once per request ruby class ApplicationController < ActionController::Base set_tenant_by :subdomain # acme.yourapp.com → Organization end ### Everything scopes automatically ruby Tenantify.current_tenant = current_organization Project.all # Only this org's projects Project.create!(name: "Q2 Roadmap") # organization_id is set automatically ### Switch context safely for admins or scripts

2026-06-01 原文 →
AI 资讯

LLM integration with OpenAI Responses API

Large language models (LLMs) understand and generate text from prompts. OpenAI exposes models through the Responses API . The official openai npm package is the practical way to call it from Node.js. This post covers common patterns beyond a single prompt string. Prerequisites OpenAI account Generated API key Enabled billing Node.js version 26 openai package installed ( npm i openai ) For Markdown output: marked , dompurify , and jsdom ( npm i marked dompurify jsdom ) Client setup Create a client with your API key (read from the environment in production). import OpenAI from ' openai ' ; const client = new OpenAI ({ apiKey : process . env . OPENAI_API_KEY }); The same SDK can target other hosts that implement a compatible API by setting baseURL and apiKey : const client = new OpenAI ({ apiKey : process . env . LLM_API_KEY , baseURL : ' https://your-gateway.example/v1 ' , }); Azure OpenAI uses AzureOpenAI instead. Many third-party gateways support Chat Completions only; the examples below use client.responses.* , so confirm your provider supports the Responses API (especially for tools like web search). Basic integration Pass a string as input and read output_text from the response. const response = await client . responses . create ({ model : ' gpt-5.5 ' , input : ' Write a one-sentence bedtime story about a unicorn. ' , }); console . log ( response . output_text ); System prompt Use top-level instructions for stable behavior (tone, format, role). They take precedence over casual wording in the user message. const response = await client . responses . create ({ model : ' gpt-5.5 ' , instructions : ' Reply in one short sentence. Use plain language. ' , input : ' Explain what an LLM is. ' , }); console . log ( response . output_text ); Few-shot prompting Pass prior turns as an input array with user and assistant roles, then the new user message. Keep task rules in instructions . const response = await client . responses . create ({ model : ' gpt-5.5 ' , instructions :

2026-06-01 原文 →
AI 资讯

Device Code Flow: The Overlooked Phishing Vector (And How to Block It)

Device Code Flow abuse is not a new technique. Security teams have known for some time that this OAuth feature can be leveraged in phishing attacks to obtain tokens without stealing credentials. What is new is how accessible and scalable this attack has become. In April 2026, the FBI warned about a Phishing-as-a-Service (PhaaS) platform called Kali365, which operationalizes this exact technique. It allows even low-skilled attackers to run campaigns that trick users into entering device codes on legitimate Microsoft login pages — ultimately granting attackers OAuth tokens and acess to Microsoft 365 environments without triggering traditional authentication defenses. How Device Code Flow Works Device code flow is an authentication method designed for scenarios where a device has limited input options or lacks a convenient browser interface (such as smart TVs, IoT devices, or command-line tools). Instead of entering credentials directly on the device, the application generates a verification code and displays it. The user then switches to a secondary device (such as a laptop or smartphone), navigates to https://microsoft.com/devicelogin , and enters the provided code. After successfully authenticating, the identity provider securely links the session and grants the original device access to the requested resource. Why Device Code Flow Should Be Restricted In practice, many organizations don’t have a real or current business need for device code flow, yet leave it enabled—unnecessarily expanding their attack surface. Disabling it helps reduce exposure by removing a legacy or rarely used authentication path and reinforces modern controls. Microsoft recommends getting as close as possible to a full block. Start by auditing existing usage, validate whether any legitimate scenarios still require it, and strictly limit access only to well-defined, secured, and documented use cases (e.g., specific legacy tools). In all other cases, device code flow should be disabled by defau

2026-06-01 原文 →
AI 资讯

Self-Review With AI Before You Open the PR — A Practical Workflow with branchdiff

You know the moment. You push the branch, open the PR, and immediately see it — the undefined return on the refund path, the token logged to the console, the TODO that was supposed to be temporary six weeks ago. The reviewer catches it four hours later and you reply "good catch, fixing now" as if someone else wrote that line. The first reviewer on most pull requests should have been the author. Half the comments you will receive — the missing null check, the untested error branch, the duplicate logic that could be extracted, the import that now goes nowhere — are things you would have caught with one more careful read-through. You skip that read because you have been in the code for two days and your brain completes the sentences for you. You see what you meant to write, not what is on the page. This post is about closing that gap with a structured AI-assisted self-review before the PR opens. Not to skip the human reviewer — to walk into the review with the obvious problems already gone, the test gaps already filled, and the PR description already written. So the reviewer's attention can land on what actually needs a second pair of eyes. The tool is branchdiff : a local browser app that runs your diff on localhost , stores everything in ~/.branchdiff/ , and keeps the AI surface controlled through an explicit branchdiff agent command API. Nothing leaves your machine until you decide to push it. Why "before the PR" is the right moment If you review after opening the PR, every AI fix becomes noise: a force-push, a re-read for your reviewer, another commit in the audit trail. If a teammate is already mid-review when you discover the bug, you look careless. The patch that should have been in the original push becomes a distraction for everyone downstream. If you review before opening the PR, the AI's output is a private workspace. You act on what matters, commit the fixes into your own history (often as fixup! commits you squash before pushing), and the PR that goes up i

2026-06-01 原文 →
AI 资讯

Summer Game Fest 2026: All the news from gaming’s busiest week

Get ready for some gaming news. It’s officially June, which means splashy new events from PlayStation, Xbox, and gaming hype man Geoff Keighley. But this season doesn’t just feature the big tentpole shows; there will be a bunch of smaller events, too, and they might feature some promising games as well. But this year’s events […]

2026-06-01 原文 →
AI 资讯

Your guide to June’s biggest gaming events

It's early June, which means it's video game event season once again. Now that E3 has been gone for a few years, a bunch of showcases and presentations have started to fill the void, including big productions like Summer Game Fest Live and smaller affairs like Wholesome Games Direct. If you love following gaming news, […]

2026-06-01 原文 →
AI 资讯

Microsoft to unveil new AI models and Windows improvements at Build

Microsoft is heading to San Francisco this week in a bid to win back developers at its Build conference. I've been attending Build since the days when Microsoft called it the Professional Developers Conference, and I can't remember a more pivotal moment. As Microsoft continues to reshuffle its entire business around AI, it's moving Build […]

2026-06-01 原文 →
AI 资讯

AI is blowing up music. How should the Grammys handle it?

Today I’m talking with Harvey Mason Jr., who is CEO of the Recording Academy — that’s the outfit that puts on the Grammy Awards. I last talked to Harvey in 2024, when it was obvious that generative AI would upend the music industry, but still not exactly clear how that would happen. Well, it’s been […]

2026-06-01 原文 →
开发者

Xbox and PlayStation have a lot to prove

Things are bad out there. Despite 2026 shaping up to be a great year when it comes to actual games, it couldn't really be worse for the people that make them or the industry as a whole. Hardware prices keep going up, layoffs have shown no signs of stopping, and even big-budget titles backed by […]

2026-06-01 原文 →
AI 资讯

Auto-Generated CUDA Kernels Need Kernel-Level Validation

An LLM-written kernel benchmarked 38% faster on a microbench. Here is what kernel-level validation showed it actually did at runtime. TL;DR Multi-agent LLMs are now writing CUDA kernels (RightNow AI’s AutoKernel, Meta’s KernelEvolve, a multi-agent system claiming 38% speedup on Blackwell). Source-level benchmarks measure clean throughput on a single isolated kernel. They do not measure SM occupancy under co-scheduling, DRAM bandwidth saturation, dispatcher off-CPU during a real serving workload, or NCCL wait correlation with sibling kernels. Kernel-level validation closes that gap: an eBPF trace of the same kernel running under the same workload as production answers all four questions in one capture. The kernel-writing wave Three pieces of work in April surfaced the same pattern: agents generate CUDA kernels, then quote a single throughput number against a baseline. RightNow AI’s AutoKernel (announced Apr 6) – LLM agents iteratively rewrite CUDA kernels for a target metric, claiming substantial speedups on selected microbenchmarks. Meta’s KernelEvolve – similar shape: agents propose kernel variants, rank by throughput, keep the best. Multi-agent system on Blackwell (Apr 29 reports) – claims a 38% speedup on a public kernel benchmark using a coordinated agent setup. All three are real research, all three produce real kernels, and all three report numbers that come from microbenchmarks. The microbench setup is exactly what you want for the optimization loop. It is not what you get in production. What microbenchmarks do not see Run an LLM-generated kernel under nvprof or nsight-compute on an otherwise-idle GPU and the throughput number is real. Put the same kernel in front of a vLLM serving workload and four properties change immediately: SM occupancy under co-scheduling. The kernel that achieves 95% SM occupancy in isolation will achieve 40-50% with three other kernels sharing the same SMs. The optimizer never sees this regime. DRAM bandwidth saturation. A kernel tha

2026-06-01 原文 →
AI 资讯

The loop I didn't notice closing

The loop I didn't notice closing Seven weeks ago I started using AI for work. Two weeks after that, I published an article. Seven weeks after that — today — the article is one of sixteen, and they are all in a memory file that the AI reads at the start of every new conversation. I didn't notice the loop until I named it. This is a note about that loop, what it is, what it isn't, and why I keep publishing even though the loop doesn't strictly need me to. The shape It runs like this: I decide what to do. I work it out with the AI — usually in dialogue, sometimes by pasting raw code or data. The dialogue becomes a record. Sometimes a memory entry. Sometimes a published article. The record becomes context for the next conversation, which informs the next decision. It didn't look this clean while it was happening. The numbering is hindsight. From inside, the steps overlap. The first step is the one I keep. Direction is mine: what to build, what to write, what to negotiate. The history that shapes those decisions — twenty-four years of solo work, my company, my family, my health — is also mine. The AI is not setting direction. The second step is where most of the leverage is. I describe what I want to do as completely as I can, sometimes by handing over source code. Then I ask: does this look right? Is there a path I'm missing? Where would this break? I'm opening drawers — possibilities I half-saw in my own head — and checking which ones open cleanly. When one opens cleanly, that is the GO signal. Not "will this succeed" but "this is doable, so do it." The third step happens almost without effort. The conversation already exists as text. Some of it becomes a memory entry I add deliberately. Some of it becomes raw material for an article. The article writes itself partly because I have already explained the thing to the AI. The fourth step is the one that took longest to arrive — and the one I want to be most careful about describing. Three phases, not one The loop didn't

2026-06-01 原文 →
AI 资讯

Free Live Webinar: Testing AI Agents in Python for Real-World Reliability

AI agents are getting smarter fast. They can reason through tasks, manage workflows, call tools, and automate decisions across applications. But as these systems become more capable, one challenge becomes impossible to ignore: reliability. How do you know your AI agent is making the right decisions consistently? How do you test workflows that involve memory, reasoning, and multiple execution steps? And how do you debug failures when outputs become unpredictable? That’s exactly what this free live webinar, “ Testing AI Agents in Python: Building Reliable Evals with LangGraph & LangSmith ,” is focused on. The session includes a “ Live demo of the AI agent evaluation pipeline ,” where you’ll see how developers are building structured evaluation workflows using LangGraph and LangSmith to test, trace, and improve AI agent performance in real-world scenarios. Here is the link to register .. Who Should Join This Session? This webinar is designed for developers and technical teams working with AI systems, especially: Python developers building AI agents or LLM workflows AI engineers exploring evaluation and observability Architects designing production-ready AI systems Product teams experimenting with AI automation Founders building intelligent applications faster Whether you’re actively deploying AI agents or still evaluating the ecosystem, this session will give you a clearer understanding of how reliable AI systems are actually built. What You’ll Learn During the Webinar This isn’t a high-level AI trends session. The focus is practical implementation, testing workflows, and evaluation strategies developers can actually use. In this webinar, you’ll learn: Why evaluation matters for modern AI agents How LangGraph helps manage complex agent workflows How LangSmith can trace and monitor agent execution Ways to create repeatable and scalable evaluation pipelines Practical approaches for debugging and improving AI agent behavior See the AI Evaluation Pipeline Live One of the b

2026-06-01 原文 →
AI 资讯

I Spent 2 Months Building a 150+ Tool Website with $0 Server Cost

📚 This is Part 1 (Opening) of the UtlKit Tech Series — Next: [Architecture & Trade-offs →] As a frontend developer, I've used countless online tools. And almost all of them suck: Sign-up required — just to format a JSON string? Ad overload — the actual tool gets squeezed into a corner Privacy concerns — your JSON might contain API keys, and the tool sends it to a server Fragmented — formatters on one site, Base64 on another, hashing on a third So I decided to build one that doesn't: no sign-up, no ads, pure client-side computation, data never leaves the browser. The goal was simple — if I need this tool, someone else does too. The result is utlkit.com : 150+ tools, 8 categories, zero server costs. Requirements Requirement Meaning Pure client-side All logic runs in the browser Zero server cost Static hosting, no Node.js backend 150+ pages One page per tool, SEO-friendly Bilingual (EN/ZH) i18n support Dark/Light mode User preference Mobile responsive Works on all devices Why Not Other Frameworks? Option Pros Cons Verdict Vanilla HTML/JS Simple Managing 150+ pages is painful Too slow VuePress / VitePress Fast Docs-oriented, not for interactive tools Not flexible enough Nuxt SSR Powerful Needs a server Violates zero-cost principle Next.js 15 + output: 'export' SSR SEO + client interactivity + static hosting Has pitfalls (covered later) ✅ Best balance The Key Decision: output: 'export' // next.config.js const nextConfig = { output : ' export ' , // Static export trailingSlash : true , // Required for static files images : { unoptimized : true }, // No image optimization server } This means: ✅ Build output is plain HTML/CSS/JS files ✅ Deployable to any static host (Cloudflare Pages, Vercel, GitHub Pages) ✅ Zero server cost ❌ No API Routes, no Server Components, limited dynamic routing Deployment: Zero Cost on Cloudflare Pages Build output : out/ directory, ~14 MB Hosting : Cloudflare Pages Domain : utlkit.com Monthly cost : $0 Build Pipeline npm run build → next build ( o

2026-06-01 原文 →