Case study — Nivista
An AI interior visualisation product where the differentiator is not the model — it is the cultural rule engine wrapped around it.
The challenge
AI image generation for interiors is close to a commodity. Anyone can call an image model. The interesting problem is that the output has to be culturally correct for a market the models were not trained to serve well, and it has to be cheap enough that an individual buyer will pay for it out of pocket.
There is also a hard technical constraint hiding in the product promise. Users do not want a beautiful room — they want their room, furnished. That means the generation must preserve architectural structure: walls, windows, doors and proportions stay fixed while everything else changes.
And it had to be affordable at Indian consumer price points, which rules out GPU infrastructure sitting idle between requests.
The approach
Decisions that shaped the product
Vastu as deterministic code, not as a prompt
Vastu compliance is expressed as an explicit Python rule engine operating on structured room data — direction, function, entry, fixed elements. It produces a score, a list of specific findings and concrete remedies, all reproducible. The same rules then constrain the generation prompt. Putting this in the model rather than in code would have made it unexplainable and non-deterministic, which for a belief system users take seriously is unacceptable.
A provider-agnostic image engine
Generation sits behind an `ImageEngine` interface. The current implementation calls a hosted structure-preserving image model; a self-hosted diffusion pipeline with ControlNet can be swapped in without touching product code. Given how quickly image model pricing and quality shift, treating the model as replaceable infrastructure was a deliberate hedge.
Generation is always a job, never a request
Image generation takes five to twenty seconds. Every request enqueues a job onto Redis, an ARQ worker processes it, and the app polls or subscribes for the result. This is unglamorous and it is the difference between a product that degrades gracefully under load and one that starts timing out at the worst possible moment.
Credits and watermarks enforced server-side
Free users get three watermarked generations. The watermark is composited on the server after generation, never in the client, and credit deduction is transactional against the job lifecycle. Anything enforced in the app is enforced nowhere.
Every external service mockable
Payments, SMS and image generation all sit behind interfaces with local mock implementations selected by an environment variable. A new engineer runs `docker compose up` and has a fully working system with no API keys and no spend. That single decision has probably saved more time than any other in the project.
Micro-pricing built for UPI
Indian consumers will pay small amounts frequently but resent large commitments. Credits are sold in small bundles and subscriptions with UPI autopay, and order state is driven by verified webhooks rather than client callbacks.
Architecture
How the system is put together
Layer by layer, with the technology and the reason it is there.
Mobile
Flutter for Android and iOS from a single codebase, phone-OTP authentication with JWT access and refresh tokens
API
Python 3.12 + FastAPI with Pydantic v2 schemas, async SQLAlchemy 2.0 and Alembic migrations
Jobs
Redis with ARQ workers handling generation, watermarking and post-processing off the request path
Storage
S3-compatible object storage, self-hosted locally and managed in production — identical API in both
AI
Structure-preserving image generation behind a swappable `ImageEngine` interface, with prompts assembled from style, region, budget and vastu constraints
Rules
Pure-Python vastu engine producing a score, findings and remedies, plus generation constraints — fully deterministic and unit-testable
Payments
UPI, cards, netbanking and recurring plans through an Indian payment gateway, with webhook-verified credit grants
Platform
Docker Compose for local parity, structured JSON logging, health endpoints, automated mobile CI
Engineering highlights
The parts worth talking about
Deterministic culture, probabilistic pixels
The split matters. Anything a user might dispute — the vastu score, the remedy list, the credit balance — is deterministic code with tests. Only the image itself is generative.
Local development with zero API keys
Mock implementations of every paid external service mean the full product runs offline on a laptop. Onboarding takes minutes and costs nothing.
No GPU fleet
Using a hosted image model rather than self-hosted diffusion removed an entire infrastructure category. At beta volumes, per-generation API cost is far below the amortised cost of idle GPUs.
The watermark is a trust boundary
Server-side compositing means the free tier is a real free tier and not an honour system. It sounds obvious; it is routinely got wrong.
Takeaways
What we would tell you to do
- 01
The moat in an AI product is rarely the model. It is the domain rules, the data and the distribution around it.
- 02
Anything the user might argue with should be deterministic and explainable.
- 03
Mock every paid dependency behind an interface on day one — it pays for itself within a fortnight.
- 04
For Indian consumers, price granularity matters as much as price level.
Next case study
A pan-India, voice-first agricultural advisor serving farmers in eight Indian languages plus English — with no state-specific or language-specific branches anywhere in the codebase.
Read the KisanGyan case studyThis is how we would build yours.
Same approach, same discipline, applied to whatever you are trying to make.