Skip to content

Conversation

@StudioPlatforms
Copy link

Overview

Adds support for AI Stupid Level's intelligent model routing as an alternative LLM provider alongside Anthropic.

Features

  • Multi-provider architecture (Anthropic + AI Stupid Level)
  • 6 auto-routing models with intelligent selection
  • Environment-based configuration
  • Full backward compatibility
  • TypeScript errors fixed

Configuration

# Use AI Stupid Level
LLM_PROVIDER=aistupidlevel
AI_STUPID_LEVEL_API_KEY=your_key_from_https://aistupidlevel.info/router/keys
AI_STUPID_LEVEL_MODEL=auto-coding  # optional, defaults to auto-coding

Available Models

  • auto - Best overall model based on real-time benchmarks
  • auto-coding - Optimized for coding tasks (default)
  • auto-reasoning - Complex reasoning tasks
  • auto-creative - Creative writing
  • auto-fastest - Prioritizes speed
  • auto-cheapest - Cost optimization

Changes

  • Added @ai-sdk/openai package for OpenAI-compatible API support
  • Implemented getAIStupidLevelModel() function with custom baseURL
  • Added provider selection via LLM_PROVIDER environment variable
  • Added TypeScript types for new environment variables
  • Fixed pre-existing TypeScript errors in stream-text.ts
  • Maintains full backward compatibility with existing Anthropic integration

Testing

  • ✅ TypeScript compilation (0 errors)
  • ✅ Backward compatibility maintained
  • ✅ Provider routing verified

- Add @ai-sdk/openai package for OpenAI-compatible API support
- Implement multi-provider support (Anthropic + AI Stupid Level)
- Add getAIStupidLevelModel() function with custom baseURL
- Support 6 auto-routing models (auto, auto-coding, auto-reasoning, etc.)
- Add provider selection via LLM_PROVIDER environment variable
- Add TypeScript types for new environment variables
- Maintain backward compatibility with existing Anthropic integration
- Default model: auto-coding (optimized for software development)

Environment variables:
- LLM_PROVIDER: 'anthropic' | 'aistupidlevel' (default: anthropic)
- AI_STUPID_LEVEL_API_KEY: API key from https://aistupidlevel.info/router/keys
- AI_STUPID_LEVEL_MODEL: Model selection (default: auto-coding)
- Add type assertions to fix LanguageModelV2/V1 compatibility
- Fix Messages type compatibility with convertToCoreMessages
- Apply fixes to both Anthropic and AI Stupid Level code paths
@StudioPlatforms StudioPlatforms changed the title feat: Add AI Stupid Level smart router integration feat: add AI Stupid Level smart router integration Oct 16, 2025
Copy link

@Nephew209-oss Nephew209-oss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe that action with that certain language is appropriate in my opinion but I wouldn't approve these changes or that call

@StudioPlatforms
Copy link
Author

Thank you for reviewing this PR. I understand the name 'AI Stupid Level' might seem unconventional, but I want to clarify the intent behind it.

The name is intentionally ironic and self-aware - it's a playful reference to the common frustration when AI models produce incorrect responses. Rather than being disrespectful, it's a humble acknowledgment that no AI is perfect, and our platform helps users intelligently route between models to minimize those moments.

Despite the lighthearted name, this is serious production-grade technology with intelligent model selection, real-time benchmarks, and professional-grade reliability. The tech industry has a long tradition of playful names for serious projects (Git, Apache, etc.).

I'd encourage evaluating this PR on its technical merit: clean code, full backward compatibility, zero breaking changes, proper TypeScript typing, and comprehensive testing. The integration is optional and doesn't affect existing Anthropic users.

I respect that naming preferences are subjective, but there's no malicious intent here. If you have specific technical concerns about the implementation, I'm happy to address them.

@igun997
Copy link

igun997 commented Nov 17, 2025

hey https://aistupidlevel.info it's a platform brooooo. that a brand not just a word "stupid"

I don't believe that action with that certain language is appropriate in my opinion but I wouldn't approve these changes or that call

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.

3 participants