implemented inference service

This commit is contained in:
Storme-bit
2026-04-05 04:18:05 -07:00
parent 2bbdd21bd3
commit a449d570ea
6 changed files with 180 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
require ('dotenv').config();
const express = require('express');
const {getEnv} = require('@nexusai/shared');
const inferenceRouter = require('./routes/inference');
const app = express();
app.use(express.json());
@@ -9,9 +10,16 @@ const PORT = getEnv('PORT', '3001'); // Default to 3001 if PORT is not set
// Health check endpoint
app.get('/health', (req, res) => {
res.json({ service: 'Inference Service', status: 'healthy' });
res.json({
service: 'Inference Service',
status: 'healthy',
provider: getEnv('INFERENCE_PROVIDER', 'ollama'),
model: getEnv('DEFAULT_MODEL', 'llama3.2')
});
});
app.use('/', inferenceRouter);
// Start the server
app.listen(PORT, () => {
console.log(`Inference Service is running on port ${PORT}`);