Developer Tools Lab

Interactive mini-apps for prompt design, RAG chunking, data analysis, schema exploration, and NLP.

LLM Model & Router Chooser

Compute monthly API usage costs, evaluate speed/quality tradeoffs, and generate smart gateway routing logic.

1. Workload Parameters

100,000
1500 tokens
800 tokens

2. Priority Weights

40%
30%
30%

Ranked Model Recommendations

Rank & ModelMatch ScoreEst. Monthly CostTokens/secQualityContext
1.
Llama 3.1 70B
Meta (Groq)
76%$151.7028080/100128k
2.
DeepSeek V3
DeepSeek
56%$43.407084/10064k
3.
Gemini 1.5 Flash
Google
50%$35.2514075/1001M
4.
GPT-4o Mini
OpenAI
49%$70.5012076/100128k
5.
Gemini 1.5 Pro
Google
46%$587.506586/1002M
6.
Claude 3.5 Haiku
Anthropic
44%$440.0013078/100200k
7.
GPT-4o
OpenAI
38%$1,175.007589/100128k
8.
Claude 3.5 Sonnet
Anthropic
33%$1,650.008592/100200k

Generated Router Function

70 / 100

Complexity levels below this threshold will route to Llama 3.1 70B ($0.59/$M input) while tasks above route to the higher-quality fallback model.

// Router Chooser Gateway Logic (NodeJS / Edge Function)
async function routeLLMRequest(prompt, complexityRating) {
  // Threshold complexity (scaled 0-100)
  const THRESHOLD = 70;
  
  const payload = {
    messages: [{ role: 'user', content: prompt }],
    temperature: 0.2
  };

  if (complexityRating >= THRESHOLD) {
    // Route to High-Quality model: DeepSeek V3
    console.log("Routing to fallback model: DeepSeek V3");
    return callProvider('deepseek', 'deepseek-v3', payload);
  } else {
    // Route to Optimal model: Llama 3.1 70B
    console.log("Routing to primary model: Llama 3.1 70B");
    return callProvider('meta (groq)', 'llama-70b', payload);
  }
}

async function callProvider(provider, model, payload) {
  // API call implementation ...
  return { status: 200, model, routed: true };
}