Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/upskill/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,31 @@

console = Console()

KNOWN_PROVIDERS = ("anthropic", "openai", "generic")


def _model_has_provider(model: str) -> bool:
return any(model.startswith(f"{provider}.") for provider in KNOWN_PROVIDERS)


def _apply_provider_to_models(models: list[str], provider: str | None) -> list[str]:
if not provider:
return models
normalized: list[str] = []
for model in models:
if _model_has_provider(model):
normalized.append(model)
else:
normalized.append(f"{provider}.{model}")
return normalized


@asynccontextmanager
async def _fast_agent_context() -> AsyncIterator[object]:
fast = FastAgent(
"upskill",
ignore_unknown_args=True,
parse_cli_args=False, # Prevent FastAgent from consuming upskill CLI flags (e.g. -m).
)

@fast.agent()
Expand Down Expand Up @@ -719,6 +738,8 @@ async def _eval_async(
if not models:
models = [config.effective_eval_model]

models = _apply_provider_to_models(models, provider)

is_benchmark_mode = len(models) > 1 or num_runs > 1

async with _fast_agent_context() as agent:
Expand Down