Problem
Astrology in India is deeply cultural—it shapes major life decisions (career, marriage, health). Yet making personalized astrological guidance accessible globally requires bridging ancient wisdom (nakshatra cycles, dasha periods, ashtakvarga) with modern technology.
The technical challenge: LLM inference at scale without breaking unit economics. Each consultation needed to:
- Compute the user’s natal chart (planetary positions at birth)
- Reference cultural context (dasha timing, compatibility with Indian calendar)
- Generate personalized guidance within 2 seconds
- Cost <₹0.10 per consultation (mobile payment-friendly pricing)
Running GPT-4 at ₹6.50 per consultation was economically unviable. We needed a lightweight, open-weight model that could be fine-tuned for astrology and run on our own infrastructure.
Data Preparation
We integrated NASA JPL’s ephemeris database to compute precise planetary positions. Every consultation started with natal chart computation:
- User’s birth date/time/location
- Calculate Sun (rashi), Moon (nakshatra), Ascendant (lagna)
- Compute dasha period (current age cycle)
- Generate ashtakvarga scores (strength of planets)
We collected 8,000 consultation transcripts from human astrologers (with permission) and extracted few-shot examples: “User is Libra Sun, Ashlesha nakshatra, in Saturn dasha. Response:”
An evaluation set of 2,000 consultations was reviewed by practicing astrologers for relevance, cultural accuracy, and guidance quality. This became our ground truth.
Models Evaluated
| Model |
Result |
Note |
| Llama 3.1 8B |
Kept |
Fast inference; culturally aware; strong in-context learning |
| Mistral 7B |
Kept |
Slightly faster alternative; similar quality |
| Sentence Transformers |
Kept |
Retrieve past consultations for RAG context |
| Quantization (int8/int4) |
Kept |
40% latency reduction, imperceptible quality loss |
| LoRA Fine-tuning |
Kept |
Domain adaptation; 3M parameters instead of 8B |
| GPT-4 Turbo |
Cut |
Cost ₹6.50/consultation unsustainable at scale |
| Unquantized Llama 3 |
Cut |
4–5s latency; replaced by int8 quantization |
Architecture
The consultation pipeline:
[Birth Data] -> Ephemeris Compute (natal chart)
v
Semantic Search (find 3 similar past consultations)
v
LLM Prompt (Llama 3.1, quantized int8)
<- [Chart context] + [Few-shot examples] + [RAG results]
v
Cache in Redis (same chart = instant future lookups)
v
[Guidance Response]
The LLM prompt includes:
- Natal chart (Sun/Moon/Ascendant signs, dasha period)
- RAG context (3 semantically similar past consultations via Sentence Transformers)
- Few-shot examples (human-written samples for cultural grounding)
Inference runs on GPU (AWS g4dn) with CPU fallback for peaks. Quantization (int8) reduced model size from 32GB to 8GB and cut latency from 4.5s to 1.8s without perceptible output degradation.
Production & Scale
Started with 1,100 beta users in Mar 2024; reached 12,000 by Sep 2025.
Key optimizations:
- Quantization: int8 Llama 3.1 is 40% faster than unquantized
- LoRA fine-tuning: 3M trainable parameters adapted the model to astrology without full retraining
- Redis caching: Identical birth charts (repeat users) get instant responses
- RAG: Semantic search provides cultural grounding and consistency
Cost structure: ₹0.08 per consultation (LLM + GPU + storage). Sustainable at volume.
Reliability: 99.9% uptime maintained via health checks, auto-scaling, and graceful fallback. Average inference latency: 1.6s median, <2.2s P95.
Human feedback loop: Astrologer review of LLM outputs (weekly samples) continuously improves relevance scores. We track “astrologer satisfaction” as a key metric.
Result: a self-hosted stack that holds a genuinely astrological conversation at roughly one-eightieth of the per-consultation cost of the frontier API it replaced, with practising astrologers — not an automated metric — as the acceptance gate on quality.