## Overview

Every space can be configured with default AI models and routers that determine which AI models handle conversations. This provides control over cost, performance, and reliability for your AI interactions.

## Model Configuration

### Default Model Selection

Set a default model that will be used for new conversations in your space:

1. Access Space Settings
   - Open your space and click the Settings icon (gear) in the top right
2. Navigate to Models
   - Find the “Default Model & Router” section
3. Select Model
   - Choose from available models or select a router
4. Save Changes
   - The configuration is saved automatically

### Available Models

Pulze provides access to models from major providers:

## OpenAI

- GPT-4, GPT-4 Turbo, GPT-3.5 Turbo

## Anthropic

- Claude 3 Opus, Sonnet, Haiku

## Google

- Gemini Pro, Gemini Ultra

## Others

- Cohere, Meta Llama, Mistral, and more

### Model Features

Each model card displays:

- **Provider Logo**: Visual identification
- **Model Name**: Full model identifier
- **Capabilities**: Supported features (vision, function calling, etc.)
- **Context Window**: Maximum token limit
- **Pricing**: Cost per million tokens
- **Performance**: Speed and quality metrics

## Smart Model

The **Smart Model** is Pulze’s intelligent routing system that automatically selects the best model based on your request:

### How It Works

1. Analyzes your prompt and context
2. Evaluates available models
3. Selects the optimal model for the task
4. Routes your request automatically

### Benefits

- **Cost Optimization**: Uses appropriate models to reduce costs
- **Quality Assurance**: Matches complex tasks to capable models
- **Simplified Management**: No manual model selection needed
- **Adaptive Learning**: Improves over time based on outcomes

### When to Use Smart Model

- General-purpose conversations
- Mixed workload types
- Cost-conscious deployments
- Teams with varying AI needs

## Router Configuration

Routers provide advanced model selection strategies beyond single model defaults:

### Router Types

**Failover Router**  
Automatically falls back to alternative models if the primary model fails or is unavailable.  
**Configuration:**
- Primary model
- Ordered list of fallback models
- Retry logic
- Error handling

**Load Balancing Router**  
Distributes requests across multiple models for improved reliability and throughput.  
**Configuration:**
- Pool of models
- Distribution strategy
- Health checks
- Traffic weights

**Cost-Optimized Router**  
Routes requests to the most cost-effective model that meets quality requirements.  
**Configuration:**
- Quality threshold
- Cost constraints
- Model eligibility
- Fallback options

**Custom Router**  
Build your own routing logic based on specific business rules.  
**Configuration:**
- Custom routing rules
- Condition evaluation
- Model mapping
- Override options

### Creating a Router

1. Navigate to Routers
   - Go to Permissions → Routers in the navigation
2. Create New Router
   - Click “Create Router” button
3. Configure Router
   - Name your router
   - Select router type
   - Configure routing rules
   - Add fallback models
4. Test Router
   - Validate routing logic with test requests
5. Set as Default
   - Assign router to your space

## Failover Chains

Failover chains ensure reliability by specifying backup models:

### Configuration

1. **Primary Model**: First choice for requests
2. **Fallback Models**: Ordered list of alternatives
3. **Retry Logic**: When to trigger failover
4. **Error Handling**: How to handle complete failures

### Use Cases

- **High Availability**: Mission-critical applications
- **Provider Diversity**: Reduce dependency on single provider
- **Regional Failover**: Geographic redundancy
- **Rate Limit Handling**: Automatic overflow to alternatives

### Example Configuration

```
Primary: GPT-4 Turbo
Fallbacks:
  1. Claude 3 Opus
  2. Gemini Pro
  3. GPT-3.5 Turbo
```

## Model Switching

Users can override the default model during conversations:

### In-Conversation Switching

1. Open the Models panel (gear icon in chat)
2. Select a different model
3. Continue the conversation with the new model
4. Previous context is maintained

### Use Cases for Switching

- **Task-Specific Models**: Use specialized models for specific tasks
- **Cost Management**: Switch to cheaper models for simple tasks
- **Quality Boost**: Upgrade to premium models when needed
- **Testing**: Compare outputs across different models

## Model Settings Panel

The right sidebar in conversations provides model configuration:

### Available Options

- **Model Selector**: Choose active model
- **Router Selector**: Switch to router-based selection
- **Model Features**: View capabilities
- **Performance Settings**: Configure temperature, top-p, etc.
- **Cost Tracking**: Monitor token usage

### Advanced Settings

- **Temperature**: Control randomness (0-2)
- **Max Tokens**: Limit response length
- **Top P**: Nucleus sampling threshold
- **Frequency Penalty**: Reduce repetition
- **Presence Penalty**: Encourage topic diversity

## Model Recommendations

Pulze provides intelligent model recommendations based on:

- **Task Type**: Analysis, generation, coding, etc.
- **Input Length**: Context window requirements
- **Cost Constraints**: Budget considerations
- **Quality Requirements**: Output quality needs
- **Feature Needs**: Vision, function calling, etc.

## Best Practices

### Default Configuration

- Set Smart Model as default for general use
- Configure failover chain for production
- Test router configuration before deployment
- Monitor model performance regularly

### Cost Optimization

- Use Smart Model for automatic cost optimization
- Create cost-aware routers for budget control
- Monitor token usage by model
- Switch models based on task complexity

### Performance

- Balance cost and quality in model selection
- Use failover for high-availability needs
- Test models before committing to defaults
- Review model performance metrics

### Team Management

- Document model selection rationale
- Train team on when to switch models
- Set clear guidelines for model usage
- Review and update configurations quarterly

## Model Analytics

Track model usage in your space:

- **Request Volume**: Calls per model
- **Token Consumption**: Usage by model
- **Cost Analysis**: Spending per model
- **Performance Metrics**: Latency, success rates
- **Quality Scores**: User ratings and feedback

## Next Steps

- **Available Models**  
  Explore all available AI models

- **Custom Routers**  
  Learn about advanced routing

- **Space Members**  
  Manage team access

- **Back to Spaces**  
  Return to Spaces overview
