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

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.

1 participant