noosphere 0.3.0 → 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 CHANGED
@@ -65,38 +65,50 @@ 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 the provider's official logo in SVG and PNG formats. 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.
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
71
  const models = await ai.getModels('llm');
72
72
 
73
73
  for (const model of models) {
74
74
  console.log(model.id, model.logo);
75
- // "gpt-5" { svg: "https://cdn.simpleicons.org/openai", png: "https://cdn.brandfetch.io/.../icon.png" }
76
- // "claude-opus-4-6" { svg: "https://cdn.simpleicons.org/anthropic", png: "https://cdn.brandfetch.io/.../icon.png" }
77
- // "gemini-2.5-pro" { svg: "https://cdn.simpleicons.org/google", png: "https://cdn.brandfetch.io/.../icon.png" }
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
+ }
79
+
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} />;
78
83
  }
79
84
 
80
85
  // Providers also have logos:
81
86
  const providers = await ai.getProviders();
82
87
  providers.forEach(p => console.log(p.id, p.logo));
83
-
84
- // Use in your UI:
85
- // <img src={model.logo.svg} alt={model.provider} />
86
88
  ```
87
89
 
88
- **Covered providers:** OpenAI, Anthropic, Google, Groq, Mistral, xAI, OpenRouter, Cerebras, Meta, DeepSeek, Microsoft, NVIDIA, Qwen, Cohere, Perplexity, Amazon, FAL, HuggingFace, ComfyUI, Piper, Kokoro, Ollama, SambaNova, Together, Fireworks, Replicate, Nebius, Novita.
90
+ **28 providers covered (23 SVG + 28 PNG):**
91
+
92
+ | Provider | SVG | PNG | Source |
93
+ |---|---|---|---|
94
+ | OpenAI, Anthropic, Google, Groq, Mistral, xAI | ✓ | ✓ | Official brand assets |
95
+ | OpenRouter, Cerebras, Meta, DeepSeek | ✓ | ✓ | Official brand assets |
96
+ | Microsoft, NVIDIA, Qwen, Cohere, Perplexity | ✓ | ✓ | Official brand assets |
97
+ | Amazon, Together, Fireworks, Replicate | ✓ | ✓ | Official brand assets |
98
+ | HuggingFace, Ollama, Nebius, Novita | ✓ | ✓ | Official brand assets |
99
+ | FAL, ComfyUI, Piper, Kokoro, SambaNova | ✗ | ✓ | GitHub avatars (512×512) |
89
100
 
90
101
  You can also import the logo registry directly:
91
102
 
92
103
  ```typescript
93
- import { getProviderLogo, PROVIDER_LOGOS } from 'noosphere';
104
+ import { getProviderLogo, PROVIDER_LOGOS, getAllProviderLogos } from 'noosphere';
94
105
 
95
106
  const logo = getProviderLogo('anthropic');
96
- // { svg: "https://cdn.simpleicons.org/anthropic", png: "https://cdn.brandfetch.io/.../icon.png" }
107
+ // { svg: "https://...cdn.../anthropic.svg", png: "https://...cdn.../anthropic.png" }
97
108
 
98
- // Or access the full map:
99
- console.log(Object.keys(PROVIDER_LOGOS));
109
+ // Get all logos as a map:
110
+ const allLogos = getAllProviderLogos();
111
+ console.log(Object.keys(allLogos));
100
112
  // ['openai', 'anthropic', 'google', 'groq', 'mistral', 'xai', 'openrouter', ...]
101
113
  ```
102
114
 
@@ -108,8 +120,8 @@ const qwen = hfModels.find(m => m.id === 'Qwen/Qwen2.5-72B-Instruct');
108
120
 
109
121
  console.log(qwen.capabilities.inferenceProviderLogos);
110
122
  // {
111
- // "together": { svg: "https://cdn.simpleicons.org/togetherai", png: "..." },
112
- // "fireworks-ai": { png: "https://cdn.brandfetch.io/.../icon.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" },
113
125
  // }
114
126
  ```
115
127
 
package/dist/index.cjs CHANGED
@@ -22,7 +22,9 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  Noosphere: () => Noosphere,
24
24
  NoosphereError: () => NoosphereError,
25
+ PROVIDER_IDS: () => PROVIDER_IDS,
25
26
  PROVIDER_LOGOS: () => PROVIDER_LOGOS,
27
+ getAllProviderLogos: () => getAllProviderLogos,
26
28
  getProviderLogo: () => getProviderLogo
27
29
  });
28
30
  module.exports = __toCommonJS(index_exports);
@@ -131,130 +133,149 @@ function resolveConfig(input) {
131
133
  }
132
134
 
133
135
  // src/logos.ts
134
- var PROVIDER_LOGOS = {
135
- // --- Cloud LLM Providers ---
136
- openai: {
137
- svg: "https://cdn.simpleicons.org/openai",
138
- png: "https://cdn.brandfetch.io/idR3duQxYl/w/512/h/512/theme/dark/icon.png"
139
- },
140
- anthropic: {
141
- svg: "https://cdn.simpleicons.org/anthropic",
142
- png: "https://cdn.brandfetch.io/id2S-kXbuM/w/512/h/512/theme/dark/icon.png"
143
- },
144
- google: {
145
- svg: "https://cdn.simpleicons.org/google",
146
- png: "https://cdn.brandfetch.io/id6O2oGzv-/w/512/h/512/theme/dark/icon.png"
147
- },
148
- groq: {
149
- svg: "https://cdn.simpleicons.org/groq",
150
- png: "https://cdn.brandfetch.io/idTEBPz5KO/w/512/h/512/theme/dark/icon.png"
151
- },
152
- mistral: {
153
- svg: "https://cdn.simpleicons.org/mistral",
154
- png: "https://cdn.brandfetch.io/idnBOFq5eF/w/512/h/512/theme/dark/icon.png"
155
- },
156
- xai: {
157
- svg: "https://cdn.simpleicons.org/x",
158
- png: "https://cdn.brandfetch.io/idS5WhqBbM/w/512/h/512/theme/dark/icon.png"
159
- },
160
- openrouter: {
161
- svg: "https://openrouter.ai/favicon.svg",
162
- png: "https://openrouter.ai/favicon.png"
163
- },
164
- cerebras: {
165
- svg: "https://cdn.simpleicons.org/cerebras",
166
- png: "https://cdn.brandfetch.io/idGa4PRFP0/w/512/h/512/theme/dark/icon.png"
167
- },
168
- // --- Media Providers ---
169
- fal: {
170
- svg: "https://fal.ai/favicon.svg",
171
- png: "https://fal.ai/favicon.png"
172
- },
173
- huggingface: {
174
- svg: "https://cdn.simpleicons.org/huggingface",
175
- png: "https://cdn.brandfetch.io/idnrPPHe87/w/512/h/512/theme/dark/icon.png"
176
- },
177
- // --- Local Providers ---
178
- comfyui: {
179
- svg: "https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/web/assets/icon.svg",
180
- png: "https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/web/assets/icon.png"
181
- },
182
- piper: {
183
- png: "https://raw.githubusercontent.com/rhasspy/piper/master/logo.png"
184
- },
185
- kokoro: {
186
- png: "https://raw.githubusercontent.com/hexgrad/kokoro/main/assets/icon.png"
187
- },
188
- ollama: {
189
- svg: "https://cdn.simpleicons.org/ollama",
190
- png: "https://cdn.brandfetch.io/idtesMoSFj/w/512/h/512/theme/dark/icon.png"
191
- },
192
- // --- Model Org Providers (from OpenRouter model prefixes) ---
193
- meta: {
194
- svg: "https://cdn.simpleicons.org/meta",
195
- png: "https://cdn.brandfetch.io/idmKk_rq7Y/w/512/h/512/theme/dark/icon.png"
196
- },
197
- deepseek: {
198
- png: "https://cdn.brandfetch.io/id1BWKUVWI/w/512/h/512/theme/dark/icon.png"
199
- },
200
- microsoft: {
201
- svg: "https://cdn.simpleicons.org/microsoft",
202
- png: "https://cdn.brandfetch.io/idchmboHEZ/w/512/h/512/theme/dark/icon.png"
203
- },
204
- nvidia: {
205
- svg: "https://cdn.simpleicons.org/nvidia",
206
- png: "https://cdn.brandfetch.io/id1JcGHuZN/w/512/h/512/theme/dark/icon.png"
207
- },
208
- qwen: {
209
- png: "https://img.alicdn.com/imgextra/i1/O1CN01BUp2gU1sRZigvazUo_!!6000000005764-2-tps-228-228.png"
210
- },
211
- cohere: {
212
- svg: "https://cdn.simpleicons.org/cohere",
213
- png: "https://cdn.brandfetch.io/idiDnz1fvB/w/512/h/512/theme/dark/icon.png"
214
- },
215
- perplexity: {
216
- svg: "https://cdn.simpleicons.org/perplexity",
217
- png: "https://cdn.brandfetch.io/idwWX3Neii/w/512/h/512/theme/dark/icon.png"
218
- },
219
- amazon: {
220
- svg: "https://cdn.simpleicons.org/amazonaws",
221
- png: "https://cdn.brandfetch.io/idawORoPJZ/w/512/h/512/theme/dark/icon.png"
222
- },
223
- // --- HuggingFace Inference Providers ---
224
- "hf-inference": {
225
- svg: "https://cdn.simpleicons.org/huggingface",
226
- png: "https://cdn.brandfetch.io/idnrPPHe87/w/512/h/512/theme/dark/icon.png"
227
- },
228
- "sambanova": {
229
- png: "https://cdn.brandfetch.io/id__2e5yMY/w/512/h/512/theme/dark/icon.png"
230
- },
231
- "together": {
232
- svg: "https://cdn.simpleicons.org/togetherai",
233
- png: "https://cdn.brandfetch.io/idH5EoFVaH/w/512/h/512/theme/dark/icon.png"
234
- },
235
- "fireworks-ai": {
236
- png: "https://cdn.brandfetch.io/idj1VQ2O4C/w/512/h/512/theme/dark/icon.png"
237
- },
238
- "replicate": {
239
- svg: "https://cdn.simpleicons.org/replicate",
240
- png: "https://cdn.brandfetch.io/idWKE4rRaH/w/512/h/512/theme/dark/icon.png"
241
- },
242
- "nebius": {
243
- png: "https://cdn.brandfetch.io/idiUqSQ52b/w/512/h/512/theme/dark/icon.png"
244
- },
245
- "novita": {
246
- png: "https://novita.ai/favicon.png"
247
- }
248
- };
136
+ var CDN_BASE = "https://blockchainstarter.nyc3.digitaloceanspaces.com/noosphere/logos";
137
+ var PROVIDER_IDS = [
138
+ // Cloud LLM
139
+ "openai",
140
+ "anthropic",
141
+ "google",
142
+ "groq",
143
+ "mistral",
144
+ "xai",
145
+ "openrouter",
146
+ "cerebras",
147
+ "pi-ai",
148
+ // Media
149
+ "fal",
150
+ "huggingface",
151
+ // Local
152
+ "comfyui",
153
+ "piper",
154
+ "kokoro",
155
+ "ollama",
156
+ // Model orgs (from OpenRouter prefixes)
157
+ "meta",
158
+ "deepseek",
159
+ "microsoft",
160
+ "nvidia",
161
+ "qwen",
162
+ "cohere",
163
+ "perplexity",
164
+ "amazon",
165
+ // Additional model orgs
166
+ "zai",
167
+ "minimax",
168
+ "baidu",
169
+ "bytedance",
170
+ "tencent",
171
+ "xiaomi",
172
+ "ibm",
173
+ "ai21",
174
+ "inflection",
175
+ "upstage",
176
+ // HuggingFace inference providers
177
+ "sambanova",
178
+ "together",
179
+ "fireworks-ai",
180
+ "replicate",
181
+ "nebius",
182
+ "novita"
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
+ ]);
218
+ var _cache = /* @__PURE__ */ new Map();
249
219
  function getProviderLogo(providerId) {
250
220
  if (!providerId) return void 0;
251
- if (PROVIDER_LOGOS[providerId]) return PROVIDER_LOGOS[providerId];
221
+ const cached = _cache.get(providerId);
222
+ if (cached) return cached;
252
223
  const normalized = providerId.toLowerCase().replace(/[-_\s]/g, "");
253
- for (const [key, logo] of Object.entries(PROVIDER_LOGOS)) {
254
- if (key.replace(/[-_\s]/g, "") === normalized) return logo;
224
+ let matchedId = null;
225
+ for (const id of PROVIDER_IDS) {
226
+ if (id === providerId) {
227
+ matchedId = id;
228
+ break;
229
+ }
255
230
  }
256
- return void 0;
231
+ if (!matchedId) {
232
+ for (const id of PROVIDER_IDS) {
233
+ if (id.replace(/[-_\s]/g, "") === normalized) {
234
+ matchedId = id;
235
+ break;
236
+ }
237
+ }
238
+ }
239
+ if (!matchedId) 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
+ }
246
+ _cache.set(providerId, logo);
247
+ return logo;
257
248
  }
249
+ function getAllProviderLogos() {
250
+ const result = {};
251
+ for (const id of PROVIDER_IDS) {
252
+ const logo = getProviderLogo(id);
253
+ if (logo) result[id] = logo;
254
+ }
255
+ return result;
256
+ }
257
+ var _allLogos = null;
258
+ var PROVIDER_LOGOS = new Proxy({}, {
259
+ get(_, prop) {
260
+ if (!_allLogos) _allLogos = getAllProviderLogos();
261
+ return _allLogos[prop];
262
+ },
263
+ ownKeys() {
264
+ if (!_allLogos) _allLogos = getAllProviderLogos();
265
+ return Object.keys(_allLogos);
266
+ },
267
+ getOwnPropertyDescriptor(_, prop) {
268
+ if (!_allLogos) _allLogos = getAllProviderLogos();
269
+ if (prop in _allLogos) {
270
+ return { configurable: true, enumerable: true, value: _allLogos[prop] };
271
+ }
272
+ return void 0;
273
+ },
274
+ has(_, prop) {
275
+ if (!_allLogos) _allLogos = getAllProviderLogos();
276
+ return prop in _allLogos;
277
+ }
278
+ });
258
279
 
259
280
  // src/registry.ts
260
281
  var Registry = class {
@@ -792,7 +813,20 @@ var PiAiProvider = class {
792
813
  "qwen/": "qwen",
793
814
  "cohere/": "cohere",
794
815
  "perplexity/": "perplexity",
795
- "amazon/": "amazon"
816
+ "amazon/": "amazon",
817
+ "z-ai/": "zai",
818
+ "minimax/": "minimax",
819
+ "baidu/": "baidu",
820
+ "bytedance/": "bytedance",
821
+ "bytedance-seed/": "bytedance",
822
+ "tencent/": "tencent",
823
+ "xiaomi/": "xiaomi",
824
+ "ibm-granite/": "ibm",
825
+ "ibm/": "ibm",
826
+ "ai21/": "ai21",
827
+ "inflection/": "inflection",
828
+ "upstage/": "upstage",
829
+ "alibaba/": "qwen"
796
830
  };
797
831
  const lower = modelId.toLowerCase();
798
832
  for (const [prefix, provider] of Object.entries(MODEL_PREFIX_TO_PROVIDER)) {
@@ -1745,7 +1779,9 @@ var Noosphere = class {
1745
1779
  0 && (module.exports = {
1746
1780
  Noosphere,
1747
1781
  NoosphereError,
1782
+ PROVIDER_IDS,
1748
1783
  PROVIDER_LOGOS,
1784
+ getAllProviderLogos,
1749
1785
  getProviderLogo
1750
1786
  });
1751
1787
  //# sourceMappingURL=index.cjs.map