diff --git a/cortex-js/src/infrastructure/commanders/embeddings.command.ts b/cortex-js/src/infrastructure/commanders/embeddings.command.ts index 68d874364..473c84254 100644 --- a/cortex-js/src/infrastructure/commanders/embeddings.command.ts +++ b/cortex-js/src/infrastructure/commanders/embeddings.command.ts @@ -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[]) => { diff --git a/cortex-js/src/infrastructure/commanders/models/model-pull.command.ts b/cortex-js/src/infrastructure/commanders/models/model-pull.command.ts index 8629a850b..7abc1346a 100644 --- a/cortex-js/src/infrastructure/commanders/models/model-pull.command.ts +++ b/cortex-js/src/infrastructure/commanders/models/model-pull.command.ts @@ -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); }); diff --git a/cortex-js/src/infrastructure/commanders/serve.command.ts b/cortex-js/src/infrastructure/commanders/serve.command.ts index 468fc4de3..ba6b4138e 100644 --- a/cortex-js/src/infrastructure/commanders/serve.command.ts +++ b/cortex-js/src/infrastructure/commanders/serve.command.ts @@ -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); } } diff --git a/cortex-js/src/infrastructure/commanders/shortcuts/run.command.ts b/cortex-js/src/infrastructure/commanders/shortcuts/run.command.ts index c2df6259b..32266d3e0 100644 --- a/cortex-js/src/infrastructure/commanders/shortcuts/run.command.ts +++ b/cortex-js/src/infrastructure/commanders/shortcuts/run.command.ts @@ -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); }); } diff --git a/cortex-js/src/infrastructure/commanders/usecases/chat.cli.usecases.ts b/cortex-js/src/infrastructure/commanders/usecases/chat.cli.usecases.ts index 35a686c28..710a13902 100644 --- a/cortex-js/src/infrastructure/commanders/usecases/chat.cli.usecases.ts +++ b/cortex-js/src/infrastructure/commanders/usecases/chat.cli.usecases.ts @@ -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(); }); diff --git a/cortex-js/src/main.ts b/cortex-js/src/main.ts index e54d8f10e..16890cc5b 100644 --- a/cortex-js/src/main.ts +++ b/cortex-js/src/main.ts @@ -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); } } diff --git a/cortex-js/src/usecases/models/models.usecases.ts b/cortex-js/src/usecases/models/models.usecases.ts index 4a1c66e95..db0d6f886 100644 --- a/cortex-js/src/usecases/models/models.usecases.ts +++ b/cortex-js/src/usecases/models/models.usecases.ts @@ -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(