Ramayana — Vibhishana's surrender
Fallback strategies for LLM agents. Model fallback, response fallback, default values.
Formerly agent-fallback — Part of the Vedic Arsenal: 100 production-grade Python libraries for LLM agents, each named from the Vedas, Puranas, and Mahakavyas.
When Vibhishana, brother of Ravana, came to Ram's side — renouncing Lanka, renouncing his own blood — Ram accepted him with these words: "Whoever comes to me for refuge, I shall protect."
This is Sharana — divine refuge, unconditional fallback.
sharana implements the fallback chain for LLM systems. When the primary model fails, sharana catches you. When GPT-4 is rate-limited, Claude catches you. When Claude is unavailable, the graceful degradation catches you. Like Ram's promise to Vibhishana, the fallback chain never abandons the task — it finds another way forward, every time.
flowchart LR
A[Task] --> B[Primary LLM]
B -- Fail --> C[sharana fallback]
C --> D[Secondary LLM]
D -- Fail --> E[Tertiary LLM]
E -- Fail --> F[Graceful Degradation]
style C fill:#ec4899,color:#fff
pip install sharanaOr from source:
git clone https://github.com/darshjme/sharana.git
cd sharana && pip install -e .from sharana import *
# See examples/ for full usagesharana is one of 100 libraries in darshjme/arsenal — each named from sacred Indian literature:
| Sanskrit Name | Source | Technical Function |
|---|---|---|
sharana |
Ramayana — Vibhishana's surrender | Divine Refuge — Sharanagati to the Lord |
Each library solves one problem. Zero external dependencies. Pure Python 3.8+.
- Fork the repo
- Create feature branch (
git checkout -b fix/your-fix) - Add tests — zero dependencies only
- Open a PR
🪷 Built by Darshankumar Joshi · @thedarshanjoshi
"कर्मण्येवाधिकारस्ते मा फलेषु कदाचन" Your right is to action alone, never to its fruits. — Bhagavad Gita 2.47