Skip to main content

❌ Pitfall #1: calling the LLM directly

The mistake

Why it’s wrong

  • 🚫 QWED can’t control LLM prompting
  • 🚫 No DSL enforcement
  • 🚫 Vulnerable to prompt injection
  • 🚫 Can’t guarantee structured output

The fix

Rule: Let QWED handle the LLM internally.

❌ Pitfall #2: trusting LLM output without verification

The mistake

Why it’s wrong

  • LLMs make mistakes (12% error rate in benchmarks)
  • Financial errors = legal liability
  • No audit trail

The fix


❌ Pitfall #3: wrong verification method

The mistake

Why it’s wrong

  • Different engines for different domains
  • verify() won’t analyze code security
  • Misses vulnerabilities

The fix

Available methods:
  • verify() - General (auto-detects domain)
  • verify_math() - Mathematical expressions
  • verify_logic() - Logical statements
  • verify_code() - Code security
  • verify_sql() - SQL injection
  • verify_fact() - Fact checking

❌ Pitfall #4: ignoring verification results

The mistake

Why it’s wrong

  • Verification might have failed
  • Using unverified data
  • No error handling

The fix


❌ Pitfall #5: not handling errors

The mistake

Why it’s wrong

  • Network failures happen
  • API quotas exist
  • Invalid input exists

The fix


❌ Pitfall #6: missing API key configuration

The mistake

Why it’s wrong

  • Security risk (API key exposed)
  • Can’t change keys without code changes
  • Different keys for dev/prod

The fix

Or use config file:

❌ Pitfall #7: not using batch processing

The mistake

Why it’s wrong

  • Slow (sequential API calls)
  • Expensive (more API credits)
  • Poor user experience

The fix

Performance comparison:
  • Individual: 100 queries Γ— 2s = 200s
  • Batch: 1 request Γ— 5s = 5s
  • 40x faster!

❌ Pitfall #8: wrong timeout settings

The mistake

Why it’s wrong

  • Complex queries need time
  • Causes unnecessary failures
  • Poor user experience

The fix

Recommended timeouts:
  • Simple queries: 10-15s
  • Complex queries: 30-60s
  • Batch processing: 60-120s

❌ Pitfall #9: not running the backend server

The mistake

Why it’s wrong

  • QWED requires a backend server
  • SDK is just a client that connects to backend
  • Backend needs YOUR LLM API keys

The fix

Correct SDK usage:
Architecture:
See: Getting started for full backend setup

βœ… Integration checklist

Before deploying to production, verify:
  • Backend server is running with your LLM API key configured
  • Not calling LLM directly (QWED handles it)
  • Using correct verification methods for each domain
  • Checking result.verified before using output
  • Proper error handling (try/except blocks)
  • API key in environment variable (not hardcoded)
  • Using batch processing for multiple queries
  • Reasonable timeout settings
  • Logging verification results for audit trails
  • Testing integration (see Testing guide)
  • Monitoring QWED in production (see Monitoring)

Need help?

Still stuck? We’re here to help: