unified-ai-router 3.2.0 → 3.2.2

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.
@@ -27,7 +27,7 @@ body:json {
27
27
  "content": "Hello, say two words only."
28
28
  }
29
29
  ],
30
- "model": "x-ai/grok-4-fast:free",
30
+ "model": "test",
31
31
  "temperature": 0,
32
32
  "stream": true
33
33
  }
package/main.js CHANGED
@@ -116,11 +116,11 @@ class AIRouter
116
116
  const client = this.createClient( provider );
117
117
 
118
118
  const params = {
119
- model: provider.model,
120
119
  messages,
121
120
  ...tools && tools.length > 0 ? { tools } : {},
122
121
  stream: isStreaming,
123
- ...restOptions
122
+ ...restOptions,
123
+ model: provider.model
124
124
  };
125
125
 
126
126
  const { data, response: rawResponse } = await client.chat.completions.create( params ).withResponse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unified-ai-router",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
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
@@ -1,10 +1,4 @@
1
1
  module.exports = [
2
- {
3
- name: "openrouter",
4
- apiKey: process.env.OPENROUTER_API_KEY,
5
- model: "deepseek/deepseek-r1-0528-qwen3-8b:free",
6
- apiUrl: "https://openrouter.ai/api/v1",
7
- },
8
2
  {
9
3
  name: "openrouter",
10
4
  apiKey: process.env.OPENROUTER_API_KEY,
@@ -17,13 +11,6 @@ module.exports = [
17
11
  model: "gpt-oss-120b",
18
12
  apiUrl: "https://api.cerebras.ai/v1",
19
13
  },
20
- {
21
- name: "openrouter",
22
- apiKey: process.env.OPENROUTER_API_KEY,
23
- model: "z-ai/glm-4.5-air:free",
24
- apiUrl: "https://openrouter.ai/api/v1",
25
- },
26
-
27
14
  {
28
15
  name: "vercel",
29
16
  apiKey: process.env.VERCEL_AI_GATEWAY_API_KEY,
@@ -36,13 +23,18 @@ module.exports = [
36
23
  model: "openai/gpt-oss-120b",
37
24
  apiUrl: "https://api.groq.com/openai/v1",
38
25
  },
39
-
40
26
  {
41
27
  name: "google",
42
28
  apiKey: process.env.GOOGLE_API_KEY,
43
29
  model: "gemini-2.5-pro",
44
30
  apiUrl: "https://generativelanguage.googleapis.com/v1beta/openai/",
45
31
  },
32
+ {
33
+ name: "openrouter",
34
+ apiKey: process.env.OPENROUTER_API_KEY,
35
+ model: "z-ai/glm-4.5-air:free",
36
+ apiUrl: "https://openrouter.ai/api/v1",
37
+ },
46
38
  {
47
39
  name: "google",
48
40
  apiKey: process.env.GOOGLE_API_KEY,
package/readme.md CHANGED
@@ -123,6 +123,30 @@ node tests/openai-server-stream.js
123
123
  node tests/tools.js
124
124
  ```
125
125
 
126
+ ### 🌐 Deploying to Render.com
127
+
128
+ Ensure `provider.js` is configured with API keys in `.env` (as above). Push to GitHub, then:
129
+
130
+ 1. **Dashboard**:
131
+ - Create Web Service on [Render.com](https://render.com), connect repo.
132
+ - Build Command: `npm install`
133
+ - Start Command: `npm start`
134
+ - Add env vars (e.g., `OPENAI_API_KEY=sk-...`).
135
+ - Deploy.
136
+
137
+ 2. **CLI**:
138
+
139
+ ```bash
140
+ curl -fsSL https://raw.githubusercontent.com/render-oss/cli/refs/heads/main/bin/install.sh | sh
141
+ render login
142
+ render services # Manage services
143
+ ```
144
+
145
+ 3. **Verify**:
146
+ - Access `https://your-service.onrender.com/models` (e.g., [unified-ai-router.onrender.com/models](https://unified-ai-router.onrender.com/models)).
147
+
148
+ See [Render docs](https://render.com/docs) for details.
149
+
126
150
  ## 🔧 Supported Providers
127
151
 
128
152
  - OpenAI