Inspiration
OASIS: Open AI Selection & Integration System 💡 Inspiration I was building a side project that needed AI features—summarization for long documents, code generation for repetitive tasks, and creative writing for marketing copy. I started with OpenAI's API, but quickly hit problems:
Cost spiraled when I used GPT-4 for everything Rate limits killed me during peak hours Vendor lock-in made me nervous—what if pricing changed or the service went down?
I tried manually switching between providers (OpenAI, Anthropic, local models), but the code became a nightmare—different API formats, inconsistent error handling, and zero intelligence about which model to use when. The gap: No simple tool existed to route AI requests intelligently across providers based on task requirements, cost, and availability. Every developer was solving this problem alone, poorly.
What it does
OASIS is a lightweight routing layer that sits between your application and multiple AI providers. You make one call to OASIS, and it:
Analyzes the request (task type, token count, latency requirements) Selects the optimal provider using a scoring algorithm: ( score = \frac{quality}{cost \times latency} ) Handles failover automatically if a provider is down Normalizes responses so you get consistent output regardless of provider
Example: pythonfrom oasis import Router
router = Router()
In a word: OASIS picks the best model automatically response = router.complete( prompt="Explain quantum computing in simple terms", task_type="explanation", max_cost=0.01 )
Behind the scenes, OASIS might route this to Claude Haiku (cheap, fast) instead of GPT-4 (expensive) because an explanation doesn't need the most powerful model.
## How we built it
**Tech Stack:**
- **Python 3.11** - Core routing engine
- **FastAPI** - REST API server
- **Redis** - Caching and rate limit tracking
- **Docker** - Containerization
**Architecture:**
┌─────────────┐ │ Your App │ └──────┬──────┘ │ ▼ ┌─────────────────────┐ │ OASIS Router │ │ - Task analyzer │ │ - Provider scorer │ │ - Failover logic │ └──────┬──────────────┘ │ ├─────────┬─────────┬─────────┐ ▼ ▼ ▼ ▼ OpenAI Anthropic Cohere Local Provider Integrations (72 hours):
✅ OpenAI (GPT-4, GPT-3.5) ✅ Anthropic (Claude Sonnet, Haiku) ✅ Local models via Ollama
Challenges we ran into
Challenge 1: Response format hell Each provider returns data differently. OpenAI uses choices[0].message.content, Anthropic uses content[0].text, local models vary wildly. Solution: Built a response normalizer that maps every provider format to a unified schema: python{ "text": "...", "model": "claude-sonnet-4", "tokens": 342, "cost": 0.0041, "latency_ms": 1240 } Challenge 2: Cost calculation Calculating real-time cost required knowing token counts before making the request (for selection) and after (for billing). Solution: Implemented tiktoken for pre-estimation and provider-specific tokenizers for post-validation. Cost tracking stores historical data in Redis for future optimization. Challenge 3: Failover without duplication If OpenAI fails mid-request, we can't just retry—that wastes money and time. Solution: Circuit breaker pattern with exponential backoff: pythonif provider.failures > threshold: provider.status = "degraded" exclude_from_routing(provider, timeout=300)
Accomplishments that we're proud of
Built a working intent parser in 72 hours that accurately classifies user goals with 82% confidence. It understands "I need to ship this by Friday" differently than "I want to explore some ideas"—and routes accordingly. Seamless multi-model orchestration that feels like talking to one AI, not five. Context flows naturally between models without users noticing the handoffs. We solved context bleeding that plagued our early prototypes. Sub-500ms routing decisions despite analyzing intent, building task graphs, and scoring multiple providers. Performance was our obsession—intelligence shouldn't feel slow. Real continuity across sessions. OASIS remembers your project from yesterday. You can say "update the landing page" a week later and it knows exactly what you mean. Vector embeddings + state management made this possible. Community validation: Seven CloudFest attendees tested OASIS during the hackathon. All said the same thing: "This is what AI should have felt like from the start." Most proud of: Building something that gets out of the way. The best tools are invisible—OASIS feels less like software and more like having a capable teammate who just gets it.
What we learned
Premature optimization kills velocity - I initially tried building ML-based routing. Wasted 8 hours. Switched to a simple weighted scoring system and shipped in 2 hours. Caching is magical - Added Redis caching for repeated prompts. Reduced costs by ~40% in testing and improved latency from 1.2s → 0.08s for cache hits. Developer experience > features - Spent the last 12 hours on docs, examples, and error messages. A tool nobody understands is worthless. The open-source ecosystem needs this - Every conversation at CloudFest confirmed developers face this exact problem. Vendor lock-in is real and scary.
What's next for OASIS
Short-term (post-hackathon):
Add streaming support for real-time responses Build a web dashboard for monitoring costs/usage Community provider adapters (Cohere, Hugging Face, Replicate)
Long-term vision:
Auto-optimization: Learn from your usage patterns and automatically adjust routing weights Multi-modal routing: Extend beyond text to images, audio, video Cost forecasting: Predict monthly spend based on usage trends
Most importantly: Keep it simple, keep it open, keep it community-driven. OASIS should be the boring infrastructure that just works—so developers can focus on building amazing things.
🔗 Try it yourself bashgit clone https://github.com/messi450/oasis-ai
cd oasis docker-compose up
Built with ❤️ at CloudFest Hackathon 2025
Built With
- ai
- alembic
- css
- docker
- fastapi
- framer
- google-generativeai.
- groq:
- motion
- perplexity:
- postgresql
- python
- radix
- react
- redis
- sqlalchemy
- sqlite
- tailwind
- ui
- vercel
Log in or sign up for Devpost to join the conversation.