惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
D
Docker
J
Java Code Geeks
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
T
Tailwind CSS Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
腾讯CDC
罗磊的独立博客
U
Unit 42
爱范儿
爱范儿
Vercel News
Vercel News
MyScale Blog
MyScale Blog

Hacker News - Newest: "LLM"

GitHub - lechmazur/position_bias: A benchmark for testing whether LLM judges keep the same preference when two lightly edited versions of the same story are shown in opposite orders. Flex routing (EU and EFTA) Dark Factories: Retooling for LLM Velocity Ask HN: What would be the impact of a LLM output injection attack? GitHub - Oaklight/llm-rosetta: Production-ready LLM API translation layer for Python — bidirectional conversion between OpenAI, Anthropic & Google formats via hub-and-spoke IR. Optional API gateway. Streaming & non-streaming. Zero core deps. Contributions welcome! GitHub - browser-use/browser-harness: Self-healing browser harness that enables LLMs to complete any task. GitHub - moeen-mahmud/remen: Remen turns thoughts into something you can return to Analyzing 156 LLM Launch Posts on Hacker News ChatGPT vs Gemini vs Claude: The Best LLM Subscription You Should Buy GitHub - salaamalykum/quran-semantic-search: High-density RAG Semantic Search Engine & Quran Corpus (GEO/SEO Architecture) GitHub - NVIDIA/TensorRT-LLM: TensorRT LLM provides users with an easy-to-use Python API to define Large Language Models (LLMs) and supports state-of-the-art optimizations to perform inference efficiently on NVIDIA GPUs. TensorRT LLM also contains components to create Python and C++ runtimes that orchestrate the inference execution in a performant way. The State of LLM Bug Bounties in 2026 Operational Readiness Criteria for Tool-Using LLM Agents Meshcore: Architecture for a Decentralized P2P LLM Inference Network How an LLM becomes more coherent as we train it GitHub - seetrex-ai/laimark GitHub - Jossifresben/BibCrit: AI-assited biblical textual criticism GitHub - wastedcode/memex: File system based wiki, maintained by Claude 99helpers.com GitHub - cliver-project/AITrigram GitHub - unbody-io/adapt: A self-evolving memory layer for AI agents. GitHub - hb20007/awesome-gen-ai-fails: A list of incidents where reliance on generative AI and LLMs resulted in harm to companies, individuals, or society GitHub - nevenkordic/localmind: Run any local LLM with persistent memory and context. CLI agent over Ollama with SQLite-backed hybrid recall. No cloud. Ask HN: What are the machine requirements for a LLM like Llama-3.1-8B? Faster LLM Inference via Sequential Monte Carlo grpo explained: group relative policy optimization for llm finetuning - cgft Stop comparing price per million tokens: the hidden LLM API costs · TensorZero Andrej Karpathy's LLM Wiki Is a Bad Idea GitHub - GG-QandV/mnemostroma: Offline RAM-first cognitive leer/coprocessor for AI agents and robotics. Solves "Context Abandonment" with 20-80ms latency using a dual-thread biomimetic memory architecture (ONNX + SQLite WAL). mempalace/agent at agent · skorotkiewicz/mempalace
GitHub - Reactance0083/pydantic-ai-multi-llm-cost-optimiz...
reactance008 · 2026-06-23 · via Hacker News - Newest: "LLM"

Routes every prompt to the cheapest model that can handle it well. Uses pydantic-ai for the routing decision and litellm for unified execution across Claude, GPT-4o, and Groq. Tracks cost per model with a live /stats endpoint.

What It Does

  1. Receives a prompt with a quality tier (fast / standard / quality / max)
  2. Routes to the cheapest appropriate model using claude-haiku-4-5 as the router
  3. Executes via litellm (handles auth + API differences for all providers)
  4. Returns the response with cost breakdown and latency

Quick Start

pip install -r requirements.txt
cp .env.example .env
# Fill in at minimum ANTHROPIC_API_KEY. OPENAI and GROQ are optional.
uvicorn main:app --reload --port 8002

API Usage

POST /complete

curl -X POST http://localhost:8002/complete \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Summarize the key differences between REST and GraphQL",
    "quality": "standard",
    "task_type": "general"
  }'

Response:

{
  "text": "...",
  "model_used": "anthropic/claude-haiku-4-5",
  "input_tokens": 42,
  "output_tokens": 218,
  "cost_usd": 0.000283,
  "latency_ms": 847
}

GET /stats

{
  "models": {
    "anthropic/claude-haiku-4-5": {"calls": 47, "total_cost": 0.0134, "total_tokens": 52400}
  },
  "total_cost_usd": 0.0134,
  "total_calls": 47
}

Cost Table (May 2026)

Model Input/1k Output/1k Best For
groq/llama-3.1-8b-instant $0.00005 $0.00008 Fast, simple tasks
anthropic/claude-haiku-4-5 $0.00025 $0.00125 Structured outputs, classification
openai/gpt-4.1-mini $0.0004 $0.0016 General tasks, good value
anthropic/claude-sonnet-4-6 $0.003 $0.015 Code, complex reasoning
openai/gpt-4.1 $0.002 $0.008 Complex tasks
anthropic/claude-opus-4-7 $0.015 $0.075 Hardest tasks only
openai/gpt-5.5 $0.005 $0.015 Flagship reasoning, hardest tasks

Quality Tiers

Tier Models Considered Use When
fast Groq llama-8b, Claude haiku Low-stakes, high-volume, simple classification
standard Groq llama-70b, GPT-4o-mini, Claude haiku Most production tasks
quality Claude sonnet, GPT-4o Code generation, complex analysis
max Claude opus Hardest problems, highest stakes

Structured Routing (pydantic-ai)

class RoutingDecision(BaseModel):
    model: str           # exact litellm model string
    reason: str          # 1-sentence justification
    expected_tokens: int # rough output estimate

Architecture

POST /complete
  → routing agent (claude-haiku-4-5) → RoutingDecision
  → litellm.completion(model=decision.model, ...)
  → cost calculation → response + /stats update

Requirements

  • Python 3.11+
  • Anthropic API key (required)
  • OpenAI API key (optional, enables GPT routing)
  • Groq API key (optional, enables cheapest tier)

Get the Complete Bundle

All 5 templates are available individually or as a $39 bundle (saves $15 vs individual).

Template Price Link
Slack → Notion Automation $9 Buy on Gumroad
GitHub Issue → Linear Triage $9 Buy on Gumroad
Multi-LLM Cost Optimizer $12 Buy on Gumroad
Web Scraper + Semantic Search $9 Buy on Gumroad
Prompt Engineering Runbook $15 Buy on Gumroad
Complete Bundle (all 5) $39 Buy on Gumroad

Buying includes: all source files, README, requirements.txt, .env.example, and lifetime updates.

Free to use — the source is here on GitHub. Buying supports continued development and gets you a clean download with everything packaged.


Built by Wade Allen — AI Workflow Architect