opencode Verified current stable Not installed? Version Control

Opencode / Show Top N Models By Usage

Show Top N Models By Usage

Showcases the top N models by usage metrics via the Opencode CLI.

$
Terminal
opencode stats --models <5>

When To Use

For performance tuning sessions focused on optimizing key models during high workload scenarios.

Pro Tip

Use `--sort descending` to prioritize high-usage models for closer analysis of resource allocation.

Anatomy of Output

Understanding the result

1. Model X: 900 uses Top Model X

Highest leveraged model indicating criticality in architecture.

2. Model Y: 670 uses Second Model Y

Second most used; assess architectural importance.

3. Model Z: 350 uses Third Model Z

Moderately used; potential for optimization.

Power User Variants

Optimized versions

opencode stats --models 10 --sort descending

Retrieves top 10 models sorted by usage in descending order.

opencode stats --models 1

Quickly fetches the single most used model.

Troubleshooting

Common pitfalls

Error: Invalid model count

Solution: Ensure the count is within the limits of available models.

Error: No usage data available

Solution: Check if models were recently deployed.

Error: Unknown parameter --models

Solution: Verify the command syntax against the Opencode documentation.

Command Breakdown

What each part is doing

opencode
Base Command
The executable that performs this operation. Here it runs Opencode before the shell applies any redirect operators.
<5>
5
The value supplied for 5.
--models
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative version control tools for the same job.