What is a token and why does it cost so much? - Computerphile
submitted by /u/itgforlife [link] [留言]
找到 1591 篇相关文章
submitted by /u/itgforlife [link] [留言]
Nephew saw a YouTube ad. Someone was selling a "secret prompt" for ₹199, claiming ChatGPT and Claude can analyze the stock market and place trades with 90% accuracy — no technical analysis, no fundamentals, just paste this prompt. He brings it straight to Uncle. The Ad 👦 Nephew: Uncle, I saw an ad on YouTube. Some guy was saying, "Use ChatGPT and Claude AI for stock market analysis, take trades with 90% accuracy. You don't even need to know technical analysis or fundamentals — just use this prompt and you'll get all the results." Is that actually possible? 👨🦳 Uncle: (laughs) Ah, here we go. This is exactly how a lot of scams happen — and honestly, it's rarely because of some clever new invention. It's because of a lack of understanding, and people treating these models as a magic black box. 👦 Nephew: So are they scamming us? Or genuinely fooling themselves too? 👨🦳 Uncle: Not exactly a straightforward scam, and not exactly genuine either. Here's the honest split: they're maybe 30% correct, and 70% wrong. 👦 Nephew: What does that even mean? 👨🦳 Uncle: I'll accept this much — there genuinely are AI models out there that can do a solid job predicting stock trends or running fundamental analysis, because that kind of prediction is heavily mathematical, numerical work. But — and this is the important part — ChatGPT, Claude, and Gemini are not that kind of model. 👦 Nephew: Why not? It can literally write code. It can do math inside code. Why can't it just... do math for stock prediction too? I genuinely don't get it. 👨🦳 Uncle: Come, sit. This needs a proper, from-scratch conversation. We're going to dig all the way down to what these models actually are , and by the end, you'll understand exactly why ChatGPT, Claude, and Gemini are the wrong tool for this specific job — not a scam exactly, but sold by people who never actually opened the box themselves. Part 1: What Is an LLM, Really — In One Honest Sentence 👨🦳 Uncle: Before anything else, one sentence, and hold onto i
submitted by /u/c1rno123 [link] [留言]
submitted by /u/j1897OS [link] [留言]
We build an internal helpdesk, and I want to talk through a problem we only partly solved — because I suspect a lot of you have hit it too, and I'd genuinely like to hear how you handled it. The most requested thing from our users was never "better ticket forms." It was "please make the duplicates stop." Here's the shape of it. A deploy goes slightly wrong at a 40-person company. Within ten minutes you have: a handful of chat messages : "login is broken", "can't get into dashboard???", "deploy looks weird" several error-tracker events (whatever you run — Sentry, Rollbar, an APM): TokenExpiredError ×2, a 401 spike on /api/auth , a 5xx spike on auth-svc a couple of emails to IT : "access token expired", "need login reset" Nine items across three channels. One root cause: token rotation broke in that deploy. Whoever's on rotation spends the morning proving that, instead of fixing anything. We wanted to automate the recognition step — "these are the same thing" — not the fixing step. This is the honest version: what we tried, the small thing we actually shipped, and the parts we haven't cracked. If you've built something similar, I'd love to be told what we got wrong. Attempt 1: rules and keywords (broke immediately) The obvious first cut: normalize ticket text, match on keywords and categories, merge on high overlap. It fails on the example above, and it fails structurally: "login is broken" and TokenExpiredError share zero tokens. The human on rotation isn't string-matching — they know a deploy just happened, they know what auth-svc does, they've seen this failure shape before. Rules encode none of that. Rule systems also rot. Every incident teaches you a new synonym for "it's down," and six months in you own a regex museum nobody wants to touch. Maybe you've kept one of these healthy long-term — if so I'd honestly like to know how. Attempt 2: embed everything, cluster by similarity (the one we didn't ship) The tempting next move: embed ticket text, cluster on cosine
"Show nothing, hold everything." — The Thirty-Six Stratagems, Create Something Out of Nothing Previously on this series: #4: P Walked Into an AI Monitoring POC. P Didn't Run a Single Test. — P found an ACL business card in an abandoned POC archive. P didn't tell anyone. P just pocketed it. White walls. Fluorescent hum. A FortDefender quarterly report sat open on the table, the cover printed in bold: Zero missed detections. 99.97% detection rate. The CTO slid it across. "The day the leak happened," he said quietly, "this system said everything was fine." "Which client?" " MedTech . Medical data breach. Their internal AI monitoring didn't catch it either. The quarterly report called it 'client-side issue.' I don't buy it." P didn't look at the report first. P looked at the CTO's eyes first. "You didn't bring me here to validate his numbers." The CTO didn't deny it. " FortDefender won't give you production access," he said. "Read-only logs. Sandbox. Public docs. You signed the NDA." "What do you want me to do?" "Find what's hiding inside 'everything was fine.'" P nodded. P didn't ask "what if I find it" — P knew the answer. "One condition: full internal penetration test access. No advance notice to anyone." The CTO was quiet for three seconds. "Done." P stood up. The CTO added one more thing as P turned: "I've heard about the FirmCore thing. That's why I called you." P didn't look back. Week One FortDefender 's public documentation was beautiful. Architecture diagrams. Whitelist rules. Alert thresholds. Response times. All in a technical whitepaper so polished you'd think it was written to raise funding. P spent three days reading every page. In the sandbox, P ran three rounds of tests. FortDefender 's detection system hit every single one. The 99.97% wasn't a lie — at least not inside the sandbox. But P noticed something. FortDefender 's whitelist rules were too complete. They covered everything — down to "penetration tests with valid internal certificates" being pre-
submitted by /u/Happycodeine [link] [留言]
submitted by /u/fagnerbrack [link] [留言]
submitted by /u/lucian-12 [link] [留言]
When people talk about hackathons, they talk about the demo. The pitch, the UI, the "aha" moment on stage. Nobody really talks about the person who spent the whole weekend making sure the data didn't fall apart. That was me on AidStream, a blockchain-based aid distribution platform we built in a weekend and trust me it wasnt that easy as it seems. At a normal project, you can revisit your data model whenever.But during a hackathon you cant since when teamamtes start working on top of your tables it means both codes may start breaking . Serverless Postgres was the right choice for a hackathon: no local DB setup, no "wait, whose laptop has Postgres installed" problem. Everyone could connect to the same instance immediately. The gotcha was connection limits — with multiple people hitting the same database while testing features simultaneously, we ran into connection issues at the worst possible time (an hour before demo). So next time you watch a hackathon demo go off without a hitch, remember — someone probably spent the whole weekend quietly making sure the database didn't have a say in it. If you're the one holding the schema together at 2am, know this — it's not the flashy role, but it's the one that decides whether anyone else's code even runs.
For years, developers have faced the same dilemma when implementing complex search APIs: GET is the correct semantic choice for read-only operations, but query parameters can become extremely long and difficult to manage. POST allows sending a request body, but it's intended for operations that may change server state, making it a poor semantic fit for searches. To bridge this gap, the IETF has introduced a new HTTP method: QUERY (RFC 10008). Why was QUERY introduced? Modern APIs often require complex filtering: nested JSON filters GraphQL-like requests advanced search criteria large lists of IDs geospatial or analytical queries Encoding all of this into a URL is cumbersome and can exceed practical URI length limits. Developers have traditionally worked around this by using "POST" for read-only searches. The problem is that "POST" doesn't express the intent of the request very well. The new QUERY method solves this by allowing clients to send a request body while keeping the operation explicitly safe and idempotent. Key benefits ✅ Request body support Unlike "GET", "QUERY" allows sending structured request data in the message body, making complex searches much easier to model. ✅ Safe by design Like "GET", a "QUERY" request must not modify server state. It clearly communicates that the request is read-only. ✅ Idempotent Repeating the same "QUERY" request produces the same result without additional side effects, allowing clients and intermediaries to safely retry requests after transient failures. ✅ Cache-friendly Unlike the common "POST"-for-search pattern, "QUERY" is designed to work with HTTP caching, enabling better performance and more efficient network usage. ✅ Better API semantics Instead of overloading "POST" for read operations, APIs can now express their intent more accurately: "GET" → simple resource retrieval "QUERY" → complex read operations with a request body "POST" → operations that create or modify state Example Instead of forcing everything into a lo
Python's Memory Model Is Not What You Think It Is Ask most Python developers how Python stores a variable and they will say "it stores the value." This is imprecise in a way that causes real bugs and real confusion in interviews. A precise mental model of how Python stores and retrieves data changes how you read and write code. Python does not store values in variables. Python binds names to objects. The distinction sounds philosophical until you trace code that involves mutation, function arguments, or aliasing. Then it becomes the most practically useful concept in the language. Names Are Not Boxes The box metaphor, which says a variable is a box that holds a value, is how most introductory programming courses explain variables. In many languages this metaphor is close enough to accurate that it does not cause problems. In Python it is wrong in ways that matter. A more accurate metaphor: a Python name is a label attached to an object. The object exists independently in memory. Multiple labels can be attached to the same object. Attaching a new label does not move or copy the object. x = [ 1 , 2 , 3 ] y = x print ( id ( x ) == id ( y )) # True (same object, two labels) When you write y = x , you are not copying the list. You are creating a second label that points to the exact same list object. The Four Operations You Must Distinguish 1. Assignment creates a new binding x = [ 1 , 2 , 3 ] x = [ 4 , 5 , 6 ] # x now labels a completely different object The first list still exists in memory until garbage collected. The name x simply stops pointing to it and now points to the second list. 2. Mutation modifies an existing object x = [ 1 , 2 , 3 ] x . append ( 4 ) # the object x labels is modified in place Any other name pointing to the same object will instantly reflect this change because they look at the same memory location. 3. Augmented assignment on mutable types mutates x = [ 1 , 2 , 3 ] y = x x += [ 4 , 5 ] print ( y ) # [1, 2, 3, 4, 5] (same object, mutated) The
AI coding tools can now write features, edit multiple files, debug code, run commands, and generate tests. But while researching how developers use these tools, I keep seeing the same question: Are AI coding tools actually saving us as much time as they should? The models are becoming more capable, but developers still seem to spend significant time managing context, checking changes, watching usage limits, choosing models, and explaining the same project information again. I’m trying to understand whether these are widespread problems or just isolated experiences. The Problems I'm Investigating Context and Memory Long AI coding sessions can sometimes lose direction. The AI may forget earlier decisions, misunderstand project conventions, suggest previously rejected approaches, or require the developer to explain important context again. This makes me wonder: Should project knowledge disappear when a chat session ends? Would it be useful if the development environment could preserve relevant architecture decisions, coding conventions, previous bugs and fixes, failed approaches, current tasks, and next steps? Agent Reliability Writing code is only one part of development. An ideal agent workflow might look more like: Understand → Plan → Edit → Run → Test → Fix → Verify But how autonomous should that process be? Should the agent complete the entire loop independently, ask before risky actions, or wait for approval at every major step? Models, Usage, and Cost Developers now have access to many models, but choosing between them can become another task. Should developers always choose models manually, or should the development environment select an appropriate model based on task complexity, quality requirements, privacy, speed, and budget? Usage limits are another concern. Some developers report difficulty predicting how quickly their allowance is being consumed. Would real-time usage visibility, spending limits, local model support, or BYOK actually improve the experien
submitted by /u/gingerbill [link] [留言]
DeepSeek vs Qwen vs Kimi vs GLM: Which AI API Actually Wins in 2025? I've spent the last decade designing systems that need to stay up no matter what. 99.9% uptime isn't a marketing slogan for me — it's the difference between a happy customer and a 3am incident call. So when the Chinese model ecosystem exploded with options like DeepSeek, Qwen, Kimi, and GLM, I didn't just glance at the benchmarks. I pulled the levers, watched the dashboards, and stress-tested every endpoint I could get my hands on. Here's what I found after weeks of running these models behind load balancers, instrumenting them with p99 latency tracking, and watching how they behave when you throw production traffic at them. The Multi-Region Reality Nobody Talks About Most comparison articles treat AI APIs like they're interchangeable endpoints you curl against. That's fine for a weekend hackathon. It's dangerous for production. When I'm architecting a service that depends on an LLM, I care about three things before I care about quality: p99 latency under sustained load Failover behavior when a region gets congested Cost per million tokens at the rate I'm actually consuming I ran each of these four providers through a series of synthetic workloads — bursts of 200 concurrent requests, sustained 50 RPS for an hour, and cold-start recovery tests. The numbers told a story that the marketing pages don't. The Data at a Glance Here's the TL;DR before I dive in. DeepSeek gives you the best price-to-performance ratio, full stop. Qwen has the widest catalog of model sizes I've ever seen from a single provider. Kimi costs a premium but earns it on reasoning-heavy workloads. GLM punches above its weight on Chinese-language tasks and offers multimodal support that the others don't. Dimension DeepSeek Qwen Kimi GLM Provider DeepSeek (幻方) Alibaba (阿里) Moonshot AI (月之暗面) Zhipu AI (智谱) Output price range $0.25–$2.50/M $0.01–$3.20/M $3.00–$3.50/M $0.01–$1.92/M Budget pick V4 Flash @ $0.25/M Qwen3-8B @ $0.01/M N/A GL
The capability phase is over For the past two years, the AI conversation has been about...
How I Cut My LLM API Bill by 40x: A Freelancer's Migration Story Last month I almost choked on my coffee when my OpenAI dashboard showed $487.32 for a single client project. That's not profit. That's a panic attack. As a freelancer running a one-person shop, every line item on my monthly expenses gets scrutinized harder than my code reviews. I spent the next weekend stress-testing alternatives, and honestly? I was annoyed at myself for not doing it sooner. The savings are obscene. Let me walk you through exactly what I found, what I migrated to, and how the switch took maybe 20 minutes total. Let me Start With the Damage Here's what I was paying before. OpenAI's GPT-4o runs $2.50 per million input tokens and $10.00 per million output tokens. For one of my retainer clients — a SaaS company whose support chatbot I maintain — I'm pushing roughly 50 million tokens through a month on input and another 15 million on output. Do the math with me: 50M × $2.50 = $125 on input alone. 15M × $10.00 = $150 on output. That's $275/month just for that one client's chatbot. Add my other three active clients and suddenly I'm staring at a $400-500 OpenAI bill every month like clockwork. For a freelancer, that's a third of a client's monthly retainer gone before I even touch my actual engineering hours. Unacceptable. The Alternative Landscape (And Why I Picked What I Picked) I went down the rabbit hole. I tested seven different model providers over a long weekend, ran the same prompts through each, compared output quality, latency, and price. Here's the full breakdown I compiled in a spreadsheet (because yes, freelancers absolutely live in spreadsheets): GPT-4o (OpenAI): $2.50 input / $10.00 output per million tokens. The default. The expensive default. GPT-4o-mini (OpenAI): $0.15 input / $0.60 output per million tokens. Already 16.7× cheaper than its big sibling. DeepSeek V4 Flash (Global API): $0.18 input / $0.25 output per million tokens. Forty times cheaper than GPT-4o. Qwen3-32B (G
Hit a perfect 7-day streak this week, splitting my time between a massive aesthetic pivot in my...
submitted by /u/lIlIlIKXKXlIlIl [link] [留言]
Nordstjernen is a web browser, written from scratch in C, focused on supporting the HTML and CSS standards. It runs on Windows, Mac and Linux, with an Android port in progress. Nordstjernen is built in Norway. submitted by /u/AndreasWeb [link] [留言]