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

今日精选

HOT

最新资讯

共 34677 篇
第 1472/1734 页
AI 资讯 Dev.to

FastAPI for AI Engineers - Part 3: Connecting to a database

In the previous article, we explored how to build our first CRUD API using FastAPI. While our API worked correctly, there was one major problem. We were storing data inside Python lists, which exist only in memory. If you've ever wondered how applications like Instagram, LinkedIn, or ChatGPT remember information even after a server restart, the answer is simple: databases. In this article, we'll solve the problem of in-memory storage by connecting our FastAPI application to SQLite using SQLAlchemy. If you haven't read the previous post, check it out: FastAPI for AI Engineers - Part 2: Building Your First CRUD API Ananya S Ananya S Ananya S Follow Jun 1 FastAPI for AI Engineers - Part 2: Building Your First CRUD API # ai # backend # fastapi # python 7 reactions Comments Add Comment 4 min read By the end of this article, you'll understand: Why in-memory storage is a problem What SQLite is What SQLAlchemy is How ORM works How to create database tables using Python classes How to perform CRUD operations using a real database The Problem with In-Memory Storage Previously, our application stored students inside a Python list. students = [ { " id " : 1 , " name " : " Ananya " , " department " : " CSE " , " cgpa " : 8.9 } ] This worked for learning CRUD operations. However, consider what happens when the server restarts: FastAPI Server Stops ↓ Python Memory Cleared ↓ All Student Data Lost This is unacceptable in real-world applications. We need a place where data can survive application restarts. This is where databases come in. What is SQLite? SQLite is a lightweight relational database. Unlike MySQL or PostgreSQL, SQLite doesn't require a separate database server. Instead, everything is stored inside a single file. students.db Advantages of SQLite: No installation required Lightweight Easy to learn Perfect for local development Great for small projects For this article, we'll use SQLite. What is SQLAlchemy? Before SQLAlchemy, developers often wrote raw SQL queries. Exampl

Ananya S 2026-06-06 14:27 13 原文
AI 资讯 Dev.to

How AI Applications Answer From Your Data, Not Their Training

Why retrieval-augmented generation has become the foundational pattern for building useful AI — and how it actually works. The Problem With Relying on LLMs Alone Large language models are impressive. They can write, reason, summarize, and explain across an enormous range of topics. But they have a hard boundary: their knowledge stops at their training cutoff. Anything that happened after that date, anything specific to your company, your codebase, or your documents — the model simply doesn't know it. The naive solution is to paste your data directly into the prompt. For short content, this works. But prompts have limits. A model can only process so much text at once, and even within that limit, quality degrades when you stuff too much context in. The model loses track of things buried in the middle, confuses similar passages, and starts guessing when it should be reading. RAG — Retrieval-Augmented Generation — solves this properly. Instead of sending everything to the model and hoping for the best, you send only what's actually relevant to the question being asked. The Core Idea The analogy that makes RAG click immediately: imagine a student sitting an open-book exam. They don't memorize the entire textbook. When they see a question, they flip to the right chapter, read the relevant section, and write their answer from what they just read. They're not guessing. They're grounding their answer in the source material. RAG does exactly this. When a user asks a question, the system finds the most relevant pieces of information from your data, hands those pieces to the LLM as context, and the model answers from that context alone. The result is accurate, grounded, and verifiable — you can point to exactly which source the answer came from. The process runs in two phases: ingestion, which prepares your data in advance, and retrieval, which happens at query time. Phase One: Ingestion Ingestion is the preparation step. Before any user asks anything, you process your data and

Kopalachandran Abinash 2026-06-06 14:26 10 原文
AI 资讯 Dev.to

Ideogram 4.0 is Good. Just Good.

A blind test across 240 images and 10 professional designers just dropped. Ideogram 4.0 against Gemini 3.1, Grok Imagine, and FLUX.2 Max. The results are clean. Ideogram won typography in nearly half of every blind matchup. 47.9 percent. Next closest was Gemini at 30 percent. FLUX.2 and Grok sat around 15 percent each. On the question that actually matters to designers -- would I ship this -- Ideogram scored 3.55 out of 5. Gemini got 2.84. Nobody else cleared 3. That is a real lead in text rendering. The model was trained exclusively on structured JSON caption datasets, which means it understands composition and layout differently than models trained on alt-text scraped from the web. The JSON prompting is genuinely useful for automated pipelines. You can specify bounding boxes, color palettes, object positions. It is not just better at text. It is more controllable. I tested it. It works. The text in images is readable. That has been the white whale of AI image generation for two years and Ideogram 4.0 mostly solves it. But as an overall image model, it is just good. Competitive, not dominant. On busy, highly detailed scenes with specific counts and attributes, Ideogram scored 3.42. Gemini scored 3.37. That is a statistical tie. FLUX.2 scored 3.01 and Grok 2.82, which are worse, but the gap between the top two is noise. For general image quality, you are splitting hairs between Ideogram and Gemini. For photorealism, FLUX and Reve still lead. For artistic generation, Midjourney is Midjourney. The prompting behavior is interesting. Lean prompts won across the board. Long, over-specified prompts lost. The model was trained on structured data, so it wants structure, not paragraphs. "A poster for a coffee shop. The text says Morning Blend in serif. Warm tones, natural light." That works. Adding stylistic directives and adjectives and "make it pop" language degrades the output. Where to actually use this thing: fal.ai has it at three cents per megapixel in Turbo mode. Tha

Igor Gridel 2026-06-06 14:24 12 原文
AI 资讯 Dev.to

Ideogram 4.0 is on 7 Platforms. Here's What It Actually Costs.

Ideogram 4.0 launched this week and within 48 hours it was available on seven platforms. That is unusual. Most model launches trickle onto one or two platforms over weeks. Ideogram went wide immediately, which suggests the open weights strategy is working as intended. Here is what you will pay depending on where you use it. fal.ai The cheapest API access. Turbo mode at three cents per megapixel. That is roughly three cents per 1K image. Balanced at six cents. Quality at ten cents. Pay-per-use, no minimums. If you are generating through an API, this is your starting point. Krea Included in all paid plans. Basic is $5.25 per month billed annually with 5,000 compute units. Pro is $21 per month with 20,000 CUs. The CU cost for Ideogram 4.0 specifically is not published yet, but Krea includes 150 plus models in their CU pool, so you are not paying extra for access. If you already use Krea for other models, Ideogram 4.0 is effectively free to try. ComfyUI Free if you have the GPU. The model is open weights at 9.3 billion parameters. Native ComfyUI support means you can download the weights and run it locally. No per-generation cost. No API calls. Just your electricity bill and GPU time. For volume generation or iteration, this is the cheapest path by far. Leonardo Announced as a day zero launch partner but the pricing page still lists Ideogram 3.0. Plans range from $12 to $60 per month with token allowances from 8,500 to 60,000. Third party models on Leonardo always consume tokens, no relaxed generation. Until they publish the 4.0 token cost, you are guessing. Assume it will be similar to their other premium models. Replicate The Ideogram 3.0 listing is live but 4.0 is not there yet. Replicate prices by hardware time rather than per-image, which can be cheaper or more expensive depending on your batch size and the GPU allocated. Worth checking when it lands. FLORA Available in FLORA. Pricing unclear. FLORA is primarily a creative platform, not an API provider, so you are

Igor Gridel 2026-06-06 14:24 12 原文
AI 资讯 Dev.to

The Interview Prep Mistake That Kept Holding Me Back

[While preparing for interviews, I realized I had a strange habit. I would solve a problem, get stuck, open the solution, understand it, and move on feeling productive. A few days later, I couldn’t solve a similar problem on my own. The issue wasn’t lack of practice. The issue was that I was consuming solutions faster than I was developing problem-solving skills. So I changed my approach. Instead of looking for answers, I started forcing myself to think longer, write down my ideas, identify where I was stuck, and only then seek guidance. That worked much better. But I couldn’t find a tool that supported this style of learning. Most platforms either: Give you the answer. Give you the editorial. Give you AI that writes the code for you. So I started building my own. The goal was simple: An AI coach that guides the thought process instead of generating the solution. Over time I added: DSA practice System Design preparation Low-Level Design preparation Company-wise interview questions Topic-wise strength and weakness analysis Personalized revision lists The interesting part wasn’t building it. The interesting part was realizing that interview preparation is less about collecting solutions and more about training how you think. What has helped you improve more during interview prep? Reading solutions? Or struggling with the problem first? Sde vault - https://sdevaultweb.onrender.com/

Ujjwal 2026-06-06 14:21 12 原文
AI 资讯 Dev.to

Analysis of Mo Gawdat and Marina Mogilko’s Conversation About the Future of AI, Startups, Education, and the Labor Market

AI Does Not Cancel Reality I watched the conversation between Mo Gawdat and Marina Mogilko about the future of AI. The conversation is strong. It contains important ideas, but it also contains many claims that sound large in scale, although on closer inspection they rely on very broad generalizations. AI is indeed changing the labor market, education, startups, content, hiring, and ways of thinking. But it does not cancel money, connections, trust, the human vector, creativity, necessity, morality, or people’s ability to adapt. Video on YouTube AI in hiring: automation amplifies chaos Many people have entered the job market. Companies receive huge volumes of resumes. HR departments cannot handle the volume. It is natural that part of the selection process is moving to AI. But there is a serious problem here. Candidates are also starting to play against AI. Resumes are adjusted to vacancies. Cover letters are assembled around keywords. Profiles become optimized for the filter, not for real work. In such a system, the best specialist does not necessarily pass. Often, the person who understood the selection mechanism better passes. The result: the picture becomes cleaner, while the quality of the decision becomes lower. The company gets not the strongest candidate, but the candidate who matched the algorithm best. This leads to lower hiring quality, lower productivity, and slower development. “I built a startup in six weeks”: a product is not a startup The conversation includes the idea that an AI startup would once have taken years and hundreds of engineers, and now it can be built in weeks. Technically, this is true. Prototypes are now built faster. Small teams have powerful tools. One person can now do more than a group could do before. But two different things are mixed here. Building a product faster has become real. Building a startup faster has become real only when resources are present. A startup is not only code. A startup is money, connections, trust, reputa

Anton Minin Baranovskii 2026-06-06 14:20 12 原文
AI 资讯 Reddit r/artificial

Has any AI tool actually saved you significant time, or do they mostly just move the work around?

Unpopular opinion: most AI tools don’t actually save time. They just move the work around. You still have to prompt it, check it, edit it, and sometimes redo it. That’s not automation — that’s just a different kind of work. The only ones I’ve seen genuinely cut time are search tools like Perplexity and coding tools like Cursor. Everything else feels like it’s optimized for the demo, not real use. Change my mind submitted by /u/aiprotivity_ [link] [留言]

/u/aiprotivity_ 2026-06-06 14:05 6 原文
AI 资讯 Reddit r/artificial

What does OpenAI do with our data?

Hi! I’ve been working in IT for over seven years now, and my office is next to some healthcare professionals. During a lunch break sitting on a bench in the sun, one of them asked me: If I enter my patients’ personal information into ChatGPT, is that a problem? I wasn’t sure how to answer him, in my opinion, yes, but what do you think? I’d be curious to hear your thoughts, and if there are any studies on the subject, I’d love to see them too! Thanks in advance for your responses! Have a great day, everyone ☀️ Alex submitted by /u/No_Computer_1247 [link] [留言]

/u/No_Computer_1247 2026-06-06 13:53 6 原文
AI 资讯 Reddit r/artificial

Question about Perplexity

I don’t know if this is the right sub-reddit to ask this type of question. I am quite ignorant about hardcore technical stuff. I want to say that I love the idea of an agnostic approach to AI and being able to understand and decide which model is best suited for a specific task. As well as the ability to have citations, being able to have it look through health research and stuff for queries regarding health, etc. Now I do not know if this is just in a general sense people just complaining or something else entirely, but I am seeing a lot of negative stuff on the Perplexity sub-reddit. In terms of like how the quality has gone down, asking how such a company is still even in business. I was just wondering if any of this holds any water or is overly exaggerated submitted by /u/No-Main6695 [link] [留言]

/u/No-Main6695 2026-06-06 13:49 6 原文
开发者 Reddit r/webdev

Updated imagor 1.9.1 benchmark results for dynamic image processing

I’ve been improving imagor’s handling of streamed image sources and its libvips image loading path, and updated the benchmark page with current releases. If you work on image delivery, dynamic resizing, or URL-based image processing in web stacks, the updated benchmark summary is here: Benchmark page: https://docs.imagor.net/benchmarks imagor repo: https://github.com/cshum/imagor These results use released versions of imagor, imgproxy, and thumbor. The benchmark page includes summary charts, and the benchmark repo includes committed result summaries for anyone who wants to inspect the setup more closely. Happy to discuss the implementation changes, benchmark setup, or what additional scenarios would be useful to measure. submitted by /u/cshum [link] [留言]

/u/cshum 2026-06-06 13:37 6 原文
开发者 InfoQ

Cloudflare Identifies Query Planning Bottleneck in ClickHouse

Cloudflare recently described how a slowdown in its billing pipeline was traced to contention inside the query planning stage of ClickHouse. The team profiled the bottleneck and patched ClickHouse to replace an exclusive lock with a shared lock, drop the per-query copy of the parts list, and improve part filtering. By Renato Losio

Renato Losio 2026-06-06 12:55 13 原文
AI 资讯 HackerNews

Ask HN: Does robotics capabilities research accelerate AGI timelines?

For context, I am a final-year math + CS undergraduate considering pursuing a career in theoretical robotics, particularly in continual learning and the development of robots that can learn from and adapt to / navigate their environments in a human-like manner. One concern I have, however, is that such research might advance AGI timelines. Specficially, it seems possible that architectures developed for continual learning in robots could transfer to general AGI systems (even if the AGI systems a

themasterchief 2026-06-06 12:51 5 原文
开发者 Reddit r/webdev

[Showoff Saturday] Sharing my Drake Equation interactive exploration: 3D galaxy, real-time sliders, vanilla JS

Just wanted to share this Drake Equation exploration I've been working on. You tweak the parameters and it updates the civilization count instantly, with a 3D Milky Way you can explore, charts, NASA exoplanet data, and bilingual EN/ES. Built with vanilla JS + Three.js, no frameworks. https://mendiak.github.io/drake.equation/ submitted by /u/mendiak_81 [link] [留言]

/u/mendiak_81 2026-06-06 12:33 7 原文