noosphere 0.4.1 → 0.5.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/README.md +11 -19
- package/dist/index.cjs +44 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +44 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/assets/logos/png/ai21.png +0 -0
- package/assets/logos/png/amazon.png +0 -0
- package/assets/logos/png/anthropic.png +0 -0
- package/assets/logos/png/baidu.png +0 -0
- package/assets/logos/png/bytedance.png +0 -0
- package/assets/logos/png/cerebras.png +0 -0
- package/assets/logos/png/cohere.png +0 -0
- package/assets/logos/png/comfyui.png +0 -0
- package/assets/logos/png/deepseek.png +0 -0
- package/assets/logos/png/fal.png +0 -0
- package/assets/logos/png/fireworks-ai.png +0 -0
- package/assets/logos/png/google.png +0 -0
- package/assets/logos/png/groq.png +0 -0
- package/assets/logos/png/huggingface.png +0 -0
- package/assets/logos/png/ibm.png +0 -0
- package/assets/logos/png/inflection.png +0 -0
- package/assets/logos/png/kokoro.png +0 -0
- package/assets/logos/png/meta.png +0 -0
- package/assets/logos/png/microsoft.png +0 -0
- package/assets/logos/png/minimax.png +0 -0
- package/assets/logos/png/mistral.png +0 -0
- package/assets/logos/png/nebius.png +0 -0
- package/assets/logos/png/novita.png +0 -0
- package/assets/logos/png/nvidia.png +0 -0
- package/assets/logos/png/ollama.png +0 -0
- package/assets/logos/png/openai.png +0 -0
- package/assets/logos/png/openrouter.png +0 -0
- package/assets/logos/png/perplexity.png +0 -0
- package/assets/logos/png/pi-ai.png +0 -0
- package/assets/logos/png/piper.png +0 -0
- package/assets/logos/png/qwen.png +0 -0
- package/assets/logos/png/replicate.png +0 -0
- package/assets/logos/png/sambanova.png +0 -0
- package/assets/logos/png/tencent.png +0 -0
- package/assets/logos/png/together.png +0 -0
- package/assets/logos/png/upstage.png +0 -0
- package/assets/logos/png/xai.png +0 -0
- package/assets/logos/png/xiaomi.png +0 -0
- package/assets/logos/png/zai.png +0 -0
- package/assets/logos/svg/amazon.svg +0 -1
- package/assets/logos/svg/anthropic.svg +0 -1
- package/assets/logos/svg/baidu.svg +0 -1
- package/assets/logos/svg/cerebras.svg +0 -1
- package/assets/logos/svg/cohere.svg +0 -1
- package/assets/logos/svg/deepseek.svg +0 -1
- package/assets/logos/svg/fireworks-ai.svg +0 -9
- package/assets/logos/svg/google.svg +0 -1
- package/assets/logos/svg/groq.svg +0 -1
- package/assets/logos/svg/huggingface.svg +0 -67
- package/assets/logos/svg/meta.svg +0 -1
- package/assets/logos/svg/microsoft.svg +0 -1
- package/assets/logos/svg/mistral.svg +0 -1
- package/assets/logos/svg/nebius.svg +0 -4
- package/assets/logos/svg/novita.svg +0 -11
- package/assets/logos/svg/nvidia.svg +0 -1
- package/assets/logos/svg/ollama.svg +0 -7
- package/assets/logos/svg/openai.svg +0 -1
- package/assets/logos/svg/openrouter.svg +0 -21
- package/assets/logos/svg/perplexity.svg +0 -24
- package/assets/logos/svg/qwen.svg +0 -1
- package/assets/logos/svg/replicate.svg +0 -12
- package/assets/logos/svg/together.svg +0 -1
- package/assets/logos/svg/xai.svg +0 -1
package/README.md
CHANGED
|
@@ -65,29 +65,21 @@ Noosphere **automatically discovers the latest models from EVERY provider's API
|
|
|
65
65
|
|
|
66
66
|
### Provider Logos — SVG & PNG for Every Model
|
|
67
67
|
|
|
68
|
-
Every model returned by the auto-fetch includes a `logo` field with **
|
|
68
|
+
Every model returned by the auto-fetch includes a `logo` field with **CDN URLs** to the provider's official logo — SVG (vector) and PNG (512×512), hosted on DigitalOcean Spaces. For aggregator providers (OpenRouter, HuggingFace), logos are resolved to the **real upstream provider** — so an `x-ai/grok-4` model gets the xAI logo, not OpenRouter's.
|
|
69
69
|
|
|
70
70
|
```typescript
|
|
71
|
-
import { readFileSync } from 'fs';
|
|
72
|
-
|
|
73
71
|
const models = await ai.getModels('llm');
|
|
74
72
|
|
|
75
73
|
for (const model of models) {
|
|
76
74
|
console.log(model.id, model.logo);
|
|
77
|
-
// "gpt-5" { svg: "
|
|
78
|
-
//
|
|
79
|
-
// "
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// Read the file directly:
|
|
83
|
-
const svgContent = readFileSync(model.logo.svg, 'utf-8');
|
|
84
|
-
const pngBuffer = readFileSync(model.logo.png);
|
|
85
|
-
|
|
86
|
-
// Serve in Express:
|
|
87
|
-
// app.get('/logo/:provider.svg', (req, res) => res.sendFile(model.logo.svg));
|
|
75
|
+
// "gpt-5" { svg: "https://...cdn.../openai.svg", png: "https://...cdn.../openai.png" }
|
|
76
|
+
// "claude-opus-4-6" { svg: "https://...cdn.../anthropic.svg", png: "https://...cdn.../anthropic.png" }
|
|
77
|
+
// "gemini-2.5-pro" { svg: "https://...cdn.../google.svg", png: "https://...cdn.../google.png" }
|
|
78
|
+
}
|
|
88
79
|
|
|
89
|
-
|
|
90
|
-
|
|
80
|
+
// Use directly in your UI:
|
|
81
|
+
// <img src={model.logo.svg} alt={model.provider} />
|
|
82
|
+
// <img src={model.logo.png} width={48} height={48} />;
|
|
91
83
|
}
|
|
92
84
|
|
|
93
85
|
// Providers also have logos:
|
|
@@ -112,7 +104,7 @@ You can also import the logo registry directly:
|
|
|
112
104
|
import { getProviderLogo, PROVIDER_LOGOS, getAllProviderLogos } from 'noosphere';
|
|
113
105
|
|
|
114
106
|
const logo = getProviderLogo('anthropic');
|
|
115
|
-
// { svg: "
|
|
107
|
+
// { svg: "https://...cdn.../anthropic.svg", png: "https://...cdn.../anthropic.png" }
|
|
116
108
|
|
|
117
109
|
// Get all logos as a map:
|
|
118
110
|
const allLogos = getAllProviderLogos();
|
|
@@ -128,8 +120,8 @@ const qwen = hfModels.find(m => m.id === 'Qwen/Qwen2.5-72B-Instruct');
|
|
|
128
120
|
|
|
129
121
|
console.log(qwen.capabilities.inferenceProviderLogos);
|
|
130
122
|
// {
|
|
131
|
-
// "together": { svg: "
|
|
132
|
-
// "fireworks-ai": { png: "
|
|
123
|
+
// "together": { svg: "https://...cdn.../together.svg", png: "https://...cdn.../together.png" },
|
|
124
|
+
// "fireworks-ai": { svg: "https://...cdn.../fireworks-ai.svg", png: "https://...cdn.../fireworks-ai.png" },
|
|
133
125
|
// }
|
|
134
126
|
```
|
|
135
127
|
|
package/dist/index.cjs
CHANGED
|
@@ -133,21 +133,7 @@ function resolveConfig(input) {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
// src/logos.ts
|
|
136
|
-
var
|
|
137
|
-
var import_path = require("path");
|
|
138
|
-
var import_fs = require("fs");
|
|
139
|
-
var import_meta = {};
|
|
140
|
-
var _assetsDir = null;
|
|
141
|
-
function assetsDir() {
|
|
142
|
-
if (_assetsDir) return _assetsDir;
|
|
143
|
-
try {
|
|
144
|
-
const __filename = (0, import_url.fileURLToPath)(import_meta.url);
|
|
145
|
-
_assetsDir = (0, import_path.resolve)((0, import_path.dirname)(__filename), "..", "assets", "logos");
|
|
146
|
-
} catch {
|
|
147
|
-
_assetsDir = (0, import_path.resolve)(__dirname, "..", "assets", "logos");
|
|
148
|
-
}
|
|
149
|
-
return _assetsDir;
|
|
150
|
-
}
|
|
136
|
+
var CDN_BASE = "https://blockchainstarter.nyc3.digitaloceanspaces.com/noosphere/logos";
|
|
151
137
|
var PROVIDER_IDS = [
|
|
152
138
|
// Cloud LLM
|
|
153
139
|
"openai",
|
|
@@ -195,6 +181,40 @@ var PROVIDER_IDS = [
|
|
|
195
181
|
"nebius",
|
|
196
182
|
"novita"
|
|
197
183
|
];
|
|
184
|
+
var HAS_SVG = /* @__PURE__ */ new Set([
|
|
185
|
+
"openai",
|
|
186
|
+
"anthropic",
|
|
187
|
+
"google",
|
|
188
|
+
"groq",
|
|
189
|
+
"mistral",
|
|
190
|
+
"xai",
|
|
191
|
+
"openrouter",
|
|
192
|
+
"cerebras",
|
|
193
|
+
"huggingface",
|
|
194
|
+
"ollama",
|
|
195
|
+
"meta",
|
|
196
|
+
"deepseek",
|
|
197
|
+
"microsoft",
|
|
198
|
+
"nvidia",
|
|
199
|
+
"qwen",
|
|
200
|
+
"cohere",
|
|
201
|
+
"perplexity",
|
|
202
|
+
"amazon",
|
|
203
|
+
"baidu",
|
|
204
|
+
"together",
|
|
205
|
+
"fireworks-ai",
|
|
206
|
+
"replicate",
|
|
207
|
+
"nebius",
|
|
208
|
+
"novita",
|
|
209
|
+
"comfyui",
|
|
210
|
+
"fal",
|
|
211
|
+
"kokoro",
|
|
212
|
+
"piper",
|
|
213
|
+
"sambanova",
|
|
214
|
+
"pi-ai",
|
|
215
|
+
"zai"
|
|
216
|
+
// NO SVG: bytedance, tencent, xiaomi, ibm, ai21, inflection, upstage, minimax
|
|
217
|
+
]);
|
|
198
218
|
var _cache = /* @__PURE__ */ new Map();
|
|
199
219
|
function getProviderLogo(providerId) {
|
|
200
220
|
if (!providerId) return void 0;
|
|
@@ -217,13 +237,12 @@ function getProviderLogo(providerId) {
|
|
|
217
237
|
}
|
|
218
238
|
}
|
|
219
239
|
if (!matchedId) return void 0;
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
if (!logo.svg && !logo.png) return void 0;
|
|
240
|
+
const logo = {
|
|
241
|
+
png: `${CDN_BASE}/png/${matchedId}.png`
|
|
242
|
+
};
|
|
243
|
+
if (HAS_SVG.has(matchedId)) {
|
|
244
|
+
logo.svg = `${CDN_BASE}/svg/${matchedId}.svg`;
|
|
245
|
+
}
|
|
227
246
|
_cache.set(providerId, logo);
|
|
228
247
|
return logo;
|
|
229
248
|
}
|
|
@@ -626,8 +645,8 @@ var PiAiProvider = class {
|
|
|
626
645
|
let aborted = false;
|
|
627
646
|
let resolveResult = null;
|
|
628
647
|
let rejectResult = null;
|
|
629
|
-
const resultPromise = new Promise((
|
|
630
|
-
resolveResult =
|
|
648
|
+
const resultPromise = new Promise((resolve, reject) => {
|
|
649
|
+
resolveResult = resolve;
|
|
631
650
|
rejectResult = reject;
|
|
632
651
|
});
|
|
633
652
|
const ensureModel = async () => {
|
|
@@ -1716,7 +1735,7 @@ var Noosphere = class {
|
|
|
1716
1735
|
break;
|
|
1717
1736
|
}
|
|
1718
1737
|
const delay = backoffMs * Math.pow(2, attempt);
|
|
1719
|
-
await new Promise((
|
|
1738
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1720
1739
|
}
|
|
1721
1740
|
}
|
|
1722
1741
|
throw lastError ?? new NoosphereError("Generation failed", {
|