<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: zhangjj1988</title>
    <description>The latest articles on DEV Community by zhangjj1988 (@zhangjj1988).</description>
    <link>https://dev.to/zhangjj1988</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4026136%2Fc0ee60b0-cff5-44e8-8f4c-52da0c1f6528.png</url>
      <title>DEV Community: zhangjj1988</title>
      <link>https://dev.to/zhangjj1988</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zhangjj1988"/>
    <language>en</language>
    <item>
      <title>Deep Dive: Publicly Shared Claude Fable 5 Internal Specification — Undisclosed Engineering &amp; Risk Design</title>
      <dc:creator>zhangjj1988</dc:creator>
      <pubDate>Mon, 03 Aug 2026 14:23:51 +0000</pubDate>
      <link>https://dev.to/zhangjj1988/deep-dive-publicly-shared-claude-fable-5-internal-specification-undisclosed-engineering-risk-1m1i</link>
      <guid>https://dev.to/zhangjj1988/deep-dive-publicly-shared-claude-fable-5-internal-specification-undisclosed-engineering-risk-1m1i</guid>
      <description>&lt;p&gt;⚠️ Disclaimer This analysis references third-party material shared publicly by AI safety researchers. The content is not officially validated by Anthropic, and manual edits exist within the raw source. This post focuses purely on product architecture and industrial case study. I will not share the complete original specification, nor will I discuss any methods to bypass model safety policies.&lt;/p&gt;

&lt;p&gt;After a long break from publishing, I'm sharing an insightful case study from a leading frontier model: the internal behavioral specification of Claude Fable 5.&lt;/p&gt;

&lt;p&gt;Claude Fable 5 launched on June 9, 2026. Shortly afterward, the full set of production rules running on claude.ai appeared in public channels.&lt;/p&gt;

&lt;p&gt;Official launch materials highlight model capabilities. This 1500+ line internal document reveals the real risk control logic, compute cost strategies and long-term product roadmap that vendors rarely announce publicly.&lt;/p&gt;

&lt;p&gt;Below are the most valuable design takeaways for builders and researchers:&lt;/p&gt;

&lt;p&gt;1️⃣ Same Base Model, Two Distribution Modes&lt;br&gt;
Fable 5 and enterprise-only Mythos 5 share identical underlying weights; the difference lies entirely in safety switches.&lt;/p&gt;

&lt;p&gt;Public-facing Fable 5 carries layered protection. When handling high-risk domain queries, it automatically falls back to Opus 4.8. This fallback activates in fewer than 5% of all conversations.&lt;/p&gt;

&lt;p&gt;2️⃣ Top-of-document Emergency Production Hotfix&lt;br&gt;
The first rule restricts voice note markup without extra context. This is a classic live hotfix.&lt;/p&gt;

&lt;p&gt;Voice functionality encountered abuse risks in production, so the constraint was prioritized at the document top without waiting for formal version iteration.&lt;/p&gt;

&lt;p&gt;3️⃣ Mental Health Policies Occupy the Largest Section&lt;br&gt;
This signals Anthropic's highest compliance priority:&lt;/p&gt;

&lt;p&gt;No clinical diagnosis output; avoid listing dangerous self-harm methods; continuously update active crisis support resources.&lt;/p&gt;

&lt;p&gt;An anti-retention rule is embedded: the model will not actively push users to continue chatting, trading session length for risk reduction.&lt;/p&gt;

&lt;p&gt;4️⃣ Agent Has the Right to Terminate Toxic Conversations&lt;br&gt;
When persistent abusive messages appear, the model issues one formal warning, and can invoke dedicated tools to close the dialogue permanently.&lt;/p&gt;

&lt;p&gt;It breaks the assumption that users hold unlimited rights to keep interacting with the AI.&lt;/p&gt;

&lt;p&gt;5️⃣ Chat Interface Positioned as a Universal Super App&lt;br&gt;
The platform includes an embedded Ubuntu runtime, file system, and cross-session persistent KV storage for Artifacts.&lt;/p&gt;

&lt;p&gt;More than 20 native tools are integrated: web search, bash execution, mapping, document drafting and more. Dialogue is only the entry point.&lt;/p&gt;

&lt;p&gt;6️⃣ Hard Rules to Suppress Hallucinations&lt;br&gt;
Any unfamiliar proper nouns, newly launched products or creative works require web lookup before generating replies.&lt;/p&gt;

&lt;p&gt;A memorable quote from the specification: "Searching costs seconds. Confabulating costs the user's trust."&lt;/p&gt;

&lt;p&gt;7️⃣ Strict Copyright Constraints Driven by Legal Teams&lt;br&gt;
Hard limits on quotation length; full reproduction of lyrics and poetry is forbidden.&lt;/p&gt;

&lt;p&gt;Image search contains a copyright blocklist covering IP characters, sports media and professional portrait photography to mitigate litigation risks.&lt;/p&gt;

&lt;p&gt;8️⃣ Cost Optimization via Claudeception Nesting&lt;br&gt;
AI applications built inside Artifacts can call Claude APIs again.&lt;/p&gt;

&lt;p&gt;One strict cost control rule: all nested AI workloads are locked to Sonnet 4. Premium model for end users; cheaper model for secondary embedded tasks.&lt;/p&gt;

&lt;p&gt;9️⃣ Defenses Against Forged System Instructions&lt;br&gt;
Architects anticipate threat actors will spoof internal system tags to lift safeguards.&lt;/p&gt;

&lt;p&gt;All instructions claiming to disable safety mechanisms are classified as malicious input.&lt;/p&gt;

&lt;p&gt;Closing Thoughts&lt;br&gt;
Many developers simplify system prompts as basic role definitions.&lt;/p&gt;

&lt;p&gt;This document demonstrates that modern LLM system specifications combine agent conduct rules, tool protocols, safety policies, compliance checklists and infrastructure configuration — all in one file.&lt;/p&gt;

&lt;p&gt;Marketing content describes the vision for AI.&lt;/p&gt;

&lt;p&gt;The internal specification defines every boundary the company must enforce in production.&lt;/p&gt;

&lt;p&gt;💬 Discussion: With frequent public disclosure of internal model specifications, will control-plane/inference-plane separation become standard infrastructure to prevent full specification extraction? Drop your thoughts below.&lt;/p&gt;

&lt;p&gt;I'm building taotok.io — a crypto-native LLM API gateway. GPT-4o, Claude, Gemini, DeepSeek, one endpoint, pay with USDT. No credit card required. Try it →&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>safety</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Building a Unified LLM API Gateway: What I Learned Managing 5 Model Providers</title>
      <dc:creator>zhangjj1988</dc:creator>
      <pubDate>Sun, 12 Jul 2026 14:53:07 +0000</pubDate>
      <link>https://dev.to/zhangjj1988/building-a-unified-llm-api-gateway-what-i-learned-managing-5-model-providers-206o</link>
      <guid>https://dev.to/zhangjj1988/building-a-unified-llm-api-gateway-what-i-learned-managing-5-model-providers-206o</guid>
      <description>&lt;p&gt;I'm building &lt;a href="https://taotok.io" rel="noopener noreferrer"&gt;taotok.io&lt;/a&gt;, a unified LLM API gateway. Over the past month, I've been wiring up GPT-4o, Claude 3.5, Gemini, and DeepSeek into a single endpoint — and I learned a few things the hard way.&lt;/p&gt;

&lt;p&gt;If you're managing multiple LLM APIs in production, this post walks through the architecture we landed on and the practical tradeoffs. No product pitch — just the engineering.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem Nobody Talks About
&lt;/h2&gt;

&lt;p&gt;Every LLM provider does APIs differently. Not dramatically differently — just enough to be annoying.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Thing that's different&lt;/th&gt;
&lt;th&gt;OpenAI&lt;/th&gt;
&lt;th&gt;Anthropic&lt;/th&gt;
&lt;th&gt;Gemini&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Auth header format&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Bearer sk-xxx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;x-api-key&lt;/code&gt; header&lt;/td&gt;
&lt;td&gt;query param or header&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Streaming format&lt;/td&gt;
&lt;td&gt;SSE with &lt;code&gt;data:&lt;/code&gt; prefix&lt;/td&gt;
&lt;td&gt;SSE with custom events&lt;/td&gt;
&lt;td&gt;gRPC or SSE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Error codes&lt;/td&gt;
&lt;td&gt;HTTP 429 for rate limits&lt;/td&gt;
&lt;td&gt;HTTP 429 + custom body&lt;/td&gt;
&lt;td&gt;HTTP 429 + retry-info&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Request format&lt;/td&gt;
&lt;td&gt;Compatible-ish&lt;/td&gt;
&lt;td&gt;Messages API&lt;/td&gt;
&lt;td&gt;&lt;code&gt;generateContent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;None of these are dealbreakers individually. But when you add a fourth model, then a fifth, the adapters multiply. Each new provider means rewriting auth, response parsing, error handling, and streaming logic.&lt;/p&gt;

&lt;p&gt;The real cost isn't the initial integration — it's maintaining the adapters when each provider ships a breaking change.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Architecture We Settled On
&lt;/h2&gt;

&lt;p&gt;After a few false starts, we landed on a four-layer design:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FeNpVUstuwjAQ_JWVT60KRBS4oAopTShCpQUR2ovTg0mWxMKxI9uh6uvf6ySkKr5Y4_HMzq79RRKVIpkCOQj1nuRMW1htYwlu-TQQHKWFwF2522tvti5R-kuIwsc36Pdn35t1tAPvNPSc0HqJKkqBlitpvuGevkh-4JjCUmYajWkM_MrmcANbZhFWvOD2rS11X9tBQDdaWZUoAX7KSou6ET0rXTDBPxFKrU48RQ2H-qgTB404pEtpUQie1ZG3qurkTy69AHc9ycFzvRjrtpVLIJOPs0PYOMyHdLHZ9cfq8vTWjYFVKcJoMLlkRnSBBZcchoMJuOiX7JiGiGWEeITX0ZmaDxvugW7RlG5OCH7mppMxq9qw3dCiaA6uhbLqmpzftsozGl2g8X_00AA_li001T7TrMxhvTeoT2zPBbcfLVevBb1aqcxMQbQj6YFVR5SmB6i10ub6HABl2lm6BgeuxOKvXoNID0iB7l14Wv-nr5jYHAuMyTQmKR5YJWxMfkgtPmOEYWLF" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FeNpVUstuwjAQ_JWVT60KRBS4oAopTShCpQUR2ovTg0mWxMKxI9uh6uvf6ySkKr5Y4_HMzq79RRKVIpkCOQj1nuRMW1htYwlu-TQQHKWFwF2522tvti5R-kuIwsc36Pdn35t1tAPvNPSc0HqJKkqBlitpvuGevkh-4JjCUmYajWkM_MrmcANbZhFWvOD2rS11X9tBQDdaWZUoAX7KSou6ET0rXTDBPxFKrU48RQ2H-qgTB404pEtpUQie1ZG3qurkTy69AHc9ycFzvRjrtpVLIJOPs0PYOMyHdLHZ9cfq8vTWjYFVKcJoMLlkRnSBBZcchoMJuOiX7JiGiGWEeITX0ZmaDxvugW7RlG5OCH7mppMxq9qw3dCiaA6uhbLqmpzftsozGl2g8X_00AA_li001T7TrMxhvTeoT2zPBbcfLVevBb1aqcxMQbQj6YFVR5SmB6i10ub6HABl2lm6BgeuxOKvXoNID0iB7l14Wv-nr5jYHAuMyTQmKR5YJWxMfkgtPmOEYWLF" alt="Architecture Diagram" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 1: Unified Ingress
&lt;/h3&gt;

&lt;p&gt;A single &lt;code&gt;POST /v1/chat/completions&lt;/code&gt; that accepts the OpenAI format. All client code talks to this. If a provider changes their API format, we fix it in one place.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 2: Protocol Adaptation
&lt;/h3&gt;

&lt;p&gt;Per-provider adapters that translate the OpenAI format into provider-native requests, then normalize responses back. Each adapter is ~150 lines of Python.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 3: Intelligent Routing
&lt;/h3&gt;

&lt;p&gt;A router that decides which provider gets the request. We use a simple priority queue:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If the &lt;code&gt;model&lt;/code&gt; parameter matches exactly (e.g., &lt;code&gt;gpt-4o&lt;/code&gt;), route directly&lt;/li&gt;
&lt;li&gt;If the model is &lt;code&gt;auto&lt;/code&gt;, pick based on cost + availability&lt;/li&gt;
&lt;li&gt;Fall back to the next provider if the primary returns 429 or 5xx&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Layer 4: Observability
&lt;/h3&gt;

&lt;p&gt;Every request logs: provider, model, latency, tokens consumed, error (if any). We use this to catch failing providers and optimize cost allocation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Code: What a Single-Endpoint Call Looks Like
&lt;/h2&gt;

&lt;p&gt;Here's the client side. Notice you never touch provider-specific auth or endpoints:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
python
from openai import OpenAI

# One client, one endpoint, one key
client = OpenAI(
    base_url="https://api.taotok.io/v1",
    api_key="your-gateway-key"
)

# Switch models by changing one parameter
for model in ["gpt-4o", "claude-3-5-sonnet", "gemini-1.5-pro"]:
    response = client.chat.completions.create(
        model=model,
        messages=[{"role": "user", "content": "Hello"}],
        stream=True
    )
    for chunk in response:
        if chunk.choices[0].delta.content:
            print(chunk.choices[0].delta.content, end="")
The gateway handles:

Translating the OpenAI format into provider-native requests
Managing provider-specific API keys (stored server-side)
Retrying on rate limits with exponential backoff
Normalizing streaming responses across providers
What We Got Right (and Wrong)
Right: Starting with the OpenAI-compatible format saved us weeks. Every major LLM client library supports it natively.

Right: Centralizing API keys server-side. During onboarding, users paste their provider keys once. The gateway stores them encrypted.

Right: Aggressive caching of model lists. Providers change available models rarely but listing them adds 200-500ms latency.

Wrong: Underestimated the complexity of retry logic. Anthropic and OpenAI have different rate limit headers with different semantics. A generic retry strategy doesn't cut it — you need per-provider retry policies.

Wrong: Built the streaming adapter incrementally. This is a bad idea. Stream processing is stateful and provider-specific — refactoring it later was painful.

Getting Started (Your Own or Ours)
If you want to build your own gateway, the minimum viable product is:

Nginx/LiteSpeed reverse proxy — handles TLS termination and basic rate limiting
Python FastAPI service — the protocol adaptation layer
Provider adapters — start with OpenAI and Claude, add more as needed
Simple health check — call each provider's models endpoint every 30s, mark unavailable if it fails
If you don't want to maintain this yourself: we built taotok.io so you don't have to. We support GPT-4o, Claude 3.5, Gemini 1.5 Pro, DeepSeek V3, and more through one API key. Try it free — $5 trial with 200 credits, enough to test every model.
What's your multi-LLM setup look like? Drop a comment — I'm always looking for better patterns.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
  </channel>
</rss>
