AI 资讯
I Built a Free Apache Kafka Course from Scratch — Here's the Full Curriculum (and What I Got Wrong)
I Built a Free Apache Kafka Course from Scratch — Here's the Full Curriculum (and What I Got Wrong) I spent months building a free Apache Kafka course covering everything from first principles to a real-time analytics platform final project. No paywall. No "premium tier." 9 modules, 470 minutes of content, completely free. Here's the full syllabus, the Python code that actually works, and the honest mistakes I made building the curriculum — so you don't repeat them. Why I Built This Every time someone asked me "how do I learn Kafka?", I sent them to the same 3 places: The official Confluent docs (dense, assumes you already know what you're doing) A $15 Udemy course that spends Module 1 explaining what a computer is A YouTube playlist where half the videos are deleted None of them answered the real question beginners have: why does Kafka exist, and what problem does it actually solve before I write a single line of code? That's the gap I built for. The Problem With Most Kafka Tutorials Most tutorials start with: "Kafka is a distributed event streaming platform..." And then they immediately show you a Docker Compose file with 6 services. Beginners copy-paste it, something breaks, they don't know why, they quit. The real problem is that Kafka is an answer to a specific architectural problem — and if you don't understand the problem first, the solution makes no sense. So Module 1 and 2 of this course don't touch Kafka at all. They build the problem statement from scratch. The Full Syllabus (9 Modules, 470 Minutes) Module 1: Introduction to Kafka — 35 min Not "what is Kafka" — but why event streaming exists at all. What breaks in traditional request-response architectures at scale. Module 2: The Problem Statement — 30 min A real-world scenario: you're building an e-commerce platform. Orders, inventory, notifications, analytics — all tightly coupled. What happens when one service goes down? This module makes the pain visceral before Kafka enters the picture. Module 3: How
AI 资讯
From Regex Hell to AI: How I Finally Tamed Messy PDF Invoices
Last month, I spent three days wrestling with 500 PDF invoices. Each one had the same data—vendor name, invoice number, total amount—but the layouts were all over the place. Different fonts, missing headers, tables that somehow broke across pages. I tried regex. I tried OCR with layout analysis. I even tried building a rule-based parser that looked for keywords like "Total:" . Nothing worked reliably. Every time I fixed one pattern, another invoice broke. I was one commit away from throwing my laptop out the window. Then I took a step back. I realized I didn't need to understand every layout variation. I just needed to understand the data . And that's where AI came in. What didn’t work Let me be clear: I tried the usual suspects first. Regex. Classic. I wrote patterns like r"Total\s*:\s*\$?(\d+\.\d{2})" . Worked on 60% of invoices. The rest had "Total Due" or "Amount Total" or the dollar sign in a different place. Regex is great when you control the input. I didn't. OCR with layout parsing. I used Tesseract with --psm 6 and tried to extract lines by bounding boxes. It helped a bit, but tables with merged cells or rotated text threw it off. Plus, I had to write code to guess which box was a field name and which was a value. Rule-based parser. I built a dictionary of known vendors and their layouts. That worked … until I got an invoice from a new vendor. Maintenance became a nightmare. I was solving the wrong problem. Instead of fighting formatting, I needed to focus on meaning . The AI approach that saved me I remembered that large language models are surprisingly good at understanding context. If I could give the model the raw text from a PDF and a description of what I wanted, maybe it could extract the fields directly. Here’s the core idea: treat extraction as a structured generation task. Provide a prompt with a few examples (few-shot) or just describe the schema, and let the model output JSON. I found an API that did exactly this with a simple HTTP call. (Full d
AI 资讯
Why your Cloudflare Turnstile token works in the browser but 403s from requests
Why your Cloudflare Turnstile token works in the browser but 403s from requests You solved the Turnstile widget. You can see the token in the page. You copy it into your script, POST the form from requests, and the server hands you back a 403 — or a JSON body with "success": false. The token clearly worked a second ago in the browser, so what changed? Short answer: a Turnstile token is not a password you can carry around. It's a one-time, short-lived proof bound to a very specific context, and replaying it from a different context is exactly what it's designed to reject. Below is what that context is, how to tell which constraint you're hitting, and the fix for each. The real scenario You're automating a flow on a Cloudflare-protected site. There's a cf-turnstile widget on the form. You get a token one of two ways: you render the page in a real browser (Playwright/Selenium) and read cf-turnstile-response, or you hand the sitekey + page URL to a solving service and get a token back. Either way, you then submit the form with a plain HTTP client requests, httpx, axios) and it fails. The frustrating part: it's intermittent-looking. The reason it feels random is that there are four separate constraints, and you're usually tripping a different one each time. The four things a Turnstile token is bound to 1. It's single-use Once Cloudflare validates a token server-side (the siteverify call your target makes), that token is spent. Submit twice, retry, or test it once by hand, and the second use returns false. You get a fresh one per submission. 2. It has a short TTL Turnstile tokens expire fast — a few minutes. Solve early, do other work, submit later, and the token can be dead on arrival. The widget auto-refreshes in the browser precisely because tokens go stale; a script that grabs the token and sits on it loses that refresh. 3. It's bound to the sitekey and the page URL Multiple widgets. Some pages embed more than one Turnstile (login + newsletter). Solving the wrong site
AI 资讯
I Built 3 MCP Servers for AI Agents — Here's How They Work
What are MCP Servers? The Model Context Protocol (MCP) is an open standard that lets AI agents use external tools through a unified interface. Think of it as USB-C for AI — one protocol connects any AI client (Claude Desktop, Cursor, VS Code with Cline) to any tool or data source. I built three production-ready MCP servers and published them to PyPI and GitHub. Here's what they do and how to use them. 1. Web Search MCP Server uvx crewai-web-search-mcp Two tools: web_search(query) — Searches Google/SerpAPI and returns ranked results with snippets extract_content(url) — Fetches and extracts readable content from any web page Use cases: Ask your AI about current events, research competitors, pull documentation, verify facts in real time. { "mcpServers" : { "web-search" : { "command" : "uvx" , "args" : [ "crewai-web-search-mcp" ] } } } 2. Code Review Automation MCP uvx code-review-automation Three tools: review_code(diff) — Analyzes code changes for bugs, security issues, anti-patterns, style violations check_quality(path) — Runs static analysis and returns a quality report analyze_pr(diff) — Produces a structured review: what changed, what's risky, suggestions Use cases: Paste a PR diff and get an instant review. Catch issues before they reach production. 3. Document Intelligence Server uvx document-intelligence-server Three tools: extract_document(path) — OCR and text extraction from PDFs, scanned docs, images classify_document(path) — Identifies document type (invoice, report, contract, article) summarize_document(path) — Generates a structured summary from extracted content Use cases: Process uploaded PDFs, extract data from scanned forms, summarize long reports. Pricing All three servers use a shared credit system: Tier Price Credits Free $0 50 calls/day Starter $20 2,000 calls Pro $100 12,000 calls Buy credits once, use them across any server. Credits never expire. How it works: Install with uvx crewai-web-search-mcp Use 50 free calls per day — no key needed For u
AI 资讯
Why I Built Aegis Pulse - Part 1
Why did I build Aegis Pulse? As always, it started with a simple thought that keeps getting me time and time again: "I should automate this." So, I announced Aegis Stack publicly on Reddit on December 3rd. From that very moment, I became great friends with the Unique Clones / Total Clones & Unique Visitors / Total Views charts in GitHub's analytics page. Due to the nature of aegis-stack, every stack that is spun up will clone the actual repo itself (outside of caching situations, which may vary from user to user). I didn't realize it at the time, but those clone numbers, especially the Unique Clones, would become the most important metric for me to track usage. There's this funny thing that happens when you release an OSS tool. You expect people to say something, maybe tell others, ask questions... just... something... Instead, the person looks at the tool, sees if it makes their life easier, and puts it in their bag of other tools. I know this, because this is me! I never thought about it until I'm on the other side. I had to mentally go through all the tools I had used over the years, and realized I never cared about anything other than the tool itself. And if it didn't work, I would try to make it work, and if not, just move on. Time is money, and all of that. All of that is to say, clones are something I have been tracking since day one. Now... GitHub has a 14-day rolling window period in which they have daily values, and the 14-day rolling totals. And when I say 14 days, I mean it. That's all you get, and it's on you to keep track of everything outside of that. Fair enough. Thus began the daily ritual of going and grabbing the latest numbers from the previous day, and pasting the data into 3 separate AI chats: ChatGPT, Claude Opus, and Google Gemini. I figured that since I was already storing all of this data, I might as well see what type of insights I could get from these chats (which were preloaded with enough context to know what's going on). It was a great
AI 资讯
Stop Guessing Why Your Shopify Product CSV Import Failed
You exported a product CSV, edited it in Excel or Google Sheets, and uploaded it to Shopify. Shopify shows a generic error — or worse, it silently imports the wrong thing: a handle gets overwritten, a variant attaches to the wrong product, half your rows go missing. You find out days later from a customer. Shopify CSV Preflight Validator checks the file before you upload it. It runs locally on your machine, never touches your store, needs no API key, and returns three things: fixed_products.csv — a safe copy with the unambiguous, mechanical mistakes already corrected. errors.csv — a machine-readable list of every finding (row, rule, severity, suggested fix). report.md — a human-readable report you can read in 30 seconds. No login. No upload of your catalog to a third party. Just a file in, a verdict out. Why CSV imports fail (and why the error message doesn't help) Shopify's product CSV import is a two-stage process: it validates the file, then applies rows. A file can pass the upload dialog and still misbehave on apply. The most common ways merchants get burned: A spreadsheet adds a UTF-8 BOM to the first cell. The first header ( Title ) becomes invisible-garbage + Title , so Shopify can't find the title column. Header case / legacy names drift. title instead of Title , Handle instead of URL handle . Some get ignored, some get rejected. A variant row loses its parent handle. Shopify can't tell which product the variant belongs to. Two product rows share one handle. Shopify silently keeps one and overwrites/merges the other. Image alt text with no image URL, negative prices, compare-at prices below the real price — small data bugs that ship to your live storefront. These are not exotic. They're what happens every time a human edits a CSV in a spreadsheet. What the tool actually does — a real run Here is a messy export with several of the problems above. Running: csv-preflight check messy-product-import-sample.csv --out-dir ./out --lang en produces this report.md (ve
AI 资讯
CDP Browser Control: Driving Real Chromium from Python
Playwright and Selenium are great until you hit bot detection. Google OAuth, Cloudflare, and Vercel checkpoints all flag headless browsers. Here's how to control a real Chromium instance via CDP using Python and websockets. Why Not Playwright? Playwright launches a headless browser with automation flags. Even in headed mode with Xvfb, Google detects it. The CDP Approach Launch Chromium with remote debugging: chromium-browser --user-data-dir = /path/to/profile --remote-debugging-port = 9222 --no-first-run Connect via WebSocket in Python: import asyncio , json , websockets , urllib . request async def get_page_ws (): resp = urllib . request . urlopen ( ' http://localhost:9222/json ' ) targets = json . loads ( resp . read ()) for t in targets : if t [ ' type ' ] == ' page ' : return t [ ' webSocketDebuggerUrl ' ] async def cdp_call ( ws , method , params = None ): msg_id = cdp_call . id = getattr ( cdp_call , ' id ' , 0 ) + 1 msg = { ' id ' : msg_id , ' method ' : method } if params : msg [ ' params ' ] = params await ws . send ( json . dumps ( msg )) while True : resp = json . loads ( await ws . recv ()) if resp . get ( ' id ' ) == msg_id : return resp Key Advantages Real browser fingerprint, no automation flags Persistent sessions, cookies survive across runs Google OAuth works, existing sessions carry over No bot detection, it IS a real browser Follow for more tutorials on browser automation and AI agent architecture.
AI 资讯
Building a RAG System from Scratch with pgvector and Gemini — Introduction
What This Guide Covers When you start building LLM-powered applications, one pattern becomes unavoidable: RAG (Retrieval-Augmented Generation) . LLMs only know what they were trained on. Your company's internal documents, the latest spec sheets, project-specific information — none of that exists in the model. To handle data the model doesn't know, you need a system that retrieves relevant knowledge in real time and injects it into the context. That's RAG. In this guide, we'll implement a RAG system from scratch using pgvector and Gemini, then extend it step by step through Tool Use, AI Agents, MCP, and cloud deployment. Step 1: Embedding · Vector DB · RAG — core implementation Step 2: AI Architect perspective — design decisions explained Step 3: Tool Use — LLM autonomously searches the DB Step 4: AI Agents — combining multiple tools Step 5: MCP — exposing tools as a server Step 6: Cloud deployment — Render × Supabase Three Concepts to Understand First Embedding Computers can't measure "semantic similarity" from raw text. Embedding converts text into a list of numbers (a vector), and semantically similar words produce numerically similar patterns. "dog" → [ 0.82 , 0.75 , 0.10 , ... ] 768 numbers "cat" → [ 0.78 , 0.72 , 0.12 , ... ] ← similar pattern to "dog" "bank" → [ 0.08 , 0.10 , 0.85 , ... ] ← completely different Gemini's embedding model handles this conversion. Vector DB A regular DB searches by keyword matching. A vector DB searches by numeric distance — meaning it finds semantically related documents even when the exact words don't match. -- Regular search (misses if keywords don't match) SELECT * FROM docs WHERE body LIKE '%F1 score%' ; -- Vector search (finds semantically related docs) SELECT * FROM docs ORDER BY embedding <=> query_vector LIMIT 3 ; Search for "how to measure model performance" and it finds "F1 score calculation" — even without matching words. We use pgvector , a PostgreSQL extension, for this. RAG LLMs are limited to their training data. R
AI 资讯
Agents Are Learning to Write Their Own SKILL.md Files
The Agent Skills open standard today, and the 2026 research on agents that write their own skills. TL;DR: In late 2025, "Agent Skills" became a thing — a dead-simple way to teach an AI agent a task: a folder with a SKILL.md file (some instructions in Markdown). It's already an open standard. The wild part is what's coming next: agents that write their own skills. I built a demo where an agent solves a task the hard way once, saves a real SKILL.md , and then reuses it — cutting its total effort almost in half. ~130 lines, no API key. First, what's a "skill"? If you've used Claude Code or similar tools lately, you've probably seen SKILL.md files. The idea is refreshingly low-tech. A "skill" is just a folder with a Markdown file that says how to do something : --- name : csv-to-markdown description : Turn comma-separated text into a Markdown table. Use when the input looks like CSV and the user wants a table. --- # CSV to Markdown ## Instructions Split the text into rows on newlines and columns on commas. Make the first row the header, add a `---` divider row, then format every row as `| a | b | c |`. That's it. No SDK, no config. Anthropic introduced this in October 2025 and then published it as an open standard ( agentskills.io ) in December 2025, so the same skill folder now works across ~30+ different agent tools (Claude Code, Cursor, Copilot, and more). The full rules are short ( agentskills.io/specification ): the only required fields are name (1–64 chars, lowercase-with-hyphens, and it must match the folder name) and description (≤1024 chars, saying what it does and when to use it ). Everything else — license , metadata , compatibility , allowed-tools — is optional. That's the whole spec. The SKILL.md files my demo writes follow it to the letter, so they'd load unmodified in any compatible CLI. The clever trick: progressive disclosure Here's the smart part. If you just dumped 50 skills' worth of instructions into the agent's context, you'd fill it up and leave n
AI 资讯
I Built an AI Agent That Gets Curious On Its Own
Active inference: curiosity emerges for free from minimizing surprise — 48% vs 100% on a foraging task. TL;DR: Most AI agents chase rewards — they pick whatever action scores the most points. I tried a different, brain-inspired goal: avoid surprises . Something neat happened — the agent became curious without being told to. It goes looking for information before acting, and that takes it from 48% to 100% on a simple task. ~100 lines. Two different ways to make decisions Most AI agents are "reward chasers." Give them points for doing well, and they'll pick whatever action they expect to score highest. Simple and effective. There's another idea from brain science: instead of chasing points, try to avoid being surprised — act so the world matches what you expected. It sounds almost too simple, but it leads to a surprising bonus: when you're trying not to be surprised, going and finding out what you don't know becomes valuable all by itself. In other words, curiosity isn't something you have to bolt on. It comes for free. This is called active inference , and in 2026 it jumped from neuroscience into AI as a serious approach ( here's a 2026 paper ). Here's the smallest demo that makes it click. The 10-second version The task: a reward is hidden behind either the LEFT door or the RIGHT door (50/50). There's also a hint you can check that tells you which door — if you bother to look. ❌ Reward-chaser ✅ Curious agent What it cares about getting the reward, right now getting the reward + not being unsure What it does guesses a door checks the hint first, then opens the right door Success (400 tries) 48% 100% Nobody told the second agent "go check the hint." It did it on its own, because being unsure bothered it. How it works Before acting, the agent scores each option on two things: Does this get me closer to the reward? Does this make me less unsure about what's going on? value_of_checking_the_hint = how_unsure_am_i # high when it's a total coin-flip value_of_just_guessing =
AI 资讯
Can an AI Agent Pass the Test We Give 4-Year-Olds?
Theory of Mind and the Sally-Anne false-belief test, in ~60 lines of Python. TL;DR: There's a famous test that kids pass around age 4. It checks whether you understand that other people can believe things that aren't true. I built two AI agents: one that only knows "what's actually happening" (fails, like a toddler) and one that keeps track of what each person believes (passes). It's ~110 lines, and it's the foundation for agents that can actually work together . The test Sally puts her marble in the basket , then leaves the room. While she's gone, Anne moves the marble to the box . Sally comes back. Where will she look for her marble? If you said basket , nice — you just used something called "theory of mind." Sally never saw the marble move, so in her head it's still in the basket. What's actually true (it's in the box) and what Sally believes (it's in the basket) are two different things, and you kept them separate without even thinking about it. A 3-year-old says "box" — they can't yet separate what they know from what Sally knows. A 4-year-old says "basket." It's one of the most famous tests in child psychology, and in 2026 it's become a real test for AI agents too. The 10-second version ❌ Agent with no "theory of mind" ✅ Agent that models other minds What it tracks only what's actually true what each person believes, separately Where will Sally look? "box" "basket" Result FAIL (only knows reality) PASS How it works (the whole trick) The only difference between the two agents is one rule: a person's belief only updates when that person is actually in the room to see it happen. def someone_moves_the_marble ( new_place , who_is_watching ): for person in who_is_watching : # only people in the room beliefs [ person ] = new_place # update THEIR mental picture So when Anne moves the marble while Sally is out, only Anne's mental picture updates. Sally's is frozen at "basket." Ask the simple agent and it just reports reality ("box"). Ask the smarter agent and it answer
AI 资讯
Do AI Agents Need to Sleep? I Built One That Does
A sleep-like phase that consolidates noisy daily experience into durable memory — 75% vs 100% recall. TL;DR: There's a wave of 2026 research giving AI a "sleep" phase — time spent not answering questions, just tidying up what it learned that day. I built a 90-line demo of the idea. The agent that "sleeps" remembers 100% of what it learned. The exact same agent without sleep remembers only 75% and gets confused by bad info. Runs on a laptop. The memory problem every AI app hits If you've built anything with an LLM, you know the pain: the model only "remembers" what's in its current context window. Once the conversation gets long enough, the oldest stuff scrolls off the top and is just... gone. Forgotten. The usual fix is "make the context window bigger." But that's like fixing a messy desk by buying a bigger desk. It's expensive, and the model still gets worse as you cram more in (a real, measured effect — more text in the window can actually lower accuracy). Your brain doesn't work this way. You don't remember every sentence anyone said today. While you sleep, your brain replays the day, keeps the important bits as long-term memory, and dumps the rest. That's how you remember "I like coffee" without remembering every single cup. A couple of 2026 papers ask the obvious question: Do Language Models Need Sleep? Their answer: giving an AI a quiet "offline" phase to consolidate memories makes it remember better. So I built the simplest version that shows why. The 10-second version ❌ Agent with no sleep ✅ Agent that sleeps How it remembers keeps only the last N messages saves a tidy summary every night After 30 noisy days 75% recall 100% recall Tricked by bad info? yes no — it goes with what it saw most often Same experiences, same noise, same memory test. The only difference is whether the agent sleeps. How it works Each "day," the agent hears facts like Alice → drinks → coffee . To make it realistic, about 1 in 5 facts is wrong (people misremember, logs have errors). Th
AI 资讯
I Built an AI Agent That Rewrites Its Own Code (in ~150 lines)
A tiny Darwin Gödel Machine that edits itself and keeps only changes that verifiably score higher. TL;DR: I built a small program that improves itself . It looks at the tasks it's failing, edits its own code to fix them, and keeps a change only if the change actually makes it score better on a test. It goes from passing 1 of 8 tasks to 8 of 8 — and nobody wrote those fixes but the program itself. It runs on a laptop in under a second. No fancy hardware, no API key. The old dream: software that improves itself Normally, software only gets better when we make it better. You write code, you find a bug, you fix it, you ship again. The program never improves on its own. People have wanted "software that improves itself" for decades. The classic version (called a "Gödel Machine") had one rule that made it impossible to build: before the program could change a line of its own code, it had to mathematically prove the change would help. Proving that about real code is basically impossible, so the idea never worked. In 2025, researchers found a way around it with the Darwin Gödel Machine . They dropped the "prove it first" rule and replaced it with something every engineer already trusts: Try the change. Run the tests. If the score went up, keep it. If not, throw it away. That's it. It's basically how we all work — make an edit, run the test suite, keep what passes. The twist is that the program is the one making the edits. In the real paper, this let an AI coding assistant improve its own tooling and jump from solving 20% to 50% of a hard benchmark of real GitHub issues. I wanted to actually see this happen, so I built the tiniest version I could. The 10-second version Start After improving itself What it can do only uppercase learned 6 more skills on its own Test score 🔴 1 / 8 🟢 8 / 8 Who wrote the fixes? — the program did Start: ███░░░░░░░░░░░░░░░░░░░░░ 1/8 (only knows: uppercase) +reverse ██████░░░░░░░░░░░░ 2/8 +dedup_csv █████████░░░░░░░░░ 3/8 +sum_csv ████████████░░░░░░
开源项目
🔥 browser-use / video-use - Edit videos with coding agents
GitHub热门项目 | Edit videos with coding agents | Stars: 10,432 | 216 stars today | 语言: Python
开源项目
🔥 hugohe3 / ppt-master - AI generates a real, editable PowerPoint from any document —
GitHub热门项目 | AI generates a real, editable PowerPoint from any document — native shapes & animations, speaker notes voiced as audio narration, and the option to follow your own .pptx template, not slide images · by Hugo He | Stars: 32,688 | 589 stars today | 语言: Python
AI 资讯
From Informatica XML to Snowflake: Why ETL Migration Needs a Governed Delivery Workflow
Legacy ETL modernization is often described as a conversion exercise: Informatica mapping in. Snowflake SQL out. That framing is incomplete. A real migration is not only about translating expressions. It is about preserving transformation intent, identifying what is missing, documenting assumptions, validating target behavior, and ensuring that someone is accountable for decisions before generated artifacts are released. I have been building a prototype called Data Engineering Copilot around that idea. The latest capability starts from an Informatica PowerCenter XML export and produces a governed Snowflake migration delivery packet. The workflow is: Informatica PowerCenter XML ↓ Metadata and Lineage Extraction ↓ Canonical Metadata Model ↓ Snowflake Artifact Generation ↓ Validation and Migration Risk Assessment ↓ Human Review and Approval ↓ Governed Release Package The problem with simple code conversion An Informatica mapping can contain far more than a direct field-to-field relationship. A typical mapping may include: source definitions and target definitions source qualifiers and filters expression transformations reusable transformations lookups constants and default values mapping parameters target load order connector-level lineage update strategy or sequence-generation behavior target fields with no visible incoming connector A generator that only reads source and target columns may produce SQL that looks valid but does not preserve the original delivery intent. That is risky. For example, imagine a target field that has no visible source column. It may still be populated through: a constant such as 'SOURCE_A' a default such as 'XNA' a surrogate-key lookup a runtime parameter a load timestamp a sequence generator a business decision that was never documented in the mapping If the tool silently inserts NULL , the SQL may compile while the migration is functionally wrong. The prototype approach The Data Engineering Copilot prototype accepts two starting points:
AI 资讯
Cutting OpenAI Costs From Scratch: What Nobody Tells You
Cutting OpenAI Costs From Scratch: What Nobody Tells You Three months ago I sat down with my finance lead and watched her scroll through our OpenAI invoice. The number was $14,200 for the month. That was the moment I knew we had a problem. Not a "maybe we should optimize" problem — a real, existential, "this kills our margins before we hit Series B" problem. I run a B2B SaaS platform that does a lot of LLM-powered document processing. Summarization, extraction, classification, the boring stuff that makes real money but burns tokens like crazy. We were routing everything through GPT-4o because, honestly, it was the path of least resistance when we started. Then the bills started arriving. This is the story of how I cut our LLM spend by 97%, the architecture decisions that made it possible, and the things I wish someone had told me before I started. The Math That Made Me Sweat Let me put actual numbers on the table. Here's what I was paying versus what I pay now: Model Provider Input $/M Output $/M vs GPT-4o GPT-4o OpenAI $2.50 $10.00 — GPT-4o-mini OpenAI $0.15 $0.60 16.7× cheaper DeepSeek V4 Flash Global API $0.18 $0.25 40× cheaper Qwen3-32B Global API $0.18 $0.28 35.7× cheaper DeepSeek V4 Pro Global API $0.57 $0.78 12.8× cheaper GLM-5 Global API $0.73 $1.92 5.2× cheaper Kimi K2.5 Global API $0.59 $3.00 3.3× cheaper Look at that DeepSeek V4 Flash row. 40× cheaper than GPT-4o. For comparable quality on the workloads I was running. I had been leaving 97.5% of my budget on the table. Doing the mental math: a $500/month OpenAI bill becomes $12.50. My $14,200 bill? Theoretically $355. That's not optimization, that's a different business. Why I Almost Didn't Do It Here's the thing nobody tells you about cost optimization at a startup: it's not a technical problem, it's a willpower problem. The reason I was paying OpenAI 40× too much wasn't because their API is hard to use. It was because switching felt risky. I had deadlines. I had a roadmap. I had investors asking about g
AI 资讯
The Day I Confused Task Queues with Message Brokers And Built the Wrong Thing
In my journey as a backend developer, I had already spent time working with APIs, databases, authentication flows, and background processing. I understood the basic idea that not everything should occur within a request-response cycle, especially when dealing with expensive operations such as sending emails, processing files, or generating reports. Offloading work to the background felt like a solved problem to me. That confidence was exactly what led me into confusion. When I first encountered message brokers and task queues, they looked like different names for the same idea. Both involved queues, both involved workers, and both involved asynchronous processing. In my head, the distinction didn’t seem important, so I treated them interchangeably and assumed that choosing one over the other was just a matter of preference or framework availability. The real issue was that I had not yet understood the difference in intent between communication and execution. What I thought was a simple design choice actually turned into an architectural mistake that affected how I structured an entire system. How I Misunderstood the Problem At the time, I was building systems where the backend had to handle multiple heavy operations. A user could upload files, request reports, or trigger processes that should not block the main API response. Naturally, I reached for a queue-based solution because it is the standard answer for background work. However, instead of asking what role the system needed to play, I focused on what tool could make things asynchronous. That small shift in thinking created the confusion. I assumed that anything that gets delayed or processed later should automatically go into a queue, without distinguishing whether I was dealing with a job that must be executed or an event that other services should react to. This is where I started building the wrong abstraction. Where Task Queues Actually Fit A task queue exists primarily to assign work that must be complete
AI 资讯
DeepSeek vs Qwen vs Kimi vs GLM: Which AI API Wins in 2025?
Honestly, deepSeek vs Qwen vs Kimi vs GLM: Which AI API Wins in 2025? I'll be honest — when I first started comparing these four Chinese AI model families, I thought it would be a quick exercise. Spoiler: it wasn't. I spent two weeks running prompts through every endpoint, tracking every dollar, and tallying tokens like a part-time accountant. The good news? I now have very strong opinions about which one deserves your money. Here's the thing: most "AI comparison" posts online are written by people who clearly haven't paid a single API bill. They throw around vague phrases like "good value" without ever showing you the math. That's not me. I'm the person who sees $0.01/M and immediately thinks "wait, that's a 99% discount compared to GPT-4o." I calculate things. I notice things. And when I noticed I could replace most of my OpenAI spending with these four providers, I lost my mind a little. So buckle up. This is going to be the most cost-obsessed AI comparison you'll read this year. I've tested DeepSeek, Qwen, Kimi, and GLM through Global API's unified endpoint, and I'm going to break down exactly what each one costs, what each one delivers, and where your dollars should actually go. The Price Reality Check Before we dive into individual models, let me set the stage. Look at these price ranges side by side: DeepSeek: $0.25–$2.50/M output Qwen: $0.01–$3.20/M output Kimi: $3.00–$3.50/M output GLM: $0.01–$1.92/M output Check this out — Qwen and GLM both start at $0.01/M for their smallest models. That's literally one cent per million tokens. If you've been paying OpenAI prices, that's a 99%+ reduction. On the other end, Kimi sits at $3.00–$3.50/M, which is the premium tier. That's not crazy compared to GPT-4o, but it's noticeably more expensive than the other three. The price spread across all four families combined is enormous. From $0.01/M to $3.50/M. That's a 350x range. Which means the model you pick matters more than any other decision in your AI stack. DeepSeek:
AI 资讯
从"玩具"到"教材":一个500行AI框架的自我修养
为什么我要造一个500行的Agent轮子? 你好,我是 FROST 的作者。 2026年了,Agent 框架多得能让人挑花眼:LangGraph 有 34.5M 月下载量,Dify 在 GitHub 斩获 129.8K Stars,各大厂商都在疯狂推自己的 SDK。这种环境下,再写一个"轮子",是不是有点多余? 说实话,我也纠结了很久。 一个困惑:新学者的两难困境 事情要从一次失败的辅导说起。 我帮一个朋友入门 Agent 开发,推荐了 LangChain。结果他学了两个月,还在和 chain.invoke() 搏斗,脑子里依然没有"Agent 到底是怎么工作的"这个概念。 问题出在哪? 现在的框架太强了,强到把所有的复杂性都藏了起来。 你可以三行代码跑起来一个 Agent,但你也永远不知道它内部发生了什么。就像学开车,你学会了踩油门转弯,但发动机是怎么工作的、变速箱怎么换挡,一概不知。 而对于想真正理解 Agent 本质的人来说,这是一个巨大的 Gap: 需求 现有选项 快速开发产品 LangChain/CrewAI 理解底层原理 论文 + 源码 入门级教学框架 ❌ 空白 这个空白,就是 FROST 存在的原因。 FROST 的设计哲学:Less is More FROST 不是一个生产级框架,它是一个 教学框架 。 这意味着它刻意放弃了: ❌ 复杂的依赖生态(不需要 LangChain) ❌ 丰富的工具集成(没有 100+ 内置工具) ❌ 分布式部署能力(就是单机 Python) 它只保留了三个核心概念: \ `python Store - 记忆容器(类似神经细胞的存储功能) class Store: """存储上下文、记忆、状态""" def init (self): self.data = {} Skill - 纯函数变换(类似神经细胞的处理功能) class Skill: """输入→处理→输出,无状态""" def call (self, store, *args, **kwargs): pass Agent - 执行单元(类似神经细胞本身) class Agent: """调用 Skill,操作 Store,完成目标""" def init (self, skills: list[Skill], store: Store): pass ` \ 是的,就这么简单。 三个类,不超过 500 行代码。 但正是这种简单,让"理解"变得可能。 一行代码跑起来的 Agent \ `python from frost import Agent, Store, Skill 定义一个"搜索助手"技能 class SearchSkill(Skill): def call (self, store, query): result = web_search(query) # 这里是你的搜索实现 store.set("last_search", result) return result 创建 Agent 并运行 store = Store() agent = Agent(skills=[SearchSkill()], store=store) response = agent.run("北京今天天气怎么样") print(response) ` \ 对比一下用 LangChain 实现同样的功能: \ `python from langchain.agents import AgentExecutor, create_react_agent from langchain_openai import ChatOpenAI ... 还有十几行初始化代码 ` \ FROST 让你从第一行代码开始,就知道自己在做什么: Agent 是执行者 Skill 是它的能力 Store 是它的记忆 没有魔法,没有黑箱,只有清晰的数据流。 为什么叫 FROST? FROST 的全称是 Fractal Remote Organ of Scalable Thoughts ——可扩展思维的分形远程器官。 这个名字源于它的设计灵感: 神经细胞(Neural Cell) 。 在生物学中,每个神经细胞都很简单: 接收信号 处理信号 发出信号 但当 亿万个神经细胞 连接在一起,就涌现出了智能。 FROST 试图在软件层面复现这个过程: Neural Cell → Agent Synapse → Skill Long-term Memory → Store Brain (Emergence) → Multi-Agent System 这不是在模仿大脑,而是在学习生物界的智慧: 简单单元 + 清晰连接 = 复杂行为。 我的踩坑日记 作为一个从零开始写框架的人,踩的坑比代码行