% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare_model_predictions.R
\name{compare_model_predictions}
\alias{compare_model_predictions}
\title{Compare predictions from different models}
\usage{
compare_model_predictions(
  input,
  tissue_name,
  models = c("claude-opus-4-7", "gpt-5.5", "gemini-3.1-pro-preview", "deepseek-v4-flash",
    "qwen3.6-plus", "grok-4.3"),
  api_keys,
  top_gene_count = 10,
  consensus_threshold = 0.5,
  base_urls = NULL
)
}
\arguments{
\item{input}{Either a data frame from Seurat's FindAllMarkers() containing columns 'cluster', 'gene', and 'avg_log2FC', or a list with 'genes' field for each cluster}

\item{tissue_name}{Tissue context (e.g., 'human PBMC', 'mouse brain') for more accurate annotations}

\item{models}{Vector of model names to use for comparison. Default includes top models from each provider}

\item{api_keys}{Named list of API keys for the models, with provider or model names as keys.
Every model in \code{models} must resolve to a non-NULL API key.}

\item{top_gene_count}{Number of top genes to use per cluster when input is from Seurat. Default: 10}

\item{consensus_threshold}{Minimum agreement threshold for consensus (0-1). Default: 0.5.
Consensus is only evaluated when at least two non-missing model predictions are available for a cluster.}

\item{base_urls}{Optional base URLs for API endpoints. Can be a string or named list for provider-specific custom endpoints.}
}
\value{
List containing individual model predictions and consensus analysis
If a cluster has fewer than two valid predictions after alignment/padding,
its consensus-related outputs are \code{NA}.
}
\description{
This function runs the same input through multiple models and compares their predictions.
It provides both individual predictions and a consensus analysis.
}
\note{
This function uses create_standardization_prompt from prompt_templates.R
Supported models:
\itemize{
\item OpenAI: 'gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini'
\item Anthropic: 'claude-opus-4-7', 'claude-opus-4-6', 'claude-sonnet-4-6', 'claude-haiku-4-5-20251001'
\item DeepSeek: 'deepseek-v4-flash', 'deepseek-v4-pro'
\item Google: 'gemini-3.1-pro-preview', 'gemini-3-flash-preview', 'gemini-3.1-flash-lite'
\item Alibaba: 'qwen3.6-max-preview', 'qwen3.6-plus', 'qwen3.6-flash'
\item Stepfun: 'step-3.5-flash', 'step-3.5-flash-2603', 'step-3'
\item Zhipu/Z.AI: 'glm-5.1', 'glm-5-turbo', 'glm-5'
\item MiniMax: 'MiniMax-M2.7', 'MiniMax-M2.7-highspeed', 'MiniMax-M2.5'
\item X.AI: 'grok-4.3', 'grok-4.3-latest', 'grok-latest'
\item OpenRouter: Provides access to models from multiple providers through a single API. Format: 'provider/model-name'
\itemize{
\item OpenAI models: 'openai/gpt-5.5', 'openai/gpt-5.4-mini'
\item Anthropic models: 'anthropic/claude-opus-4.7', 'anthropic/claude-sonnet-4.6'
\item Google models: 'google/gemini-3.1-pro-preview', 'google/gemini-3-flash-preview'
\item X.AI models: 'x-ai/grok-4.3'
\item Stepfun models: 'stepfun/step-3.5-flash'
}
}
\enumerate{
\item With provider names as keys: \code{list("openai" = "sk-...", "anthropic" = "sk-ant-...", "openrouter" = "sk-or-...")}
\item With model names as keys: \code{list("gpt-5.5" = "sk-...", "claude-sonnet-4-6" = "sk-ant-...")}
}

The system first tries to find the API key using the provider name. If not found, it then tries using the model name.
Example:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{api_keys <- list(
  "openai" = Sys.getenv("OPENAI_API_KEY"),
  "anthropic" = Sys.getenv("ANTHROPIC_API_KEY"),
  "openrouter" = Sys.getenv("OPENROUTER_API_KEY"),
  "claude-opus-4-7" = "your-claude-opus-key"
)
}\if{html}{\out{</div>}}
}
\examples{
\dontrun{
# Compare predictions using different models
api_keys <- list(
  "claude-sonnet-4-6" = "your-anthropic-key",
  "deepseek-v4-pro" = "your-deepseek-key",
  "gemini-3.1-pro-preview" = "your-gemini-key",
  "qwen3.6-plus" = "your-qwen-key"
)

results <- compare_model_predictions(
  input = list(gs1=c('CD4','CD3D'), gs2='CD14'),
  tissue_name = 'PBMC',
  api_keys = api_keys
)
}
}
