iaurora 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Gurveer
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,231 @@
1
+ <div align="center">
2
+
3
+ <img alt="Aurora OSS" src="dashboard-ui/public/aurora-oss-logo.svg" width="72">
4
+
5
+ # Aurora OSS
6
+
7
+ **One gateway. Every provider. Open source.**
8
+
9
+ Route AI traffic through a single OpenAI- and Anthropic-compatible API.
10
+ Self-hosted. No vendor lock-in. Full source visibility.
11
+
12
+ <table>
13
+ <tr>
14
+ <td><a href="https://github.com/gurveeer/Aurora/actions/workflows/test.yml"><img src="https://github.com/gurveeer/Aurora/actions/workflows/test.yml/badge.svg" alt="CI"></a></td>
15
+ <td><a href="https://github.com/gurveeer/Aurora/blob/main/go.mod"><img src="https://img.shields.io/github/go-mod/go-version/gurveeer/Aurora?style=flat-square&label=Go" alt="Go Version"></a></td>
16
+ <td><a href="https://github.com/gurveeer/Aurora/releases"><img src="https://img.shields.io/github/v/release/gurveeer/Aurora?style=flat-square" alt="Release"></a></td>
17
+ <td><a href="https://github.com/gurveeer/Aurora/stargazers"><img src="https://img.shields.io/github/stars/gurveeer/Aurora?style=flat-square" alt="Stars"></a></td>
18
+ </tr>
19
+ <tr>
20
+ <td><a href="LICENSE"><img src="https://img.shields.io/github/license/gurveeer/Aurora?style=flat-square" alt="License"></a></td>
21
+ <td><a href="https://hub.docker.com/r/gurveeer/Aurora"><img src="https://img.shields.io/docker/pulls/gurveeer/Aurora?style=flat-square" alt="Docker Pulls"></a></td>
22
+ <td><a href="https://github.com/gurveeer/Aurora/commits/main"><img src="https://img.shields.io/github/last-commit/gurveeer/Aurora?style=flat-square" alt="Last Commit"></a></td>
23
+ <td><a href="https://github.com/gurveeer/Aurora/issues"><img src="https://img.shields.io/github/issues/gurveeer/Aurora?style=flat-square" alt="Open Issues"></a></td>
24
+ </tr>
25
+ <tr>
26
+ <td><a href="https://github.com/gurveeer/Aurora/pulls"><img src="https://img.shields.io/badge/PRs-Welcome-brightgreen?style=flat-square" alt="PRs Welcome"></a></td>
27
+ <td><a href="https://discord.gg/gaEB9BQSPH"><img src="https://img.shields.io/badge/Discord-Join-5865F2?style=flat-square&logo=discord&logoColor=white" alt="Discord"></a></td>
28
+ <td></td>
29
+ <td></td>
30
+ </tr>
31
+ </table>
32
+
33
+ <a href="docs/assets/dashboard-overview.png">
34
+ <img src="docs/assets/dashboard-overview.png" alt="Aurora dashboard" width="100%">
35
+ </a>
36
+
37
+ </div>
38
+
39
+ ---
40
+
41
+ ## Get running in 30 seconds
42
+
43
+ **Docker**
44
+
45
+ ```bash
46
+ docker run --rm -p 8080:8080 \
47
+ -e OPENAI_API_KEY="sk-..." \
48
+ gurveeer/Aurora
49
+ ```
50
+
51
+ **From source**
52
+
53
+ ```bash
54
+ git clone https://github.com/gurveeer/Aurora.git && cd Aurora
55
+ pnpm --dir dashboard-ui install && pnpm --dir dashboard-ui run build
56
+ go build -o bin/aurora-oss.exe ./apps/aurora
57
+ ```
58
+
59
+ Then send your first request:
60
+
61
+ ```bash
62
+ curl http://localhost:8080/v1/chat/completions \
63
+ -H "Content-Type: application/json" \
64
+ -d '{"model":"gpt-5-chat-latest","messages":[{"role":"user","content":"Hello!"}]}'
65
+ ```
66
+
67
+ | | |
68
+ |---|---|
69
+ | Dashboard | `http://localhost:8080/admin/dashboard` |
70
+ | Health check | `http://localhost:8080/health` |
71
+ | Swagger | `http://localhost:8080/swagger/index.html` |
72
+
73
+ ---
74
+
75
+ ## What it does
76
+
77
+ Aurora sits between your application and AI providers. One API key, one endpoint, every model.
78
+
79
+ <p align="center">
80
+ <a href="docs/assets/analytics-overview.png">
81
+ <img src="docs/assets/analytics-overview.png" alt="Usage analytics" width="48%">
82
+ </a>
83
+ <a href="docs/assets/audit-logs.png">
84
+ <img src="docs/assets/audit-logs.png" alt="Audit logs" width="48%">
85
+ </a>
86
+ </p>
87
+
88
+ **Unified API** -- `/v1/chat/completions`, `/v1/responses`, `/v1/embeddings`, `/v1/models`, `/v1/files`, `/v1/batches`
89
+
90
+ **12 providers** -- OpenAI, Anthropic, Gemini, DeepSeek, Groq, OpenRouter, Z.ai, xAI, Azure OpenAI, Oracle, Ollama, vLLM (and any OpenAI-compatible backend)
91
+
92
+ **Routing** -- Model aliases, provider pools, fallback chains, workflow pipelines, passthrough routes
93
+
94
+ **Dashboard** -- Live usage analytics, provider status, cache hit rates, cost tracking, audit logs
95
+
96
+ **Controls** -- Managed API keys, model overrides, guardrails, pricing recalculation, exact + semantic response caching
97
+
98
+ **Storage** -- SQLite (default), PostgreSQL, MongoDB
99
+
100
+ ---
101
+
102
+ ## Providers
103
+
104
+ | Provider | Key | Chat | Embeddings | Files | Batches | Passthrough |
105
+ |---|---|:---:|:---:|:---:|:---:|:---:|
106
+ | OpenAI | `OPENAI_API_KEY` | ✅ | ✅ | ✅ | ✅ | ✅ |
107
+ | Anthropic | `ANTHROPIC_API_KEY` | ✅ | | | ✅ | ✅ |
108
+ | Google Gemini | `GEMINI_API_KEY` | ✅ | ✅ | ✅ | ✅ | |
109
+ | DeepSeek | `DEEPSEEK_API_KEY` | ✅ | | | | |
110
+ | Groq | `GROQ_API_KEY` | ✅ | ✅ | ✅ | ✅ | |
111
+ | OpenRouter | `OPENROUTER_API_KEY` | ✅ | ✅ | ✅ | ✅ | ✅ |
112
+ | Z.ai | `ZAI_API_KEY` | ✅ | ✅ | | | ✅ |
113
+ | xAI | `XAI_API_KEY` | ✅ | ✅ | ✅ | ✅ | |
114
+ | Azure OpenAI | `AZURE_API_KEY` + `AZURE_BASE_URL` | ✅ | ✅ | ✅ | ✅ | ✅ |
115
+ | Oracle | `ORACLE_API_KEY` + `ORACLE_BASE_URL` | ✅ | | | | |
116
+ | Ollama | `OLLAMA_BASE_URL` | ✅ | ✅ | | | |
117
+ | vLLM | `VLLM_BASE_URL` | ✅ | ✅ | | | ✅ |
118
+
119
+ > **Z.ai GLM Coding Plan:** set `ZAI_BASE_URL=https://api.z.ai/api/coding/paas/v4`
120
+ >
121
+ > **Multiple instances of one provider?** Use suffixed env vars: `OPENAI_EAST_API_KEY`, `OPENAI_EAST_BASE_URL`, `OPENAI_EAST_MODELS`
122
+
123
+ ---
124
+
125
+ ## Configuration
126
+
127
+ Aurora loads config in order: **defaults → YAML → env vars** (env vars win).
128
+
129
+ ```bash
130
+ # Copy the template
131
+ cp .env.template .env
132
+
133
+ # Pick a config profile
134
+ cp configs/editions/oss.example.yaml configs/config.yaml
135
+ ```
136
+
137
+ | Profile | Best for | External services |
138
+ |---|---|---|
139
+ | [`oss.example.yaml`](configs/editions/oss.example.yaml) | First run, individual devs | None |
140
+ | [`oss.local-power.example.yaml`](configs/editions/oss.local-power.example.yaml) | Local power users (cache, metrics, audit) | Redis |
141
+ | [`oss.team.example.yaml`](configs/editions/oss.team.example.yaml) | Small self-hosted teams | PostgreSQL, Redis, Qdrant |
142
+
143
+ **Key settings:**
144
+
145
+ | Setting | Default | What it does |
146
+ |---|---|---|
147
+ | `PORT` | `8080` | Listen port |
148
+ | `AURORA_MASTER_KEY` | -- | Gateway/admin API key (set before exposing outside localhost) |
149
+ | `STORAGE_TYPE` | `sqlite` | `sqlite`, `postgresql`, or `mongodb` |
150
+ | `LOGGING_ENABLED` | `false` | Audit logging |
151
+ | `METRICS_ENABLED` | `false` | Prometheus metrics |
152
+ | `GUARDRAILS_ENABLED` | `false` | Guardrail workflows |
153
+ | `ENABLE_PASSTHROUGH_ROUTES` | `true` | `/p/{provider}/...` passthrough |
154
+
155
+ Full reference: [`configs/config.example.yaml`](configs/config.example.yaml)
156
+
157
+ ---
158
+
159
+ ## Response caching
160
+
161
+ Two layers, both optional:
162
+
163
+ - **Exact cache** -- hashes request path + body, returns `X-Cache: HIT (exact)` on identical requests. Enable with `RESPONSE_CACHE_SIMPLE_ENABLED` + Redis.
164
+ - **Semantic cache** -- embeds prompts, searches vector store for similar requests. Returns `X-Cache: HIT (semantic)`. Supports `qdrant`, `pgvector`, `pinecone`, `weaviate`.
165
+
166
+ Per-request bypass: `Cache-Control: no-cache` or `Cache-Control: no-store`.
167
+
168
+ ---
169
+
170
+ ## Docker Compose
171
+
172
+ ```bash
173
+ # Infrastructure only (Redis, Qdrant, Postgres)
174
+ docker compose up -d
175
+
176
+ # Full stack (Aurora + infra)
177
+ cp .env.template .env
178
+ docker compose --profile app up -d
179
+
180
+ # Local image build
181
+ docker build -t aurora-oss .
182
+ docker run --rm -p 8080:8080 --env-file .env aurora-oss
183
+ ```
184
+
185
+ ---
186
+
187
+ ## Build from source
188
+
189
+ **Prerequisites:** Go 1.26.2+, Node.js + pnpm
190
+
191
+ ```bash
192
+ # Dashboard
193
+ pnpm --dir dashboard-ui install
194
+ pnpm --dir dashboard-ui run build
195
+
196
+ # Binary
197
+ go build -o bin/aurora-oss.exe ./apps/aurora
198
+
199
+ # Packaged release
200
+ .\scripts\release\build-editions.ps1 -Package
201
+ ```
202
+
203
+ Outputs: `bin/aurora-oss.exe`, `release/aurora-oss-windows-amd64.zip`
204
+
205
+ **Tests:**
206
+
207
+ ```bash
208
+ go test ./apps/... ./internal/...
209
+ pnpm --dir dashboard-ui run build
210
+ make oss-boundary-check
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Enterprise
216
+
217
+ Aurora OSS covers gateway routing, analytics, and provider operations. **Aurora Enterprise** adds SSO, RBAC, tenant isolation, budget enforcement, compliance workflows, and production support.
218
+
219
+ The Enterprise edition is a separate distribution. It cannot be enabled by editing files in this OSS tree.
220
+
221
+ ---
222
+
223
+ ## Community
224
+
225
+ | | |
226
+ |---|---|
227
+ | [Discord](https://discord.gg/gaEB9BQSPH) | Deployment questions, provider setup, roadmap |
228
+ | [GitHub Issues](https://github.com/gurveeer/Aurora/issues) | Bug reports, feature requests |
229
+ | [GitHub Stars](https://github.com/gurveeer/Aurora/stargazers) | Support the project |
230
+
231
+ If Aurora saves your team time, a star helps others find it.
package/bin/aurora.exe ADDED
Binary file
package/bin/aurora.js ADDED
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from 'child_process';
3
+ import { existsSync } from 'fs';
4
+ import { createRequire } from 'module';
5
+ import { resolve, dirname } from 'path';
6
+ import { fileURLToPath } from 'url';
7
+ import os from 'os';
8
+
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
10
+ const require = createRequire(import.meta.url);
11
+ const pkg = require(resolve(__dirname, '..', 'package.json'));
12
+
13
+ function platformBinaryName() {
14
+ const ext = os.platform() === 'win32' ? '.exe' : '';
15
+ return `aurora${ext}`;
16
+ }
17
+
18
+ function resolveBinary() {
19
+ const name = platformBinaryName();
20
+ const candidates = [
21
+ process.env.AURORA_BINARY_PATH && resolve(process.env.AURORA_BINARY_PATH),
22
+ resolve(__dirname, name),
23
+ resolve(__dirname, '..', name),
24
+ resolve(__dirname, '..', 'bin', name),
25
+ resolve(os.homedir(), '.aurora', 'bin', name),
26
+ resolve(os.homedir(), '.cache', 'aurora', name),
27
+ ].filter(Boolean);
28
+
29
+ for (const candidate of candidates) {
30
+ if (existsSync(candidate)) return candidate;
31
+ }
32
+ return null;
33
+ }
34
+
35
+ function suggestInstall() {
36
+ console.error(`
37
+ Aurora binary not found.
38
+
39
+ Run: npx iaurora install
40
+
41
+ Or build manually (requires Go 1.26.2+):
42
+ git clone https://github.com/gurveeer/Aurora.git
43
+ cd Aurora
44
+ go build -o bin/aurora ./apps/aurora
45
+ set AURORA_BINARY_PATH to the binary path
46
+
47
+ `);
48
+ process.exit(1);
49
+ }
50
+
51
+ function run(args) {
52
+ const binary = resolveBinary();
53
+ if (!binary) {
54
+ if (args[0] === 'install' || args[0] === 'download') {
55
+ downloadBinary(args.slice(1));
56
+ return;
57
+ }
58
+ if (args[0] === '--help' || args[0] === '-h') {
59
+ printHelp();
60
+ return;
61
+ }
62
+ suggestInstall();
63
+ return;
64
+ }
65
+
66
+ if (args[0] === '--help' || args[0] === '-h') {
67
+ printHelp();
68
+ return;
69
+ }
70
+
71
+ const child = spawn(binary, args, {
72
+ stdio: 'inherit',
73
+ env: { ...process.env },
74
+ });
75
+
76
+ child.on('exit', (code) => process.exit(code ?? 1));
77
+ child.on('error', (err) => {
78
+ console.error('Failed to start binary:', err.message);
79
+ process.exit(1);
80
+ });
81
+ }
82
+
83
+ function printHelp() {
84
+ console.error(`
85
+ ${pkg.name} v${pkg.version}
86
+
87
+ Usage: npx ${pkg.name} [command] [options]
88
+
89
+ Commands:
90
+ start Start the Aurora gateway server (default)
91
+ install Download the Aurora binary for your platform
92
+ models sync Sync model registry from upstream
93
+ models diff Compare local vs upstream model pricing
94
+ models show Show model pricing details
95
+ --help, -h Show this help
96
+ --version, -v Show version
97
+
98
+ Environment:
99
+ AURORA_BINARY_PATH Path to the Aurora binary (bypasses search)
100
+ AURORA_CONFIG_PATH Path to config YAML (default: configs/editions/oss.example.yaml)
101
+
102
+ Documentation: https://github.com/gurveeer/Aurora
103
+ `);
104
+ process.exit(0);
105
+ }
106
+
107
+ async function downloadBinary(args) {
108
+ const { downloadAndInstall } = await import('../scripts/npm-postinstall.js');
109
+ try {
110
+ await downloadAndInstall({
111
+ force: args.includes('--force'),
112
+ });
113
+ console.error('Binary installed to ~/.aurora/bin/');
114
+ console.error('Run `npx iaurora start` to launch the server.');
115
+ process.exit(0);
116
+ } catch (err) {
117
+ console.error('Download failed:', err.message);
118
+ process.exit(1);
119
+ }
120
+ }
121
+
122
+ run(process.argv.slice(2));
package/config.yaml ADDED
@@ -0,0 +1,55 @@
1
+ # Aurora OSS minimal local profile
2
+ # Usage: $env:AURORA_CONFIG_PATH = "configs/editions/oss.example.yaml"; go run ./apps/aurora
3
+ # Goal: start with no external dependencies. Use provider env vars such as OPENAI_API_KEY or GROQ_API_KEY.
4
+
5
+ edition:
6
+ name: oss
7
+
8
+ server:
9
+ port: "8080"
10
+ base_path: "/"
11
+ master_key: "${AURORA_MASTER_KEY}"
12
+ enable_passthrough_routes: true
13
+ allow_passthrough_v1_alias: true
14
+ enabled_passthrough_providers: ["openai", "anthropic", "openrouter", "zai", "vllm"]
15
+
16
+ admin:
17
+ endpoints_enabled: true
18
+ ui_enabled: true
19
+ dashboard_variant: "react"
20
+
21
+ models:
22
+ enabled_by_default: true
23
+ overrides_enabled: true
24
+ configured_provider_models_mode: "fallback"
25
+
26
+ storage:
27
+ type: "sqlite"
28
+ sqlite:
29
+ path: "data/aurora-oss.db"
30
+
31
+ logging:
32
+ enabled: false
33
+ log_bodies: false
34
+ log_headers: false
35
+ only_model_interactions: true
36
+
37
+ usage:
38
+ enabled: true
39
+ pricing_recalculation_enabled: true
40
+ enforce_returning_usage_data: true
41
+
42
+ metrics:
43
+ enabled: false
44
+ endpoint: "/metrics"
45
+
46
+ guardrails:
47
+ enabled: false
48
+ enable_for_batch_processing: false
49
+
50
+ cache:
51
+ model:
52
+ refresh_interval: 3600
53
+
54
+ workflows:
55
+ refresh_interval: 1m
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "author": "SantiagoDePolonia",
4
+ "license": "Apache-2.0",
5
+ "files": [
6
+ "bin/",
7
+ "scripts/",
8
+ "config.yaml",
9
+ "README.md",
10
+ "LICENSE"
11
+ ],
12
+ "keywords": [
13
+ "ai",
14
+ "llm",
15
+ "gateway",
16
+ "openai",
17
+ "anthropic",
18
+ "gemini",
19
+ "proxy",
20
+ "api-gateway"
21
+ ],
22
+ "name": "iaurora",
23
+ "type": "module",
24
+ "bugs": {
25
+ "url": "https://github.com/gurveeer/Aurora/issues"
26
+ },
27
+ "description": "Aurora AI Gateway - one API for every LLM provider. Self-hosted, open-source.",
28
+ "engines": {
29
+ "node": "\u003e=18"
30
+ },
31
+ "scripts": {
32
+ "postinstall": "node ./scripts/npm-postinstall.js"
33
+ },
34
+ "homepage": "https://github.com/gurveeer/Aurora#readme",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/gurveeer/Aurora.git"
38
+ },
39
+ "bin": {
40
+ "aurora": "./bin/aurora.js"
41
+ }
42
+ }
@@ -0,0 +1,98 @@
1
+ import { existsSync, mkdirSync, writeFileSync, chmodSync } from 'fs';
2
+ import { get } from 'https';
3
+ import { resolve, join, dirname } from 'path';
4
+ import { createRequire } from 'module';
5
+ import { fileURLToPath } from 'url';
6
+ import os from 'os';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = dirname(__filename);
10
+ const require = createRequire(import.meta.url);
11
+ const pkg = require(resolve(__dirname, '..', 'package.json'));
12
+
13
+ const GITHUB_REPO = 'gurveeer/Aurora';
14
+ const BINARY_DIR = join(os.homedir(), '.aurora', 'bin');
15
+
16
+ function platformAssetName() {
17
+ const platform = os.platform();
18
+ const arch = os.arch();
19
+
20
+ const map = {
21
+ 'win32-x64': 'aurora-windows-amd64.exe',
22
+ 'win32-arm64': 'aurora-windows-arm64.exe',
23
+ 'darwin-x64': 'aurora-darwin-amd64',
24
+ 'darwin-arm64': 'aurora-darwin-arm64',
25
+ 'linux-x64': 'aurora-linux-amd64',
26
+ 'linux-arm64': 'aurora-linux-arm64',
27
+ };
28
+
29
+ const key = `${platform}-${arch}`;
30
+ if (!map[key]) {
31
+ throw new Error(`Unsupported platform: ${key}`);
32
+ }
33
+ return map[key];
34
+ }
35
+
36
+ function getBinaryName() {
37
+ return os.platform() === 'win32' ? 'aurora.exe' : 'aurora';
38
+ }
39
+
40
+ function getDownloadUrl(version) {
41
+ const asset = platformAssetName();
42
+ const tag = version || `v${pkg.version}`;
43
+ return `https://github.com/${GITHUB_REPO}/releases/download/${tag}/${asset}`;
44
+ }
45
+
46
+ function download(url) {
47
+ return new Promise((resolve, reject) => {
48
+ get(url, (response) => {
49
+ if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
50
+ download(response.headers.location).then(resolve, reject);
51
+ return;
52
+ }
53
+ if (response.statusCode !== 200) {
54
+ reject(new Error(`HTTP ${response.statusCode} for ${url}`));
55
+ return;
56
+ }
57
+ const chunks = [];
58
+ response.on('data', (c) => chunks.push(c));
59
+ response.on('end', () => resolve(Buffer.concat(chunks)));
60
+ response.on('error', reject);
61
+ }).on('error', reject);
62
+ });
63
+ }
64
+
65
+ export async function downloadAndInstall(opts = {}) {
66
+ const { force, version } = opts;
67
+ const binaryName = getBinaryName();
68
+ const binaryPath = join(BINARY_DIR, binaryName);
69
+
70
+ if (!force && existsSync(binaryPath)) {
71
+ return;
72
+ }
73
+
74
+ if (!existsSync(BINARY_DIR)) {
75
+ mkdirSync(BINARY_DIR, { recursive: true });
76
+ }
77
+
78
+ const url = getDownloadUrl(version);
79
+ console.error(`Downloading Aurora ${version || `v${pkg.version}`}...`);
80
+ const data = await download(url);
81
+ writeFileSync(binaryPath, data);
82
+ if (os.platform() !== 'win32') {
83
+ chmodSync(binaryPath, 0o755);
84
+ }
85
+ }
86
+
87
+ async function main() {
88
+ try {
89
+ await downloadAndInstall();
90
+ console.error(`Aurora binary installed to ${join(BINARY_DIR, getBinaryName())}`);
91
+ } catch (err) {
92
+ console.error(`Warning: Could not download Aurora binary: ${err.message}`);
93
+ console.error('The CLI will attempt to use a locally built binary instead.');
94
+ console.error('Run `npx iaurora install` to retry.');
95
+ }
96
+ }
97
+
98
+ main();