Intelligent Field Routing¶
The core of FixtureForge is the IntelligentRouter — it classifies every field in your model and directs it to the cheapest generator that can handle it.
The Four Tiers¶
| Tier | Examples | Generator | API Cost |
|---|---|---|---|
| Structural | id, user_id, order_id, created_at |
Internal counters / FK registry | Free |
| Standard | name, email, phone, address, zip_code |
Faker | Free |
| Computed | @computed_field properties |
Pydantic | Free |
| Semantic | bio, description, review, message, notes |
LLM (batched) | API tokens |
Batching¶
Semantic fields are never sent one at a time. FixtureForge batches all semantic field values for all records into a single prompt.
The batch prompt asks the model to return a JSON array with all values at once. This reduces latency by ~95% compared to per-record generation.
Classification Logic¶
Field classification uses a combination of:
- Type annotation —
intwith nameidor ending in_id→ Structural - Field name patterns —
email,phone,address→ Standard (Faker) - Semantic heuristics — long
strfields with no recognized name pattern → AI
You can influence routing with Pydantic field descriptions:
from pydantic import BaseModel, Field
class Product(BaseModel):
id: int
name: str
sku: str = Field(description="Stock keeping unit, format: ABC-12345")
tagline: str # -> AI (semantic)