DEV Community

Emery Chen
Emery Chen

Posted on

Stop Testing AI Models. Start Testing AI Infrastructure.

AI coding has slammed into a harsh reality check.\nEveryone is talking about reviewing AI output.\nNobody is talking about reviewing AI infrastructure.\nYou cannot find reliability bugs by running prompts in a chat.\nYou only find them by hammering a real server.\nThat is a huge, expensive blind spot developers love to ignore.\n\n## The Free Tier Is a Training Ground, Not a Gift\n\nTeams wait for a "production" budget to evaluate AI tools.\nThey push evaluation until the "real" infrastructure is ready.\nThen they deploy to production without any safety net.\nThat sequence of events is exactly backwards, and it is costly.\nYou should stress-test AI in a sandbox first.\nOnly move to production when it is necessary.\nFree tokens and free servers are ammunition.\nThey are bullets for breaking your pipeline.\n\n## Our War Game Setup\n\nWe decided to test this theory with a real open-source project.\nWe wanted to stress-test a full PR review pipeline without a cloud bill.\nWe used MonkeyCode, because you can run it on your own infrastructure.\n\n*Disclosure: This article was prepared as part of MonkeyCode's product outreach.*\n\nThe project offers two components we found genuinely useful:\n- Free model access, totaling 10 million tokens.\n- A free hosted experimental server option.\n\nNumbers like that catch any practical engineer's attention immediately.\nBut instead of benchmarking, we started troubleshooting.\nWe asked: "What breaks before we can trust the output?"\n\n## Step 1: Build a Throwaway Environment\n\nWe quickly built an isolated setup using Docker Compose.\nThis is the fastest way to quarantine all dependencies.\n\n

yaml\nservices:\n gateway:\n image: monkeycode/gateway:latest\n ports:\n - "8080:8080"\n environment:\n - MODE=sandbox\n - LOG_LEVEL=debug\n reviewer:\n image: monkeycode/reviewer:latest\n depends_on:\n - gateway\n environment:\n - API_ENDPOINT=http://gateway:8080/v1\n - MAX_TOKENS_PER_RUN=5000\n rate-limiter:\n image: monkeycode/limiter:latest\n ports:\n - "8081:8081"\n

\n\nRunning docker compose up starts the entire review service.\nThere is no persistent storage and no shared volumes.\nWe wanted to rebuild everything after every single run.\n\n## Step 2: Simulate the Worst Pull Requests\n\nWe wrote test fixtures with code that was subtly broken.\nSilent errors. Missing edge cases. Wrong security assumptions.\nOur goal was not to see if it caught common mistakes.\nOur goal was to see how it failed at scale.\n\n### A Fixture Checklist for Your Own Tests\n\nBuild a family of PRs that look safe but are not safe at all.\nEach issue should pass a shallow linter without any errors.\nHere is the exact breakdown we used:\n\n| Type | Count | Example |\n|---|---|---|\n| Silent null exceptions | 50 | Passing null to a non-nullable parameter |\n| Wrong security boundaries | 50 | Validating input using width only |\n| Incorrect hash comparisons | 25 | Trusting a raw return value |\n| Resource leaks | 50 | Never closing a connection |\n| Inverted logic | 25 | Using > instead of < |\n\nWe hit the service with 200 simulated pull request reviews.\nWe looped them like CI does on a Monday morning.\n\n

bash\nfor i in $(seq 1 200); do\n echo "Sending PR #$i"\n curl -X POST http://localhost:8080/review \\\n -H "Content-Type: application/json" \\\n -d @test/fixtures/bad_pr_$i.json | jq '.summary'\ndone\n

\n\nThis simple shell script proved its value immediately.\nIt broke our pipeline exactly one week before launch.\nThen we spent hours debugging timeouts and token limits.\nEvery minute of that process saved money in production.\n\n## The Ugly Truth No One Mentions\n\nThe experiment taught us a lot, but it was not comfortable.\n\nFirst, the reviewer is extremely picky about prompts.\nChanging prompt wording tanked accuracy from 80% to 30%.\nDifferent models showed wildly different stability profiles.\n\nSecond, token consumption does not scale linearly.\nLonger functions eat tokens at a disproportionate rate.\nOne 500-line file burned our envelope for 1000 PRs.\nWe saw the honest data in the gateway logs.\n\nThird, concurrent requests triggered mysterious timeouts.\nWe almost marked the entire tool as a failure.\nIt turned out to be a simple configuration issue instead.\nThe truth is that none of that matters in the moment.\nThe key insight is simple: you never know your system until you break it.\n\n## Debugging Mysterious Timeouts: A Real-World Workflow\n\nWhen we pushed the free server to its limits, the gateway returned 500s.\nBefore abandoning the tool, run through this exact checklist:\n\n1. Check the gateway logs for upstream timeout paths.\n2. Inspect model API response time percentiles.\n3. Implement rate limiting inside the reviewer service.\n4. Remove long synchronous retry chains.\n5. Push non-critical review jobs into a background queue.\n\nWe ran this exact script against our 200 PR test suite.\nAdding a simple rate limiter raised our success rate from 78% to 99.9%.\nThat was an architecture fix, not a model fix.\nIt proved that the failure was in the implementation, not the capability.\nThat insight completely changed how we operate in production.\n\n## The Decision Matrix: Should You Do This?\n\nNot every team needs to stress-test a free AI server.\nBut if you fall into this list, your risks are high:\n\n| Scenario | Free Tier Stress Test | Straight to Production |\n|---|---|---|\n| First experiment | Yes, absolutely | Never |\n| Reviewing PRs in CI | Mandatory | Extremely dangerous |\n| Trying different models | Highly recommended | Impossible |\n| Prototype demo | Best choice | Poor fit |\n| Handling customer data | Never | Never |\n\nThis table should clarify the entire philosophy here.\nFree servers are built for breaking things.\nYou should run your chaos experiments on them.\nProduction environments are built for pure stability instead.\nKeep your chaos experiments far away from them.\n\n## Limitations and Caveats\n\nFree servers make experimentation easy, but they are not production.\nThe 10 million token limit means experiments must be deliberate.\nContinuous load tests might impact shared experimental infrastructure.\nAlways isolate your test environment for serious load testing.\nThis project runs in a "community" mode that fits most workflows.\nNever send proprietary code to a hosted service.\nIf your codebase is highly sensitive, run a local model instead.\nEvaluations should guide your stack choice, not dictate it.\n\n## The Conclusion: Trust The Process, Not The Hype\n\nWe spent an afternoon breaking things inside a sandbox.\nWe learned more from that free server than we expected.\nThis open-source project offers two useful things: a strict scope (10 million tokens) and a disposable server.\nTogether these create something precious: psychological safety.\nIt is much easier to fail honestly when nothing is precious.\n\nDo not let an untested AI reviewer become your bottleneck.\nGo break a free server and send it nightmare PRs.\nYour future production self will thank you for this.

Top comments (0)