refactoring and clean up
This commit is contained in:
@@ -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
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user