## 1
1. The Business Pain Point: Annotators Became the Growth Bottleneck
A friend's team builds a SaaS mini-program for real estate agencies, helping small and mid-sized agencies manage property listings. Last year they launched a "Smart Property Search" feature, one part of which is floor plan interpretation: a user uploads a floor plan image, and the system returns floor plan labels (number of bedrooms, living rooms, bathrooms), orientation estimation, area range, and layout highlights (such as "north-south ventilation" or "separated active/quiet zones").
The first version was semi-manual: AI did the initial OCR and recognition, and annotators reviewed every result. Sounds fast, but in practice:
- Recognition and review of a single floor plan averaged 8 minutes;
- Agency branches uploaded about 300 images per day (not a made-up number—this came from their own backend statistics), and two full-time annotators working at full capacity could only handle about 240;
- New listings were required to go "live the same day," so backlogs meant agencies would switch to competitors;
- Including salary and management costs, annotators cost about ¥1.2 per image, and the SaaS's per-customer price left barely any margin to absorb this labor cost.
The core contradiction was clear: floor plan interpretation is a task that "must be done, but has very low unit value." The manual cost structure couldn't support business growth. This is exactly the kind of work AI should swallow.
2. Goals and the Efficiency Math
The transformation goals were kept plain:
| Metric | Before | Target | Actual Result |
|---|---|---|---|
| Processing time per image | 8 minutes | <1 minute | ~40 seconds |
| Cost per image | ¥1.2 | <¥0.15 | ~¥0.11 |
| Manual intervention rate | 100% | <10% | ~7% (low-confidence samples only) |
The two full-time annotators transitioned to spot-checkers, handling only samples flagged by AI as "low confidence" each day. Labor costs dropped about 85%, and processing throughput no longer had a ceiling—this was the real change: the bottleneck moved from "people" to "API calls," and the latter scales elastically.
3. Architecture Design
The overall structure is a classic "async task + multimodal models + confidence-based routing" design:
User uploads floor plan
│
▼
[Mini-program client] Preprocessing: compression, edge cropping, EXIF cleanup
│
▼
[Task queue] Generate taskId, immediately return "parsing"
│
▼
[Unified AI API Gateway] ──────────────
│ ├─ Vision model: floor plan structure recognition (room count/walls/doors & windows)
│ ├─ OCR model: extract text annotations on the image (area, room names)
│ └─ Text model: assemble recognition results into structured JSON + selling-point copy
│
▼
[Confidence evaluation layer]
├─ High confidence (~93%) → store directly, push to user
└─ Low confidence (~7%) → enter manual spot-check queue
│
▼
[Callback notification] Mini-program receives result, refreshes pageSeveral design decisions are worth elaborating on:
1. Why async instead of a synchronous API? Multimodal recognition plus generation takes about 40 seconds end to end. Synchronous waits would inevitably time out, with retry nightmares on failures. Task queue + callback (with client-side polling as a fallback on the mini-program) made the experience far more stable.
2. Why split into three models instead of one? A single multimodal large model directly "reading the image and outputting selling points" had terrifyingly high hallucination rates—it would read a two-bedroom as a three-bedroom, which is a fatal error in a real estate context. After splitting, the vision model only handles structured facts and the text model only handles assembly and copywriting. Factual errors are isolated in the earlier stage and can be cross-validated with OCR.
3. The unified AI gateway was the highest-return decision in this transformation. Their initial concern was "isn't an extra layer redundant?" After running it for a month, the answer turned out to be exactly the opposite:
- Zero code changes for model switching. They switched vision models twice mid-project (once for a price drop, once for an accuracy upgrade)—only the gateway configuration changed; not a single line of business code moved. With direct SDK connections, each switch would have meant two days of integration and regression testing.
- Unified key and billing management. Keys for three model types across multiple environments were no longer scattered across config files. Budget alerts and usage dashboards worked out of the box, saving the effort of building a monitoring panel in-house.
- Centralized fallback and retry handling. When a model gets rate-limited, the gateway automatically switches to the backup tier, completely invisible to the business layer. Timeout and off-peak retry logic for multimodal APIs is written once, not three times in three places.
- Attributable costs. The processing cost per image can be traced precisely to model tiers—this is what made the efficiency comparison table above possible to compute.
For a two-person team, what the gateway layer bought wasn't "architectural elegance," but compressing the workload of maintaining three model integrations into maintaining one configuration—something directly convertible into developer-days.
4. Key Implementation Steps
Here's a streamlined checklist for developers who want to replicate this path:
① Data preparation
- Collect 500 de-identified floor plan samples, manually annotate structured ground truth
- Set aside a test set (100 images) as the regression baseline for future model tier changes
② Pipeline setup
- Configure vision/OCR/text model channels in the unified AI gateway
- Set timeouts, retries, backup tiers, and monthly budget caps for each channel
③ Prompts and output contracts
- Vision model outputs a fixed JSON Schema (rooms, bathrooms, orientation...)
- Text model takes that JSON as input and outputs buyer-facing interpretation copy
- Validation failures auto-retry once; if still failing, route to the manual queue
④ Confidence-based routing
- Score based on model self-reported confidence + OCR cross-validation results
- Below threshold (initially 0.75, tuned to 0.82 based on error rates) → route to humans
⑤ Regression and tuning
- Run the fixed test set weekly, compare structured field accuracy
- Feed human-corrected results back as evaluation samples, forming a closed loop5. Pitfalls We Hit
- Furniture icons in floor plans get misrecognized as rooms. Beds, sofas, and toilets all interfere with recognition. The fix was explicitly distinguishing "wall-enclosed areas" from "furniture symbols" in the prompt, plus an edge-enhancement pass during preprocessing.
- The early confidence threshold was set too low, and misclassifications leaked into production, drawing complaints from agencies. Better to keep the manual rate a bit higher at first to protect accuracy, then gradually tighten the threshold.
- Don't let the vision model generate marketing copy as a side task. Mixing facts and sales language in one output makes it impossible to pinpoint which part went wrong. After separation, copy problems mean tweaking prompts while fact problems mean switching models—completely different debugging paths.
6. Final Thoughts
What's most easily underestimated in projects like this isn't model capability, but the maintenance cost of the integration layer—three models, multiple environments, frequent tier switching. Without a unified gateway, just "keeping three SDKs alive" can eat half a day of a small team's week. Outsourcing that part to a specialized layer frees the team to focus on output contracts and confidence tuning—the things that actually create differentiation.
If you're also building AI applications like this, check out a unified AI API gateway solution—registration here: https://api.thistoken.ai/register
---
Ready to try it yourself? Sign up at https://api.thistoken.ai/register to get your API key and start building.
Хотите попробовать Token.AI?
Создайте API Key уровня проекта, включите каналы в консоли и настройте маршрутизацию, бюджеты и журналы аудита.
注册 ThisToken.AI 并获取 API Key