@gabrielsmartin/orbit-sdk 0.4.2 → 0.4.3
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/README.md +5 -5
- package/package.json +3 -3
- package/src/index.d.ts +2 -0
- package/src/index.js +3 -1
- package/src/router.js +0 -10
package/README.md
CHANGED
|
@@ -144,7 +144,7 @@ const stats = orbit.stats()
|
|
|
144
144
|
Free to try, no auth required:
|
|
145
145
|
|
|
146
146
|
```bash
|
|
147
|
-
curl -X POST https://gtll
|
|
147
|
+
curl -X POST https://api.gtll.app/orbitRoute \
|
|
148
148
|
-H "Content-Type: application/json" \
|
|
149
149
|
-d '{"query": "write a haiku about recursion"}'
|
|
150
150
|
```
|
|
@@ -153,11 +153,11 @@ curl -X POST https://gtll-soul-guide-81e596e1.base44.app/functions/orbitGateway
|
|
|
153
153
|
|
|
154
154
|
| Tier | Price | Limit |
|
|
155
155
|
|------|-------|-------|
|
|
156
|
-
| Free | $0/mo |
|
|
157
|
-
| Pro |
|
|
158
|
-
| Team |
|
|
156
|
+
| Free | $0/mo | 100 queries/day |
|
|
157
|
+
| Pro | **$9/mo** · founding rate, locked forever | Unlimited |
|
|
158
|
+
| Team | **$49/mo** · founding rate, locked forever | Unlimited · 5 seats |
|
|
159
159
|
|
|
160
|
-
→ [Pro](https://buy.stripe.com/
|
|
160
|
+
→ [Get Pro](https://buy.stripe.com/7sY14mdHYbTE3DT4PIbwk00) · [Get Team](https://buy.stripe.com/9B67sKfQ6bTE0rHgyqbwk01)
|
|
161
161
|
|
|
162
162
|
---
|
|
163
163
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gabrielsmartin/orbit-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Rule-based LLM router. Classifies queries across 8 axes and picks the optimal model. Fast, deterministic, zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
|
42
|
-
"url": "
|
|
42
|
+
"url": "https://github.com/gtllco/orbit.git"
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/gtllco/orbit",
|
|
45
45
|
"bugs": {
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=16"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -74,6 +74,8 @@ export declare class OrbitClient {
|
|
|
74
74
|
export declare function fingerprint(text: string): QueryScores;
|
|
75
75
|
export declare function route(scores: QueryScores, config?: OrbitConfig): { model: ModelInfo; reason: string; rule: string };
|
|
76
76
|
export declare function calculateSavings(model: ModelInfo, estimatedTokens?: number): SavingsInfo;
|
|
77
|
+
export declare function applySignalBias(scores: QueryScores, signalCode: '777' | '555' | '333' | null): QueryScores & { signal_applied?: string; signal_reason?: string; variation_mode?: boolean };
|
|
78
|
+
export declare function inferSignalFromEvent(eventPriority: string): '777' | '555' | '333' | null;
|
|
77
79
|
export declare const MODEL_MATRIX: Record<string, ModelInfo>;
|
|
78
80
|
|
|
79
81
|
declare const orbit: OrbitClient;
|
package/src/index.js
CHANGED
|
@@ -12,6 +12,8 @@ import { route, calculateSavings, MODEL_MATRIX } from './router.js';
|
|
|
12
12
|
|
|
13
13
|
export { fingerprint, applySignalBias, route, calculateSavings, MODEL_MATRIX };
|
|
14
14
|
|
|
15
|
+
const GATEWAY_URL = 'https://api.gtll.app/orbitSignup';
|
|
16
|
+
|
|
15
17
|
/**
|
|
16
18
|
* OrbitClient — the main class
|
|
17
19
|
*
|
|
@@ -88,7 +90,7 @@ export class OrbitClient {
|
|
|
88
90
|
|
|
89
91
|
// Nudge unauthenticated users toward API key
|
|
90
92
|
if (!this.config.apiKey && this._stats.total_queries === 3) {
|
|
91
|
-
console.warn(`[ORBIT] Free tier:
|
|
93
|
+
console.warn(`[ORBIT] Free tier: 100 API queries/day. Get your key → https://api.gtll.app/orbitSignup (POST { action: "get_key", email })`);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
|
package/src/router.js
CHANGED
|
@@ -96,16 +96,6 @@ export function route(scores, config = {}) {
|
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
// Rule 0: SIGNAL 555 VARIATION — break the default pattern before all other rules
|
|
100
|
-
if (variationMode && recency >= 5 && !blocked.includes('grok')) {
|
|
101
|
-
return {
|
|
102
|
-
model: MODEL_MATRIX.grok,
|
|
103
|
-
reason: `Signal 555 — variation mode active, recency ${recency}/10. Grok selected to break the default routing.`,
|
|
104
|
-
rule: 'signal_555_variation',
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
99
|
// Signal override (777/555/333) — always wins if set
|
|
110
100
|
if (config.signal === '777') {
|
|
111
101
|
return { model: MODEL_MATRIX.claude_sonnet, reason: '777 — Completion. Claude Sonnet floor enforced.', rule: 'signal_777' };
|