Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class EmbeddingCommand extends CommandRunner {
inspect(res, { showHidden: false, depth: null, colors: true }),
)
.then(console.log)
.catch(console.error);
.catch((e) => console.error(e.message ?? e));
}

modelInquiry = async (models: ModelStat[]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class ModelPullCommand extends CommandRunner {
await this.modelsCliUsecases.pullModel(modelId).catch((e: Error) => {
if (e instanceof ModelNotFoundException)
console.error('Model does not exist.');
else console.error(e);
else console.error(e.message ?? e);
exit(1);
});

Expand Down
2 changes: 1 addition & 1 deletion cortex-js/src/infrastructure/commanders/serve.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class ServeCommand extends CommandRunner {
chalk.blue(`API Playground available at http://${host}:${port}/api`),
);
} catch (err) {
console.error(err.message);
console.error(err.message ?? err);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class RunCommand extends CommandRunner {
await this.modelsCliUsecases.pullModel(modelId).catch((e: Error) => {
if (e instanceof ModelNotFoundException)
console.error('Model does not exist.');
else console.error(e);
else console.error(e.message ?? e);
exit(1);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class ChatCliUsecases {
let assistantResponse: string = '';

response.on('error', (error: any) => {
console.error(error);
console.error(error.message ?? error);
if (attach) rl.prompt();
else rl.close();
});
Expand Down
2 changes: 1 addition & 1 deletion cortex-js/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function bootstrap() {
chalk.blue(`API Playground available at http://${host}:${port}/api`),
);
} catch (err) {
console.error(err.message);
console.error(err.message ?? err);
}
}

Expand Down
12 changes: 11 additions & 1 deletion cortex-js/src/usecases/models/models.usecases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,18 @@ export class ModelsUsecases {
throw new BadRequestException('Model already exists');
}

// Fetch the repo data
// ONNX only supported on Windows
if (modelId.includes('onnx') && process.platform !== 'win32') {
throw new BadRequestException('ONNX models are not supported on this OS');
}

if (modelId.includes('tensorrt-llm') && process.platform === 'darwin') {
throw new BadRequestException(
'Tensorrt-LLM models are not supported on this OS',
);
}

// Fetch the repo data
const data = await this.fetchModelMetadata(modelId);
// Pull the model.yaml
await this.populateHuggingFaceModel(
Expand Down