Asoba Ona Terminal

Loading Bedrock & Custom Models

Configure AWS Bedrock and deploy custom fine-tuned models with routing strategies.


AWS Bedrock Model Configuration

πŸš€ Amazon Nova Pro - Primary model for best availability:

⚑ Amazon Nova Lite - Fast fallback option:

Configuration Setup

Edit your configuration file:

# File: configs/default.yaml
ai_models:
  providers:
    bedrock:
      enabled: true
      region: "us-east-1"
      default_model: "amazon.nova-pro-v1:0"  # Primary model
      preferred_models:
        - "amazon.nova-pro-v1:0"                      # Primary
        - "amazon.nova-lite-v1:0"                     # Fallback 1  
        - "anthropic.claude-3-5-sonnet-20240620-v1:0" # Fallback 2
      
      # Throttling resistance (built-in)
      availability_cache:
        ttl_seconds: 300              # Cache results for 5 minutes
        circuit_breaker_threshold: 3  # Open after 3 consecutive failures
        circuit_breaker_duration: 600 # Stay open for 10 minutes

Testing Bedrock Models

# Test Nova Pro availability
aws bedrock invoke-model \
  --model-id amazon.nova-pro-v1:0 \
  --body '{"messages":[{"role":"user","content":[{"text":"test"}]}],"inferenceConfig":{"max_new_tokens":10}}' \
  --region us-east-1 \
  --cli-binary-format raw-in-base64-out

# Test from Ona Terminal CLI
πŸ€– | /test-models

# Show current model configuration  
πŸ€– | /models

Custom Fine-Tuned Models

Supported Model Types

🎯 Mistral 7B Fine-Tuned:

πŸ¦™ LLaMA Fine-Tuned:

Custom Model Deployment

Option 1: Self-Hosted Models

# Set up Mistral server endpoints
export MISTRAL_STATUS_URL="http://your-server:8000/status"
export MISTRAL_FALLBACK_IP="your-server-ip"
export MISTRAL_ENABLED="true"

# Enable in configuration
# Edit configs/default.yaml:
ai_models:
  providers:
    mistral:
      enabled: true
      discovery_url: "http://your-server:8000/status"
      fallback_ip: "your-server-ip"
      default_port: 8000
      specialties: ["solar", "o&m", "diagnostics", "warranty"]
      cost_multiplier: 0.03  # 30x cheaper than Bedrock

Option 2: Custom API Endpoints

# Add custom provider
ai_models:
  providers:
    custom:
      enabled: true
      endpoint_url: "https://your-model-api.com/v1/chat/completions"
      api_key: "your-api-key"
      default_model: "your-fine-tuned-model-name"
      models:
        - name: "solar-diagnostics-v1"
          endpoint: "https://your-api.com/solar-diagnostics"
          specialties: ["inverter-faults", "string-analysis"]
        - name: "economic-dispatch-v1"  
          endpoint: "https://your-api.com/economic-dispatch"
          specialties: ["financial-optimization", "resource-allocation"]
      cost_multiplier: 0.01  # Configure based on your costs

Testing Custom Models

# Test custom model connectivity
πŸ€– | /test-custom-models

# Use specific custom model
πŸ€– | /model solar-diagnostics-v1 "analyze inverter performance degradation"

# Compare models
πŸ€– | /compare-models "economic analysis of maintenance timing" --models nova-pro,economic-dispatch-v1

Routing Strategies

Cost-Optimized Strategy

Routing Logic:

  1. Simple tasks β†’ Custom models (cheapest)
  2. Medium complexity β†’ Nova Lite (fast and affordable)
  3. High complexity β†’ Nova Pro (quality and reliability)
# Configuration for cost optimization
ai_models:
  fallback_strategy: "cost_optimized"
  routing:
    complexity:
      low: "custom"      # Route to cheapest available
      medium: "auto"     # Balanced selection  
      high: "bedrock"    # Quality-first

Quality-First Strategy

Routing Logic:

  1. All tasks β†’ Try Nova Pro first
  2. If throttled β†’ Fall back to Nova Lite
  3. If unavailable β†’ Use custom models
# Configuration for quality-first
ai_models:
  fallback_strategy: "quality_first"
  routing:
    complexity:
      low: "bedrock"     # Best quality even for simple tasks
      medium: "bedrock"  # Consistent high quality
      high: "bedrock"    # Maximum quality

Specialized Task Routing

Equipment-Specific Routing:

ai_models:
  routing:
    # Route by task type
    languages:
      solar-diagnostics: "custom"     # Use fine-tuned models
      economic-analysis: "custom"     # Domain-specific models
      general-coding: "bedrock"       # General tasks to Bedrock
      infrastructure: "bedrock"       # Complex infra tasks

Model Performance Examples

Cost Comparison (1000 requests/month)

Model Type Cost per Request Monthly Cost Use Case
Custom Solar Model $0.001 $1.00 Solar-specific diagnostics
Nova Lite $0.003 $3.00 Fast general tasks
Nova Pro $0.008 $8.00 Complex analysis
Claude Sonnet $0.015 $15.00 Highest quality tasks

Performance Metrics

Model Response Time Accuracy (Solar Tasks) Cost Efficiency
Custom Solar 0.8s 94% Excellent
Nova Pro 1.2s 87% Good
Nova Lite 0.6s 82% Excellent
Claude Sonnet 2.1s 89% Fair

Quick Examples

Cost-Optimized Routing

# Simple solar diagnostic (routes to custom model)
πŸ€– | analyze inverter error code E042 for SMA inverter

# Complex infrastructure task (routes to Nova Pro)  
πŸ€– | /generate --complexity high "complete Terraform module for multi-AZ deployment"

# Financial analysis (routes to custom economic model)
πŸ€– | calculate optimal maintenance timing for 10MW solar site

Quality-First Routing

# Force high-quality model for critical analysis
πŸ€– | /model amazon.nova-pro-v1:0 "risk assessment for equipment replacement strategy"

# Use specialized model for domain expertise
πŸ€– | /model solar-diagnostics-v1 "detailed fault analysis for underperforming string array"

Mixed Strategy

# Let Ona Terminal choose optimal model
πŸ€– | optimize maintenance schedule for Q2 considering weather and energy prices

# Override for specific requirements
πŸ€– | /model economic-dispatch-v1 --force "detailed ROI analysis for inverter replacement"

Troubleshooting

Model Connectivity Issues

# Check all model availability
πŸ€– | /test-models

# Show detailed model status
πŸ€– | /models --verbose

# Test specific custom model
πŸ€– | /test-custom-model solar-diagnostics-v1

# Check circuit breaker status
πŸ€– | /circuit-breaker status

Performance Optimization

# Show cache statistics
πŸ€– | /cache-stats

# Clear cache to force fresh model tests
πŸ€– | /cache-clear

# Monitor model selection decisions  
πŸ€– | /debug model-routing on

What’s Next?

  1. Master CLI Commands - Use your configured models effectively
  2. Explore O&M Use Case - See models in real-world scenarios
  3. Understand Agentic Workflows - How models work together

Explore O&M Use Case


Get Help & Stay Updated

Contact Support

For technical assistance, feature requests, or any other questions, please reach out to our dedicated support team.

Email Support Join Our Discord

Subscribe to Updates

* indicates required