โ† Back to Home

OCCode - New Features Guide v0.2.0

Model Profiles, Convergence Engine, and Multi-Model Management

Table of Contents

๐Ÿ“‹ Feature Overview

OCCode now includes three powerful new features for managing and optimizing AI model usage:

๐Ÿ“š

Model Catalog

Centralized registry of 40+ AI models from 11 providers with short aliases, pricing data, and automatic API key detection.

๐Ÿ‘ค

Model Profiles

Named model configurations with instant switching and prefix shortcuts for rapid context changes.

โšก

Convergence Engine

Multi-model ensemble orchestration using the Mixture-of-Agents pattern for higher quality outputs.

๐Ÿ“š Model Catalog

The Model Catalog is a centralized registry that simplifies working with multiple AI providers and models.

Supported Providers

Provider Models Available Environment Variable
AnthropicClaude Opus 4, Sonnet 4, Haiku 4.5ANTHROPIC_API_KEY
OpenAIGPT-4o, GPT-4, o1, o3-mini, GPT-4o-miniOPENAI_API_KEY
GoogleGemini 2.0 Flash, Gemini 2.5 ProGOOGLE_API_KEY
DeepSeekDeepSeek V3, DeepSeek R1DEEPSEEK_API_KEY
MistralMistral Large, CodestralMISTRAL_API_KEY
GroqLlama 3.3 70B, DeepSeek R1 DistillGROQ_API_KEY
TogetherVarious open modelsTOGETHER_API_KEY
OpenRouter100+ models via unified APIOPENROUTER_API_KEY
OpenCanCustom modelsOPENCAN_API_KEY
OllamaLocal models (CodeLlama, Qwen, etc.)None (local)
LM StudioLocal modelsNone (local)

Short Aliases

Use convenient short names instead of full model identifiers:

sonnet

Claude Sonnet 4 - Balanced performance

opus

Claude Opus 4 - Highest quality

haiku

Claude Haiku 4.5 - Fastest, cheapest

gpt4o

GPT-4o - OpenAI flagship

mini

GPT-4o-mini - Fast and cheap

deepseek

DeepSeek V3 - Cost-effective

Checking Available Models

# See all models in catalog
/converge catalog

# See only models with API keys set
/converge available

# Search for specific capabilities
/converge search code
/converge search fast
/converge search free

๐Ÿ’ก Tip: Auto-Detection

The catalog automatically detects which providers you have API keys for by checking standard environment variables. Models from providers without API keys will be marked as unavailable.

๐Ÿ‘ค Model Profiles

Model Profiles let you create named configurations for different AI models and switch between them instantly.

Creating Profiles

From Built-in Templates

# List available templates
/profile templates

# Create from template
/profile template fast
/profile template power
/profile template creative

Interactive Creation

# Create custom profile
/profile create myprofile

# You'll be prompted for:
# - Provider (anthropic, openai, etc.)
# - Model (sonnet, gpt4o, etc.)
# - Temperature (0.0-1.0)
# - Max tokens
# - Description
# - Prefix trigger (optional)

Built-in Templates

Template Model Prefix Use Case
fastClaude Haikuquick:Quick questions, simple tasks
defaultClaude Sonnet 4-Balanced quality/speed
powerClaude Opus 4think:Complex reasoning, critical tasks
creativeSonnet (high temp)create:Creative writing, brainstorming
gptGPT-4 Turbogpt:Alternative perspective
localOllamalocal:Privacy, offline work

Using Profiles

Activate a Profile

# Switch to a profile
/profile fast
/profile power
/profile myprofile

# View current profile and all available
/profile

# Deactivate profile (return to global config)
/profile off

Prefix Shortcuts

Set a prefix trigger to temporarily use a profile for a single response:

# Set prefix for a profile
/profile prefix fast quick:
/profile prefix power think:

# Use prefix in conversation
quick: what is recursion?
think: design a distributed cache system

โ„น๏ธ How Prefix Shortcuts Work

When you type a message starting with a registered prefix (e.g., quick: your question), OCCode:

  1. Detects the prefix and finds the associated profile
  2. Temporarily switches to that profile's model
  3. Sends your message (with prefix removed)
  4. Restores your previous model after the response

This lets you quickly switch contexts without changing your active profile.

Managing Profiles

# Edit existing profile
/profile edit myprofile

# Delete profile
/profile delete myprofile

# Set default profile (auto-activates on startup)
/profile default fast

# Export profiles (for sharing with team)
/profile export

# Import profiles
/profile import profiles.json

Profile Configuration

Profiles are stored in ~/.occode/profiles.json with secure file permissions (0600):

{
  "profiles": {
    "fast": {
      "name": "fast",
      "provider": "anthropic",
      "model": "claude-haiku-4-5-20251001",
      "temperature": 0.3,
      "maxTokens": 2048,
      "triggerPrefix": "quick:",
      "description": "Quick answers, low cost",
      "createdAt": "2025-02-01T..."
    }
  },
  "activeProfile": "fast",
  "defaultProfile": null
}

โšก Convergence Engine

The Convergence Engine runs multiple AI models in parallel and combines their outputs for higher quality results.

Core Concept

Instead of asking one model for an answer, convergence:

  1. Generates - Multiple models work on the task simultaneously
  2. Synthesizes - An aggregator model combines the best parts
  3. Returns - A single, higher-quality response

โš ๏ธ Cost Considerations

Convergence uses multiple models, which increases both token usage and API costs. A typical duo-merge preset might use 2-3x the tokens of a single model. Use convergence for important tasks where quality matters more than cost.

Convergence Strategies

Strategy How It Works Best For API Calls
merge All models generate โ†’ aggregator synthesizes High-quality code, complex tasks N + 1
vote All models generate โ†’ all vote on best Multiple valid solutions, picking best N + N
debate Generate โ†’ critique โ†’ revise (multiple rounds) Critical decisions, thorough analysis N ร— rounds ร— 3
review One generates โ†’ another reviews โ†’ first revises Code review workflow, cost-effective 3-4

Quick Start with Presets

The easiest way to use convergence is with built-in presets:

# View available presets
/converge preset

# Apply a preset
/converge preset duo-merge
/converge preset code-review
/converge preset trio-merge

# Enable convergence
/converge on

# Now your messages use convergence
write a binary search function

# Disable when done
/converge off

Built-in Presets

Preset Models Strategy Description
duo-merge Sonnet + GPT-4 โ†’ Sonnet merge Best balance of quality and cost
trio-merge Sonnet + GPT-4 + Haiku โ†’ Sonnet merge Maximum quality, diverse perspectives
code-review Sonnet โ†’ GPT-4 (review) review Cost-effective quality assurance
debate Sonnet โ†” GPT-4 (2 rounds) debate Thorough analysis through dialogue
vote 3 models generate + vote vote Democratic selection
local-merge CodeLlama + DeepSeek (local) merge Private, no API costs

Custom Convergence Configuration

Adding Models

# Add models using short aliases
/converge add sonnet
/converge add gpt4o
/converge add haiku

# Or specify explicitly
/converge add mymodel anthropic claude-sonnet-4-20250514

# Remove models
/converge remove haiku

# View configured models
/converge models

Setting Strategy

# Change strategy
/converge strategy merge
/converge strategy vote
/converge strategy debate
/converge strategy review

# View strategy details
/converge strategy

Configuring Aggregator

# Set which model synthesizes results (merge strategy)
/converge aggregator sonnet
/converge aggregator gpt4o

# View current aggregator
/converge aggregator

Debate Rounds

# Set number of debate rounds (1-5)
/converge rounds 3

# View current setting
/converge rounds

Viewing Results

# Show individual model outputs (before synthesis)
/converge show on

# Only show final converged output
/converge show off

# View last convergence result with statistics
/converge last

# View current status and configuration
/converge

Configuration Management

# Export configuration
/converge export my-config.json

# Import configuration
/converge import my-config.json

# Reset to defaults
/converge reset

๐Ÿ’ก Cost Optimization Tips

๐Ÿงช Testing Features

Testing Model Profiles

Test 1: Create and Activate Profile

# 1. Create a fast profile
/profile template fast

# 2. Verify it was created
/profile

# 3. Activate it
/profile fast

# 4. Verify it's active (should show checkmark)
/profile

Expected Result: Profile is listed with a green โ†’ indicator showing it's active.

Test 2: Prefix Shortcuts

# 1. Ensure fast profile has prefix
/profile prefix fast quick:

# 2. Test prefix usage
quick: what is 2 + 2?

# 3. Send regular message
what is 3 + 3?

Expected Result:

Test 3: Profile Switching

# 1. Create power profile
/profile template power

# 2. Switch to power
/profile power

# 3. Verify active
/profile

# 4. Switch back
/profile off

Expected Result: Status shows correct active profile at each step.

Testing Convergence Engine

Test 1: Basic Convergence

# 1. Load a preset
/converge preset duo-merge

# 2. Check configuration
/converge

# 3. Enable convergence
/converge on

# 4. Send a task
write a function to check if a number is prime

# 5. Disable
/converge off

Expected Result:

Test 2: View Individual Outputs

# 1. Enable individual output display
/converge show on

# 2. Enable convergence
/converge on

# 3. Send task
explain quicksort algorithm

# 4. Observe output

Expected Result:

Test 3: Different Strategies

# Test Review Strategy
/converge preset code-review
/converge on
write a binary search function
/converge off

# Test Vote Strategy
/converge preset vote
/converge on
what's the best sorting algorithm for large datasets?
/converge off

# View last results
/converge last

Expected Result: Each strategy produces different execution patterns visible in the statistics.

Testing Model Catalog

# 1. View all available models
/converge available

# 2. Search for specific models
/converge search fast
/converge search code

# 3. Browse full catalog
/converge catalog

# 4. Filter by provider
/converge search anthropic

Expected Result: Models are listed with pricing, capabilities, and availability status (โœ“ or โœ— based on API key).

Integration Test: Profiles + Convergence

# 1. Create profile with specific model
/profile create test_profile
# Choose: anthropic, sonnet, 0.7, 4096

# 2. Activate it
/profile test_profile

# 3. Enable convergence
/converge preset duo-merge
/converge on

# 4. Send task
explain recursion

# 5. Check that convergence works with profile active
/converge
/profile

Expected Result: Convergence uses its configured models (not the active profile). Both systems work independently.

๐Ÿ”ง Troubleshooting

Model Profiles Issues

Profile Not Found

Issue: Profile "myprofile" not found

Solution:

# List all profiles to check spelling
/profile

# Recreate if needed
/profile template fast

Prefix Not Triggering

Issue: Typing quick: message doesn't activate profile

Solution:

API Key Missing for Profile

Issue: No API key for anthropic when activating profile

Solution:

# Set API key for the provider
export ANTHROPIC_API_KEY="sk-ant-..."

# Or set via OCCode
occode config --set-key --provider anthropic

Profile File Permissions

Issue: Cannot save profiles

Solution:

# Check and fix permissions
chmod 600 ~/.occode/profiles.json

# Recreate if corrupted
rm ~/.occode/profiles.json
/profile template fast

Convergence Engine Issues

No Models Configured

Issue: No models configured yet when enabling convergence

Solution:

# Use a preset
/converge preset duo-merge

# Or add models manually
/converge add sonnet
/converge add gpt4o
/converge aggregator sonnet

Model Not Available

Issue: Model sonnet not available

Solution:

# Check available models
/converge available

# Ensure API key is set
export ANTHROPIC_API_KEY="sk-ant-..."

# Verify in catalog
/converge catalog

Convergence Taking Too Long

Issue: Convergence requests timeout or take very long

Solution:

High Costs

Issue: Convergence is expensive

Solution:

# Use cost-effective strategy
/converge preset code-review

# Use cheaper models
/converge add haiku
/converge add mini
/converge aggregator haiku

# Disable when not needed
/converge off

# Check cost before running
/converge  # Shows last run cost

Individual Outputs Not Showing

Issue: Can't see what each model generated

Solution:

# Enable individual output display
/converge show on

# View last convergence details
/converge last

Model Catalog Issues

Model Alias Not Recognized

Issue: Unknown model alias: xyz

Solution:

# Search catalog for correct alias
/converge search xyz

# View all available aliases
/converge catalog

# Use explicit form if needed
/converge add myname provider full-model-id

No Available Models

Issue: /converge available shows no models

Solution:

# Check environment variables
env | grep API_KEY

# Set missing API keys
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."

# Restart OCCode to pick up new env vars

General Troubleshooting

Features Not Available

Issue: /profile or /converge command not found

Solution:

# Verify OCCode version
occode --version
# Should be v0.2.0 or later

# Update by downloading the latest version from opencan.ai/downloads
# Then replace the binary:
tar xzf occode-latest-linux-x64.tar.gz
sudo mv occode /usr/local/bin/

Config File Corruption

Issue: Features behaving strangely or errors about JSON

Solution:

# Backup existing config
cp ~/.occode/profiles.json ~/.occode/profiles.json.bak
cp ~/.occode/convergence.json ~/.occode/convergence.json.bak

# Remove corrupted configs
rm ~/.occode/profiles.json
rm ~/.occode/convergence.json

# Recreate from scratch
/profile template fast
/converge preset duo-merge

Get More Help

# View built-in help
/help

# Check OCCode documentation
https://opencan.ai/docs

# Contact support
support@opencan.ai

# Community forum
https://opencan.ai/community

๐Ÿ“š Additional Resources

Quick Reference Card

Category Command Description
Profiles/profileShow status and list all
/profile template fastCreate from template
/profile <name>Activate profile
quick: messageUse prefix shortcut
Convergence/converge preset duo-mergeLoad preset
/converge onEnable convergence
/converge offDisable convergence
/converge lastView last result stats
Catalog/converge catalogBrowse all models
/converge availableShow available models
/converge search <term>Search models
Login Admin Dashboard
Products and Docs
OCCode CLI User Guide OCCode CLI Admin Guide OCCode CLI Install guide OCCode CLI Full DOcumentation OCCode Pricing
Blog
AI Articles Technical Topics Applications
About Us Terms of Service Privacy Policy Contact Us