Skip to content

Conversation

@StudioPlatforms
Copy link

Summary

This PR adds AI Stupid Level integration to open-lovable, providing 6 intelligent auto-routing models that automatically select the best AI model for each task.

Changes Made

1. app/api/generate-ai-code-stream/route.ts

  • Added AI Stupid Level client using @ai-sdk/openai with custom baseURL (https://aistupidlevel.info/v1)
  • Added provider detection for aistupidlevel/ prefix models
  • Updated model routing logic to support AI Stupid Level models

2. config/app.config.ts

  • Added 6 AI Stupid Level models to the availableModels array:
    • aistupidlevel/auto - Best overall performance
    • aistupidlevel/auto-coding - Optimized for coding tasks (default)
    • aistupidlevel/auto-reasoning - Optimized for reasoning tasks
    • aistupidlevel/auto-creative - Optimized for creative tasks
    • aistupidlevel/auto-fastest - Optimized for speed
    • aistupidlevel/auto-cheapest - Optimized for cost efficiency

Benefits

  • Intelligent Routing: Automatically selects the best model based on task requirements
  • Multi-Provider Support: Leverages multiple AI providers (Anthropic, OpenAI, Google, etc.)
  • Cost Optimization: Choose between performance, speed, or cost
  • Easy Integration: Works seamlessly with existing codebase

Testing

The integration follows the same pattern as other providers (Anthropic, OpenAI, Google) and uses the standard @ai-sdk/openai package with a custom base URL.

Environment Variable Required

AI_STUPID_LEVEL_API_KEY=your_api_key_here

Users can obtain an API key from https://aistupidlevel.info

xticriss and others added 7 commits September 15, 2025 16:01
Problem:
- ZIP download was failing with 'No active sandbox' error even when sandbox was active
- Root cause: Mismatch between V1 (global.activeSandbox) and V2 (global.activeSandboxProvider) architectures
- E2B provider's command splitting broke complex bash commands
- Different working directories: E2B uses /home/user/app, Vercel uses /vercel/sandbox

Solution:
- Detect which sandbox provider is active (E2B, Vercel, or V1 legacy)
- E2B: Use Python zipfile module directly to avoid command parsing issues
- Vercel: Use correct /vercel/sandbox working directory
- Maintain backward compatibility with V1 sandboxes

Changes:
- Provider-aware ZIP creation logic
- Python-based implementation for E2B to avoid bash command splitting
- Correct path handling for each provider type
- Proper output format handling for different providers

Testing:
- Works with E2B provider using Python zipfile
- Works with Vercel provider using correct paths
- Maintains V1 sandbox compatibility
- ESLint passes with no errors
…ox-provider

Fix: ZIP download fails with 'No active sandbox' error for E2B provider
Updated README to include additional demo images.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants