Build Cost-Effective AI Agent Pipelines with Multiple Chinese LLMs

Published March 10, 2026 · 10 min read

The smartest AI teams don't use one model for everything. They use cheap, fast models for simple tasks and reserve expensive, powerful models for complex reasoning. This "model routing" approach can cut your AI costs by 70-90% while maintaining quality.

With NovAI, you get access to 8+ Chinese AI models through a single API endpoint. This makes it trivially easy to build multi-model pipelines where each step uses the optimal model for the job.

The Architecture: Right Model, Right Task

User Input

[Qwen-Plus — $0.05/1M] → Classify intent & extract entities

Simple query? → [Qwen-Plus] → Direct response (80% of requests)

Complex reasoning? → [DeepSeek-v3.2 — $0.20/1M] → Deep analysis

Long document? → [kimi-api-guide-2026" style="color:#0284c7;text-decoration:underline">Moonshot-128K — $0.60/1M] → Full context analysis

Final Response

In this architecture, 80% of requests hit the cheapest model (Qwen-Plus at $0.05/1M tokens), and only the complex 20% escalate to more expensive models. The result: you get frontier-quality responses at an average cost of about $0.08 per million tokens.

Implementation: The Model Router

from openai import OpenAI

client = OpenAI(
    api_key="nvai-your-api-key",
    base_url="https://aiapi-pro.com/v1"
)

def classify_query(query: str) -> str:
    """Use cheap Qwen-Plus to classify the query."""
    r = client.chat.completions.create(
        model="qwen-plus",
        messages=[
            {"role": "system", "content": "Classify the user query into: SIMPLE, REASONING, or LONG_DOC. Reply with just the category."},
            {"role": "user", "content": query}
        ],
        max_tokens=10
    )
    return r.choices[0].message.content.strip()

def route_and_respond(query: str, context: str = "") -> str:
    """Route to the optimal model based on query type."""
    category = classify_query(query)

    model_map = {
        "SIMPLE": "qwen-plus",        # $0.05/1M — fast & cheap
        "REASONING": "deepseek-v3.2",  # $0.20/1M — strong reasoning
        "LONG_DOC": "moonshot-v1-128k",# $0.60/1M — 128K context
    }

    model = model_map.get(category, "qwen-plus")
    messages = [{"role": "user", "content": query}]

    if context:
        messages.insert(0, {"role": "system", "content": context})

    r = client.chat.completions.create(model=model, messages=messages)
    return r.choices[0].message.content

# Example usage
print(route_and_respond("What's 2+2?"))          # → qwen-plus
print(route_and_respond("Prove the Riemann hypothesis")) # → deepseek

Cost Savings: Real Numbers

Let's say your application handles 100,000 API calls per day with an average of 500 input tokens and 200 output tokens per call:

StrategyDaily CostMonthly Cost
GPT-4o for everything$15.00$450
DeepSeek for everything$1.40$42
Multi-model routing $0.56$17

Multi-model routing on NovAI costs 96% less than GPT-4o and 60% less than using a single cheap model, because the fast classifier adds minimal overhead while ensuring you only pay for expensive models when you actually need them.

Other Pipeline Patterns

Try this model free

$2 credit for new users · No card required · OpenAI-compatible API

Start Free →

Summarize-then-analyze: Use Moonshot-128K to summarize a long document, then pass the summary to DeepSeek for deeper analysis. This gives you the benefits of long context at a fraction of the cost of running DeepSeek on the full document.

Generate-then-validate: Use Qwen-Plus to generate a draft response, then pass it to DeepSeek to check for errors and improve quality. The validation step catches mistakes while keeping average costs low.

Multilingual pipeline: Use Qwen-Max for Chinese content (it has the best Chinese training data), DeepSeek for code and math, and route everything else to Qwen-Plus. One API key handles all of it.

Related Articles

DeepSeek Python Tutorial → DeepSeek + LangChain Guide → AI API Pricing Comparison 2026 → Cheapest DeepSeek API Access →

🎁 Try NovAI Free — Get $2.00 Credit

Access DeepSeek, Qwen, Doubao, GLM at the cheapest price. OpenAI-compatible. No credit card required.

🚀 Sign Up Free — Get $2.00 Credit
🚀 Save 40-70% on AI APIs
Sign up free — get $5.00 credit. No card required.
Get Started Free →

Ready to build? Get $2 free credit

OpenAI-compatible API — just change base_url and your API key

Start Free →
d>.5){umami.track("scroll-50%",{page:p});window._s50=!0}if(!window._s90 d>.9){umami.track("scroll-90%",{page:p});window._s90=!0}});var started=Date.now(),fired={};setInterval(function(){var s=(Date.now()-started)/1000;[30,60,120,300].forEach(function(t){if(s>=t !fired[t]){umami.track("time-"+t+"s",{page:p});fired[t]=!0}});},5000);})() 前 -->
d>.5){umami.track("scroll-50%",{page:p});window._s50=!0}if(!window._s90 d>.9){umami.track("scroll-90%",{page:p});window._s90=!0}});var started=Date.now(),fired={};setInterval(function(){var s=(Date.now()-started)/1000;[30,60,120,300].forEach(function(t){if(s>=t !fired[t]){umami.track("time-"+t+"s",{page:p});fired[t]=!0}});},5000);})()
Zhipu AI Ecosystem Partner Volcano Engine Ecosystem Partner Tencent Cloud Ecosystem Partner