MCPcopy Create free account
hub / github.com/braintrustdata/bash-agent-evals / createModel

Function createModel

src/models.ts:99–116  ·  view source on GitHub ↗
(modelId: ModelId)

Source from the content-addressed store, hash-verified

97 * Create a language model instance from a ModelId
98 */
99export function createModel(modelId: ModelId): LanguageModel {
100 const config = MODEL_CONFIG[modelId];
101 if (!config) {
102 throw new Error(
103 `Unknown model: ${modelId}. Supported models: ${getSupportedModels().join(', ')}`,
104 );
105 }
106
107 if (config.provider === 'anthropic') {
108 return anthropic(config.modelId);
109 } else if (config.provider === 'baseten') {
110 return getBasetenProvider()(config.modelId);
111 } else if (config.provider === 'modal') {
112 return getModalProvider()(config.modelId);
113 } else {
114 return openai(config.modelId);
115 }
116}

Callers 7

runFsAgentFunction · 0.85
runSqlAgentFunction · 0.85
runBashAgentFunction · 0.85
runCodemodeAgentFunction · 0.85
runBashSqliteAgentFunction · 0.85
runEmbeddingAgentFunction · 0.85

Calls 3

getSupportedModelsFunction · 0.85
getBasetenProviderFunction · 0.85
getModalProviderFunction · 0.85

Tested by

no test coverage detected