unified-ai-router 3.4.4 → 3.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/openai-server.js +20 -1
- package/package.json +1 -1
- package/provider.js +6 -1
package/openai-server.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const http = require( "http" );
|
|
1
2
|
const express = require( "express" );
|
|
2
3
|
const cors = require( "cors" );
|
|
3
4
|
const pino = require( "pino" );
|
|
@@ -99,9 +100,27 @@ app.get( "/providers/status", async ( req, res ) =>
|
|
|
99
100
|
}
|
|
100
101
|
});
|
|
101
102
|
|
|
102
|
-
// Start server
|
|
103
103
|
const PORT = process.env.PORT || 3000;
|
|
104
104
|
app.listen( PORT, () =>
|
|
105
105
|
{
|
|
106
106
|
logger.info( `🚀 OpenAI-compatible API listening at http://localhost:${PORT}/v1/chat/completions` );
|
|
107
|
+
|
|
108
|
+
setTimeout( () =>
|
|
109
|
+
{
|
|
110
|
+
const url = `http://localhost:${PORT}/health`;
|
|
111
|
+
http.get( url, ( res ) =>
|
|
112
|
+
{
|
|
113
|
+
if ( res.statusCode === 200 )
|
|
114
|
+
{
|
|
115
|
+
logger.info( "Keep-alive ping successful." );
|
|
116
|
+
}
|
|
117
|
+
else
|
|
118
|
+
{
|
|
119
|
+
logger.error( `Keep-alive ping failed with status code: ${res.statusCode}` );
|
|
120
|
+
}
|
|
121
|
+
}).on( "error", ( err ) =>
|
|
122
|
+
{
|
|
123
|
+
logger.error( "Error sending keep-alive ping:", err.message );
|
|
124
|
+
});
|
|
125
|
+
}, 14 * 60 * 1000 ); // 14 minutes
|
|
107
126
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unified-ai-router",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.5",
|
|
4
4
|
"description": "A unified interface for multiple LLM providers with automatic fallback. This project includes an OpenAI-compatible server and a deployable Telegram bot with a Mini App interface. It supports major providers like OpenAI, Google, Grok, and more, ensuring reliability and flexibility for your AI applications.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "mlibre",
|
package/provider.js
CHANGED
|
@@ -36,13 +36,18 @@ module.exports = [
|
|
|
36
36
|
process.env.OPENROUTER_API_KEY,
|
|
37
37
|
process.env.OPENROUTER_API_KEY_2,
|
|
38
38
|
process.env.OPENROUTER_API_KEY_3,
|
|
39
|
+
process.env.OPENROUTER_API_KEY_4,
|
|
40
|
+
process.env.OPENROUTER_API_KEY_5
|
|
39
41
|
],
|
|
40
42
|
model: "z-ai/glm-4.5-air:free",
|
|
41
43
|
apiUrl: "https://openrouter.ai/api/v1",
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
46
|
name: "qroq",
|
|
45
|
-
apiKey:
|
|
47
|
+
apiKey: [
|
|
48
|
+
process.env.QROQ_API_KEY,
|
|
49
|
+
process.env.QROQ_API_KEY_2
|
|
50
|
+
],
|
|
46
51
|
model: "openai/gpt-oss-120b",
|
|
47
52
|
apiUrl: "https://api.groq.com/openai/v1",
|
|
48
53
|
},
|