AI 资讯
Privacy First: Build Your Own Local Mental Health Assistant with Llama 3 and Apple MLX
When it comes to our deepest thoughts, secrets, and mental health struggles, "the cloud" can feel like a very crowded place. In an era where data privacy is paramount, sending your private journal entries to a central server for analysis feels... risky. But what if you could have the power of a world-class LLM like Llama 3 running entirely on your MacBook? Thanks to the Apple MLX framework, local LLM execution is no longer a pipe dream—it’s a high-performance reality. By leveraging privacy-preserving AI and advanced Llama 3 quantization , we can build a personal mental health assistant that provides Cognitive Behavioral Therapy (CBT) insights without a single byte ever leaving your machine. 🚀 Why Apple MLX? 🍏 Apple's MLX is an array framework designed specifically for machine learning on Apple Silicon. It’s essentially "NumPy meets PyTorch," but optimized to squeeze every drop of power out of your M1/M2/M3 chip's Unified Memory Architecture. The Architecture: 100% Local Data Flow Here is how our private assistant handles your data. Notice the absence of any "External API" or "Cloud Storage" blocks: graph TD A[User Private Journal Entry] --> B{Local Python App} B --> C[Apple MLX Framework] C --> D[Quantized Llama 3 - 4bit/8bit] D --> E[CBT Sentiment Analysis] E --> F[Empathetic CBT Feedback] F --> B B --> G[Local Encrypted Storage] subgraph MacBook Pro / Air C D E end Prerequisites 🛠️ To follow this advanced guide, you’ll need: An Apple Silicon Mac (M1, M2, M3 series). Python 3.10+ . mlx-lm : The high-level library for running LLMs with MLX. Step 1: Setting Up the Environment First, let's create a virtual environment and install our dependencies. We are using mlx-lm because it handles the complexities of quantization and model loading seamlessly. mkdir private-mental-health-ai && cd private-mental-health-ai python -m venv venv source venv/bin/activate pip install mlx-lm huggingface_hub Step 2: Downloading & Quantizing Llama 3 Llama 3 8B is a powerhouse, but it's a bi
AI 资讯
Why I scrub AI prose with regex, not a second LLM
Written by Stephanie Dover, Software Engineer 10+ YOE, ex GitHub, Twitch, Microsoft. Creator of Klaussy. LinkedIn · GitHub · Klaussy Desktop · Klaussy Agents TL;DR klaussy-agents is a free, MIT-licensed CLI ( pip install klaussy-agents ) that makes the prose an AI coding agent writes, PR comments, review notes, commit messages, read like a person wrote them. It works in two layers: a humanization spec baked into the agent's skills so it writes clean prose up front, and a deterministic klaussy humanize pass that scrubs the output afterward. The scrubber is rule-based regex, not an LLM, and it never touches code. There's also a part I didn't expect going in: once the AI tells are gone, what's left can read curt and run long, so the spec also handles tone (don't be rude) and length (one sentence for a reply, one to five for a review comment). Repo: github.com/steph-dove/klaussy-agents. The problem You can spot AI-written text now. Everyone can. And the place it grates most is a code review comment or a commit message, where the prose sits next to your name in a thread your teammates read. The tells are consistent. The em-dash is the biggest one. Right behind it: filler openers like "It's worth noting that…" and "I wanted to point out that…", chatbot scaffolding like "Hope this helps!" and "Let me know if you have questions!", and stacked hedges like could potentially . An agent that leaves those in your PR reads like a bot, and people notice. The obvious fix is to tell the model not to do it. Add "don't sound like AI" to the prompt and move on. That helps, inconsistently, and it regresses silently the moment you change the model or the prompt drifts. Editing every comment by hand works too, but hand-editing every comment defeats the point of having an agent write them. I wanted something I could trust without rereading. Why "just tell the model" wasn't enough The honest answer to "why not just prompt for it" is: a prompt asks, it doesn't enforce. The model tries to com
AI 资讯
YINI Config Format Specification RC 6 released - clearer strings, stricter parsing, and growing tooling ecosystem
YINI Specification RC 6 is now released The YINI configuration format has reached Specification Release Candidate 6 . YINI is a configuration format designed to feel familiar if you like INI-style files, but designed to bring more explicit structure, clarity, useful data types, and predictable parsing rules to real-world configuration needs.. The short version: @yini ^ App name = "Example" version = "1.0.0" debug = false ^^ Server host = "127.0.0.1" port = 8080 ^^ Features enabled = [ "auth", "logging", "metrics", ] YINI tries to sit somewhere between classic INI, JSON, TOML, and YAML: More structured than traditional INI. Less punctuation-heavy than JSON. Indentation-insensitive unlike YAML. Explicit about parsing rules and validation behavior. RC 6 is an important release because it tightens several parts of the language and moves the format closer to a stable 1.0 specification. What changed in RC 6? RC 6 includes a number of syntax and behavior updates. The main theme is the same as before: Make the format clear for humans, but deterministic for parsers. Here are some of the notable updates. Clearer section markers YINI uses section markers to define structure. ^ App name = "MyApp" ^^ Server host = "localhost" ^^^ TLS enabled = true The number of section markers defines the nesting level. This keeps hierarchy visible without relying on indentation. The primary section marker is: ^ YINI also supports alternative section markers, but ^ remains the recommended default for most files and examples. Strict and lenient mode behavior is more clearly defined YINI has two parsing modes: Lenient mode — practical, forgiving, and intended as the default. Strict mode — validation-focused and intended for stricter tooling, CI checks, and production-sensitive configuration. A file can declare its intended mode: @yini strict or: @yini lenient RC 6 clarifies how these declarations should behave when the file is parsed in a different mode. The goal is to avoid silent surprises. If
AI 资讯
Metadata Routing
Stop Fighting Scikit-Learn Pipelines: How Metadata Routing Fixes Sample Weights & Groups A couple of months ago, I stumbled upon this video by Vincent D. Warmerdam about metadata routing in scikit-learn. I'll be honest, I had no idea what "metadata routing" even meant, but Vincent's explanation completely changed how I think about building ML pipelines. The video showed me that one of the most frustrating problems in scikit-learn; passing sample weights and groups through complex pipelines finally had an elegant solution. It piqued my curiosity enough that I dove deep into the feature, tested it extensively, and honestly, I was surprised by how little coverage this gets in technical blogs and articles. So I figured, why not write about it myself and share what I learned? If you've ever struggled with imbalanced datasets, grouped cross-validation, or just wanted to pass custom information through your pipelines, this article is for you. Let's start from the very beginning. What is "Metadata" in Machine Learning? Let's start with a concrete example. You're building a credit card fraud detection model with this data: # Your training data X = transaction_features # Amount, merchant, time, location, etc. y = is_fraud # 0 = legitimate, 1 = fraud # But you also have additional information: sample_weights = [ 1.0 , 1.0 , 10.0 , 1.0 , ...] # Fraud transactions weighted 10x customer_ids = [ 101 , 102 , 101 , 103 , ...] # Which customer made each transaction Metadata is the "extra information" beyond your features (X) and labels (y): sample_weight : How important is each transaction? (Fraud = 10x more important) groups : Which customer does each transaction belong to? (For proper cross-validation) Custom metadata : Transaction timestamps, confidence scores, data quality flags, etc. Why Metadata Matters: The Credit Card Fraud Problem Imagine you're building a fraud detection system for a financial company. You have: Imbalanced data : 99% legitimate transactions, 1% fraudulent T
开源项目
🔥 public-apis / public-apis - A collective list of free APIs
GitHub热门项目 | A collective list of free APIs | Stars: 442,738 | 408 stars today | 语言: Python
开源项目
🔥 santinic / audiblez - Generate audiobooks from e-books
GitHub热门项目 | Generate audiobooks from e-books | Stars: 7,750 | 151 stars today | 语言: Python
开源项目
🔥 VectifyAI / OpenKB - OpenKB: Open LLM Knowledge Base
GitHub热门项目 | OpenKB: Open LLM Knowledge Base | Stars: 2,349 | 208 stars today | 语言: Python
开源项目
🔥 stanford-oval / storm - An LLM-powered knowledge curation system that researches a t
GitHub热门项目 | An LLM-powered knowledge curation system that researches a topic and generates a full-length report with citations. | Stars: 28,738 | 199 stars today | 语言: Python
开源项目
🔥 K-Dense-AI / scientific-agent-skills - Turn any AI agent into an AI Scientist. The #1 Agent Skills
GitHub热门项目 | Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 160,000+ scientists worldwide. 140 ready-to-use skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard. | Stars: 28,736 | 174 stars today | 语言: Python
AI 资讯
How to Access 50+ Chinese AI Models Through One API
How to Access 50+ Chinese AI Models Through One API The Chinese AI ecosystem exploded in 2025-2026. DeepSeek dropped training costs by an order of magnitude. Qwen 3 ships 19 variants from 0.6B to 235B parameters. GLM-5 competes head-to-head with GPT-5 at 3% of the price. There's Kylin, Yi-Lightning, Hunyuan-T1, MiniMax-M1, Step-2-16K, and 40+ more models from a dozen labs. The models are incredible. The fragmentation is not. Every lab has its own API. Different auth headers. Different response formats. Different streaming protocols. Different error codes. If you wanted to try 5 models from 5 Chinese labs last year, you'd need 5 SDKs and 5 billing dashboards. Nobody has time for that. This is exactly the problem AIWave was built to solve. One API Key. 50+ Models. Zero Code Changes. AIWave is a unified API gateway that aggregates 50+ Chinese AI models behind a single endpoint. It speaks the OpenAI API format, which means every existing tool, SDK, and codebase in your stack works without modification. Here's what that looks like in practice: from openai import OpenAI # Point to AIWave instead of OpenAI client = OpenAI ( base_url = " https://api.aiwave.live/v1 " , api_key = " sk-your-aiwave-key " ) # Use DeepSeek V4 Pro response = client . chat . completions . create ( model = " deepseek-v4-pro " , messages = [{ " role " : " user " , " content " : " Explain MoE architecture " }] ) # Switch to GLM-5 — change one string response = client . chat . completions . create ( model = " glm-5 " , messages = [{ " role " : " user " , " content " : " Explain MoE architecture " }] ) # Try Qwen 3 235B — same thing response = client . chat . completions . create ( model = " qwen3-235b " , messages = [{ " role " : " user " , " content " : " Explain MoE architecture " }] ) That's it. Whatever you're already using — the OpenAI Python SDK, LangChain, LlamaIndex, Vercel AI SDK, a custom fetch wrapper — continues to work. You change the base URL and the model name, and suddenly you have acce
开发者
String Methods, Conditional Statements (if/elif/else), Loops (for, range())
🐍 Python for DevOps — Class 5 Notes Topic: String Methods, Conditional Statements ( if/elif/else ), Loops ( for , range() ) 📌 Key Concepts Overview Concept One-Line Definition String Methods Built-in functions to inspect and transform strings if / elif / else Execute code blocks based on conditions for loop Iterate over any iterable — string, list, range, dict range() Generate a sequence of numbers to loop over Nested if An if block inside another if block Nested for A for loop inside another for loop 🔤 Part 1 — String Methods (Continuation from Class 4) Checking String Case # islower() — True if ALL characters are lowercase ' devops ' . islower () # True ' Devops ' . islower () # False # isupper() — True if ALL characters are uppercase ' DEVOPS ' . isupper () # True ' Devops ' . isupper () # False # Practical: normalize before comparing env = input ( ' Enter environment: ' ) if env . lower () == ' production ' : print ( ' ⚠️ Deploying to PROD! ' ) Checking Digit / Numeric Strings Method Accepts Rejects DevOps Use isdecimal() 0-9 only decimals, superscripts Port validation isdigit() 0-9 + superscripts decimal points Version numbers isnumeric() 0-9 + superscripts + fractions decimal points Broadest check # Key difference — decimal point breaks all three ' 8080 ' . isdecimal () # True ' 8080 ' . isdigit () # True ' 8080 ' . isnumeric () # True ' 80.80 ' . isdecimal () # False — dot is not a digit ' 80.80 ' . isdigit () # False ' 80.80 ' . isnumeric () # False # DevOps use: validate user input before casting port_input = input ( ' Enter port: ' ) if port_input . isdecimal (): port = int ( port_input ) else : print ( ' ❌ Invalid port — must be a whole number ' ) replace() — Find and Replace in Strings # str.replace('old', 'new') ' Python ' . replace ( ' P ' , ' J ' ) # 'Jython' ' prod-server-01 ' . replace ( ' - ' , ' _ ' ) # 'prod_server_01' ' This is python class ' . replace ( ' i ' , ' a ' ) # 'Thas as python class' — ALL occurrences # DevOps: sanitize strings for us
AI 资讯
# Building an AI-Powered Carbon Footprint Awareness Platform with Flask, SQLite, and Groq (Llama 3.1)
🌿 Introduction As climate awareness grows, individuals are looking for actionable ways to reduce their personal carbon footprints. However, most carbon calculators are either too complex or offer generic, unhelpful advice. To solve this, I built CarbonWise —a production-ready Carbon Footprint Awareness Platform. It combines deterministic scientific carbon calculations with real-time, personalized AI reduction strategies using the Groq LLM API. Here is a technical deep-dive into how I built, secured, and optimized this application for the PromptWars: Virtual challenge. 🏗️ Architecture & System Design The application is designed to be lightweight, secure, and highly performant, avoiding heavy framework overhead. System Data Flow ┌──────────────────────────────────────────────────────────┐ │ User Browser │ └─────────────┬──────────────────────────────▲─────────────┘ │ HTTPS (POST / GET) │ Rendered HTML/CSS ┌─────────────▼──────────────────────────────┴─────────────┐ │ Flask App (app.py) │ └─────────────┬──────────────┬───────────────▲─────────────┘ │ │ │ ┌─────────────▼──────────┐ ┌─▼─────────────┐ │ │ SQLite DB (carbon.db) │ │Secure Session │ │ │ - Users & Logs │ │ Cookies │ │ │ - WAL Mode Enabled │ └───────────────┘ │ └────────────────────────┘ │ Structured JSON Insights ┌────────────────────────────────────────────┴─────────────┐ │ Groq API (Llama 3.1) │ │ - Model: llama-3.1-8b-instant │ └──────────────────────────────────────────────────────────┘ Backend : Flask (Python) handles routing, user session state, and database operations. Database : SQLite manages users and logs. We activated WAL (Write-Ahead Logging) mode to enable concurrent reads and writes. AI Engine : Connects to the Groq API using the ultra-fast Meta Llama 3.1 8B model ( llama-3.1-8b-instant ). Frontend : Rendered server-side with Jinja2 templates and styled with a custom dark-mode glassmorphism design system in Vanilla CSS. ⚙️ Feature Deep-Dive 1. Deterministic Carbon Calculations ( carbon_engine.p
AI 资讯
The hard part of national ID OCR isn't the OCR
You wire up OCR for your KYC flow, point it at a national ID card, and get back a clean { name, idNumber, dateOfBirth } . Ship it. Then you onboard your second country — and it falls apart. Fields you mapped don't exist. The name comes back as garbled Latin. The date of birth says the year 2567. Here's the thing nobody tells you when you start: the hard part of national ID OCR isn't the OCR. It's that every country's ID is a different document. A model that reads text off a card is table stakes. Turning 30 countries' cards into data your system can actually use is where the work is. Let me show you the three axes of variation that will bite you, then how to architect so they don't. Axis 1: the fields are different There is no universal "national ID" schema, because the cards themselves don't agree on what to print. A Thai ID card prints the holder's religion . A German ID card prints height and eye color . A Chinese ID card prints ethnicity and the issuing authority. None of these are edge cases — they're core fields on those documents. So the instinct to define one IdCard type with a fixed set of columns is wrong from day one. Either you drop information that some countries consider essential, or you end up with a sparse table full of null s and country-specific special-casing. And it's not just which fields exist — it's what they're called and how they're split. The same "name" concept might come back as a single full-name string on one card and as separate given/family fields on another, sometimes in two scripts at once. Your data model has to treat "the field set depends on the country" as a first-class fact, not an afterthought. Axis 2: the script is different If your users are global, a lot of their names are not in the Latin alphabet — Chinese, Thai, Arabic, and more. The naive move is to transliterate everything to Latin "so it's consistent." Don't. Transliteration is lossy and ambiguous: multiple native spellings collapse to the same Latin form, diacritics
开源项目
🔥 yifanfeng97 / Hyper-Extract - Transform unstructured text into structured knowledge with L
GitHub热门项目 | Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command. | Stars: 1,723 | 124 stars today | 语言: Python
AI 资讯
AI Observability for Lovable Apps: Monitor, Test, and Improve Prompts with Currai
AI Observability for Lovable Apps: Monitor Prompts, Traces, and Evaluations with Currai Building AI applications has never been easier. Tools like Lovable allow developers and founders to create AI-powered products in minutes. Whether you're building a chatbot, AI assistant, recommendation engine, AI agent, or prediction app, generating the application is often the easy part. The real challenge starts after launch. How do you know what prompts are being sent to the model? How do you debug unexpected AI responses? How do you compare prompt variations and determine which performs better? How do you evaluate output quality over time? How do you track token usage and costs? This is exactly why we built Currai . What is Currai? Currai is an AI observability platform that helps teams understand, test, and improve AI applications in production. It provides: Prompt tracing AI request monitoring Session tracking Prompt versioning A/B testing LLM evaluations Cost and token analytics OpenTelemetry support Instead of guessing why your AI application produced a particular response, Currai lets you inspect the entire execution flow. The Problem With AI Applications Traditional monitoring tools were built for APIs, databases, and backend services. AI applications introduce a completely different set of challenges: Prompt changes can significantly impact output quality Model updates can affect behavior Hallucinations are difficult to track User conversations are hard to debug Prompt experiments are often unmanaged Quality evaluation is usually manual When something goes wrong, application logs alone don't provide enough visibility. You need observability designed specifically for AI systems. Trace Every AI Request Currai captures every prompt, model response, latency metric, token usage, and cost. You can inspect: System prompts User prompts Model outputs Execution traces Tool calls Metadata This makes debugging AI applications dramatically easier. Run Prompt A/B Tests Prompt engin
AI 资讯
The Cheaper API Was 2.5x Cheaper. It Cost 1.6x More.
AI-disclosure: AI-assisted draft, human-reviewed. The demo numbers are the verbatim stdout of a deterministic, stdlib-only Python script included in full below — re-run it and you get the same bytes. The attempt counts in that script are a SYNTHETIC fixture I chose to exercise the accounting mechanism, calibrated to the retry skew I see in my own scraper logs (run counts from my Apify history). It is NOT a benchmark of any named vendor's API or prices. The one external claim (the cost-per-successful-task formula) is attributed and linked. The cheaper API was 2.5x cheaper per call. The monthly bill came in higher anyway. Not by a rounding error. The "cheap" option cost 1.63x more per successful task than the one with the bigger sticker price. Same workload. The price page never showed me that number, because the price page doesn't know your success rate. You do — after you've already paid. This is the arithmetic the per-call price hides. And it's a decision you make before you spend, not a cap you bolt on after. TL;DR You compare two API tiers by per-call (or per-token) price and pick the cheaper one. That ranking can be wrong. You pay for every attempt — success or fail. The denominator that pays the bills is successful tasks , not calls. True cost = price_per_attempt × attempts ÷ successes . A cheap tier with a low success rate burns its discount on retries. In the run below: cheap tier $0.0020 /call but $0.0096 /success; robust tier $0.0050 /call but $0.0059 /success. The sticker winner loses . For anyone choosing an API, model, or tier for an agent: log attempts and successes for a week, divide, then decide. A 70-line script is at the bottom — drop in your numbers. The price page is a sticker, not a bill Here's the trap, stated plainly. The number on the pricing page is per call . The number on your invoice is per call too — but the value you got is per successful task . Those are different denominators, and the gap between them is exactly the work that failed. E
开源项目
🔥 frappe / frappe - Low code web framework for real world applications, in Pytho
GitHub热门项目 | Low code web framework for real world applications, in Python and Javascript | Stars: 10,263 | 59 stars this week | 语言: Python
开源项目
🔥 google / agents-cli - The CLI and skills that turn any coding assistant into an ex
GitHub热门项目 | The CLI and skills that turn any coding assistant into an expert at creating, evaluating, and deploying AI agents on Google Cloud. | Stars: 2,973 | 197 stars this week | 语言: Python
开源项目
🔥 microsoft / qlib - Qlib is an AI-oriented Quant investment platform that aims t
GitHub热门项目 | Qlib is an AI-oriented Quant investment platform that aims to use AI tech to empower Quant Research, from exploring ideas to implementing productions. Qlib supports diverse ML modeling paradigms, including supervised learning, market dynamics modeling, and RL, and is now equipped with https://github.com/microsoft/RD-Agent to automate R&D process. | Stars: 44,719 | 144 stars today | 语言: Python
开源项目
🔥 anthropics / financial-services
GitHub热门项目 | | Stars: 31,754 | 480 stars today | 语言: Python