Supported Providers
Anthropic
Claude models for high-quality translation and summarization
OpenAI
GPT models with broad language support
Google Gemini
Gemini models for multimodal capabilities
Aya uses a provider-agnostic abstraction layer. Configure any provider, and features work seamlessly.
AI Features
Auto-Translation
Translate stories and profiles to all 13 supported languages: How it works:AI translation
- Story title, summary, and content sent to AI provider
- Provider returns translated text in target locale
- Preserves Markdown formatting
- Story titles
- Story summaries
- Story content (full Markdown)
- Profile titles (planned)
- Profile descriptions (planned)
- Profile pages (planned)
Auto-Summarization
Generate concise summaries for long-form content: Batch Processing:Create batch job
- Stories grouped into batch (up to 1000)
- Batch submitted to AI provider’s batch API
- Job ID returned for tracking
Provider processes batch
- AI generates summaries offline
- Typically completes within 24 hours
- Cost-effective bulk processing
- Generate summaries for imported content
- Backfill summaries for old stories
- Consistent summary style across platform
- Used in bulletin board digests
Summarization uses batch API for cost efficiency. Results appear within 24 hours, not real-time.
Configuration
Provider Setup
AI providers are configured via environment variables using theAI__ prefix:
Target Structure:
Anthropic Configuration
claude-sonnet-4-20250514(recommended for translation)claude-opus-4-20250514(highest quality)claude-haiku-4-20250514(fastest, cheapest)
OpenAI Configuration
gpt-4o(multimodal, recommended)gpt-4o-mini(fast, economical)gpt-4-turbo(previous generation)
Google Gemini Configuration
gemini-2.0-flash-exp(fast, experimental)gemini-1.5-pro(production-ready)gemini-1.5-flash(economical)
Vertex AI Configuration
For Google Cloud Vertex AI:Multi-Provider Setup
Configure multiple providers for fallback:Provider Selection Guide
Anthropic (Claude)
Anthropic (Claude)
Best for:
- High-quality translations
- Complex content understanding
- Long context windows
- Accurate Markdown preservation
- Sonnet: Moderate cost
- Opus: Higher cost, best quality
- Haiku: Low cost, good for simple tasks
- Rate limits by tier
- Context window: up to 200K tokens
OpenAI (GPT)
OpenAI (GPT)
Best for:
- General-purpose tasks
- Batch processing
- Broad language support
- Structured output
- GPT-4o: Moderate cost
- GPT-4o-mini: Very economical
- Rate limits by tier
- Context window: up to 128K tokens
- Batch API available (50% discount)
Google Gemini
Google Gemini
Best for:
- Multimodal content (future)
- Cost-effective processing
- Google Cloud integration
- Long context tasks
- Very competitive
- Flash models extremely economical
- Context window: up to 1M tokens (Pro)
- Rate limits vary by region
Vertex AI
Vertex AI
Best for:
- Enterprise deployments
- Google Cloud customers
- Batch processing at scale
- Data residency requirements
- Pay-per-use
- Committed use discounts
- Batch discounts
- GCP project quotas
- Region-specific availability
Translation Workflow
User-Initiated Translation
AI translates
- System sends content to configured AI provider
- Provider returns translation
- Usually completes in 5-30 seconds
Bulk Translation
For translating multiple stories:Bulk translation charges points per story per target locale. Ensure sufficient points before starting.
Batch Processing
Batch processing reduces costs for non-urgent tasks:OpenAI Batch API
Batch Benefits:
- 50% cost reduction vs. real-time
- Efficient for 100s-1000s of items
- No rate limit concerns
- Better for non-urgent tasks
Points System Integration
AI features cost profile points:Translation Costs
- Per story, per target locale
- Deducted from individual profile
- Non-refundable once translation starts
- Adjustable via configuration
Earning Points
Users earn points through:- Profile creation (+100)
- Publishing stories (+50)
- Community engagement (+10-25)
- Verified contributions (+50)
- Special achievements (varies)
Error Handling
AI operations can fail for various reasons: Common Errors:Insufficient Points
Insufficient Points
API Rate Limit
API Rate Limit
Translation Failure
Translation Failure
Invalid API Key
Invalid API Key
Monitoring & Observability
Audit Logs
All AI operations are logged:Metrics
Track AI usage:- Translation count per day/week/month
- Tokens consumed by provider
- Average translation latency
- Error rates by provider
- Points spent on AI features
- Cost tracking (tokens × price)
Set up alerts for high error rates or unexpected cost spikes.
Cost Optimization
Choose Right Provider
Choose Right Provider
- Use cheaper models for simple translations
- Reserve Opus/GPT-4o for complex content
- Use batch processing for non-urgent tasks
- Consider Gemini Flash for cost savings
Optimize Prompts
Optimize Prompts
- Keep system prompts concise
- Send only necessary content
- Use structured output to reduce tokens
- Cache prompts when possible
Rate Limiting
Rate Limiting
- Implement user-level rate limits
- Use queue for batch operations
- Implement exponential backoff
- Monitor usage patterns
Budget Controls
Budget Controls
- Set monthly budget caps
- Alert on unusual spending
- Track cost per user/story
- Charge points appropriately
Best Practices
API Key Management
API Key Management
- Rotate keys quarterly
- Use separate keys per environment (dev/staging/prod)
- Store in secret management system (Vault, AWS Secrets Manager)
- Never log API keys
- Restrict key permissions to minimum needed
Translation Quality
Translation Quality
- Always review AI translations
- Provide context in prompts (domain, audience)
- Use consistent terminology
- Maintain glossary for technical terms
- A/B test different providers/models
System Design
System Design
- Use provider abstraction (don’t couple to one provider)
- Implement circuit breaker pattern
- Queue AI requests for reliability
- Cache common translations
- Log all operations for debugging
User Experience
User Experience
- Show progress indicators
- Provide estimated completion time
- Allow cancellation for long operations
- Clear error messages
- Preview translations before saving
Troubleshooting
Translation returns empty/garbled text
Translation returns empty/garbled text
- Check source content encoding (UTF-8)
- Verify Markdown is valid
- Test with simpler content
- Try different model/provider
- Check prompt engineering
- Review provider API logs
Batch jobs never complete
Batch jobs never complete
- Check batch status via API
- Verify batch size is within limits
- Ensure JSONL format is correct
- Check provider service status
- Review batch logs for errors
- Try smaller batch size
High latency/timeouts
High latency/timeouts
- Check network connectivity
- Verify provider region (use closest)
- Reduce content size if possible
- Increase request timeout
- Use faster model variant
- Implement retry with backoff
Roadmap
Planned AI features:- Profile description translation
- Custom page translation
- AI-assisted content editing
- Automatic content tagging
- Smart content recommendations
- Sentiment analysis for discussions
- Spam detection
- Image generation for stories
- Voice synthesis for accessibility
- Multi-modal content analysis
Next Steps
Stories
Use AI translation on your stories
Profiles
Understand points system for AI features
Bulletin Board
AI summaries in digest emails
Custom Domains
Serve translated content on your domain