refactoring and clean up

This commit is contained in:
Storme-bit
2026-04-07 01:30:35 -07:00
parent 0aea052311
commit 2b75f75733
18 changed files with 191 additions and 115 deletions

View File

@@ -1,20 +1,22 @@
require ('dotenv').config();
const express = require('express');
const {getEnv} = require('@nexusai/shared');
const {getEnv, PORTS, OLLAMA} = require('@nexusai/shared');
const inferenceRouter = require('./routes/inference');
const app = express();
app.use(express.json());
const PORT = getEnv('PORT', '3001'); // Default to 3001 if PORT is not set
const PORT = getEnv('PORT', PORTS.INFERENCE);
const PROVIDER = getEnv('INFERENCE_PROVIDER', 'ollama');
const MODEL = getEnv('DEFAULT_MODEL', OLLAMA.OLLAMA_MODEL)
// Health check endpoint
app.get('/health', (req, res) => {
res.json({
service: 'Inference Service',
status: 'healthy',
provider: getEnv('INFERENCE_PROVIDER', 'ollama'),
model: getEnv('DEFAULT_MODEL', 'llama3.2')
provider: PROVIDER,
model: MODEL
});
});