The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
feat(cloud): der Schalter bekommt ein Argument, mit echten Zahlen
David04ecbfad596a
diff --git a/scripts/check-cloud-sales.mjs b/scripts/check-cloud-sales.mjsindex 884ca854..6e91ab4a 100644--- a/scripts/check-cloud-sales.mjs+++ b/scripts/check-cloud-sales.mjs@@ -118,6 +118,40 @@ assert.equal(claimed.textContent, String(unfilteredFull))const claimedTotal = pricing.querySelector('[data-catalog-count]')assert.equal(Number(claimedTotal.dataset.catalogCount), catalogSize, 'catalog size drift')assert.equal(claimedTotal.textContent, String(catalogSize))+// ── Der Wolkenschalter im Desktop ────────────────────────────────────+//+// Die Oberflaeche zeigt diese Zahlen, BEVOR jemand angemeldet ist, also bevor+// es einen Katalog zu lesen gibt. Sie stehen deshalb fest in+// src/lib/cloud-pitch.ts, und hier haengen sie an ihrer Quelle. Ein Schalter,+// der eine Zahl verspricht, die der Katalog nicht mehr hergibt, ist eine+// Falschaussage im Kaufmoment.+const pitchSource = ts.createSourceFile(+ 'cloud-pitch.ts',+ readFileSync(new URL('../src/lib/cloud-pitch.ts', import.meta.url), 'utf8'),+ ts.ScriptTarget.Latest,+ true,+)+const pitch = objects(pitchSource).find((row) => typeof row.chatModels === 'number')+assert.ok(pitch, 'CLOUD_PITCH not found in cloud-pitch.ts')+const mediaSource = source('apps/web/lib/render/cloud-models.ts')+const mediaRows = objects(mediaSource).filter((row) => typeof row.id === 'string' && typeof row.kind === 'string')+// `ops`-Eintraege sind Sondermodelle (Lipsync, Extend, Training), keine+// Auswahleintraege. Die Zaehlung der Seite meint die Auswahl.+const opsIds = new Set(+ mediaSource.getFullText().split('\n')+ .filter((line) => /ops: \[/.test(line))+ .map((line) => /id: '([^']+)'/.exec(line)?.[1])+ .filter(Boolean),+)+const countKind = (kind) => mediaRows.filter((row) => row.kind === kind && !opsIds.has(row.id)).length+assert.equal(pitch.chatModels, catalogSize, 'pitch: chat model count drift')+assert.equal(pitch.unfilteredChatModels, unfilteredFull, 'pitch: unfiltered count drift')+assert.equal(pitch.flashModels, catalog.filter((row) => row.usageClass === 'flash').length, 'pitch: flash count drift')+assert.equal(pitch.flashDailyTokens, daily, 'pitch: daily ceiling drift')+assert.equal(pitch.imageModels, countKind('image'), 'pitch: image model count drift')+assert.equal(pitch.videoModels, countKind('video'), 'pitch: video model count drift')+console.log(`Cloud switch guard passed: ${pitch.unfilteredChatModels}/${pitch.chatModels} chat, ${pitch.flashModels} flash, ${pitch.imageModels} image and ${pitch.videoModels} video match the web catalogue.`)+console.log(`Pricing guard passed: ${tiers.filter((t) => typeof t.monthlyEUR === 'number').length} plans, ${packs.length} packs, ${unfilteredFull}/${catalogSize} models and the ${daily.toLocaleString('en-US')} token ceiling match the web source.`)for (const slug of ['ollama-cloud', 'featherless', 'venice', 'chutes', 'infermatic', 'arliai', 'cerebras-code', 'backyard-ai', 'sillyhost']) {const comparison = new JSDOM(readFileSync(new URL(`../docs/vs/${slug}/index.html`, import.meta.url), 'utf8')).window.documentdiff --git a/src/components/cloud/CloudGateModal.tsx b/src/components/cloud/CloudGateModal.tsxindex 894b7da7..3fc3fc5f 100644--- a/src/components/cloud/CloudGateModal.tsx+++ b/src/components/cloud/CloudGateModal.tsx@@ -10,7 +10,7 @@// the first flip). Payment stays on lu-labs.ai — the app never touches Stripe.import { useEffect, useState } from 'react'-import { ExternalLink, HardDrive, RefreshCw, ArrowLeft, ArrowRight } from 'lucide-react'+import { ExternalLink, HardDrive, RefreshCw, ArrowLeft, ArrowRight, Check } from 'lucide-react'import { Modal } from '../ui/Modal'import { useUIStore } from '../../stores/uiStore'import { useSettingsStore } from '../../stores/settingsStore'@@ -20,6 +20,7 @@ import { AccountPanel } from '../auth/AccountPanel'import { CLOUD_BASE } from '../../api/cloud/config'import { openExternal } from '../../api/backend'import { MONOGRAM, MONOGRAM_INVERT } from '../layout/brand'+import { cloudPitchLines } from '../../lib/cloud-pitch'const PLANS = [{ anchor: 'hosted', name: 'Hosted', price: '€19' },@@ -167,6 +168,17 @@ export function CloudGateModal() {step === 'intro' ? (<div className="space-y-5 pt-2"><CloudHero subtitle="Image, video, chat, code. On LU's hosted GPUs." />+ {/* Der Schalter hatte bis 3.0.0 kein Argument. Hier steht es, in+ fester Reihenfolge und mit echten Zahlen aus dem Katalog+ (lib/cloud-pitch.ts, gebunden an das Web-Repo). */}+ <ul className="space-y-1.5 max-w-xs mx-auto" data-testid="cloud-pitch">+ {cloudPitchLines().map((line) => (+ <li key={line} className="flex items-start gap-2 text-[0.72rem] leading-snug text-gray-600 dark:text-gray-400">+ <Check size={12} className="mt-[2px] shrink-0 text-lu-cloud" />+ <span>{line}</span>+ </li>+ ))}+ </ul><div className="space-y-2 max-w-xs mx-auto"><button onClick={() => setStep('plans')} className={primaryBtn}>Get LU Cloud <ArrowRight size={13} />diff --git a/src/components/cloud/CloudSwitch.tsx b/src/components/cloud/CloudSwitch.tsxindex 4e64b855..2c802eda 100644--- a/src/components/cloud/CloudSwitch.tsx+++ b/src/components/cloud/CloudSwitch.tsx@@ -13,6 +13,7 @@ import { useUIStore } from '../../stores/uiStore'import { useCloudAuthStore, deriveCloudAvailable } from '../../stores/cloudAuthStore'import { cloudSwitchClick, CLOUD_ARM_TIMEOUT_MS } from '../../lib/cloud-switch-guard'import { reportCloudSwitch } from '../../api/funnel'+import { cloudPitchLines } from '../../lib/cloud-pitch'import { cn } from '../create/ui/cn'import { MONOGRAM, MONOGRAM_INVERT } from '../layout/brand'@@ -80,7 +81,9 @@ export function CloudSwitch() {? "Cloud mode is on. Chat, image and video run on LU's hosted GPUs. Click to go back to Local.": armed? 'Click again to move the whole app to Cloud. Answers are then billed to your lu-labs.ai credits.'- : "Run LU on hosted GPUs with your lu-labs.ai account"}+ // Der Schalter sagte nur, WAS er tut. Jetzt sagt er auch, wofuer.+ // Die Zahlen kommen aus lib/cloud-pitch.ts und haengen am Katalog.+ : cloudPitchLines().join('\n')}onClick={toggle}onBlur={() => setArmed(false)}className={cn(diff --git a/src/lib/__tests__/cloud-pitch.test.ts b/src/lib/__tests__/cloud-pitch.test.tsnew file mode 100644index 00000000..7c7d1414--- /dev/null+++ b/src/lib/__tests__/cloud-pitch.test.ts@@ -0,0 +1,45 @@+/**+ * Das Argument des Wolkenschalters.+ *+ * Die Zahlen selbst haengen an scripts/check-cloud-sales.mjs, das sie gegen+ * den Katalog im Web-Repo haelt. Hier steht, was die Zeilen SAGEN muessen:+ * die richtige Reihenfolge, kein Versprechen ohne Bedingung, keine Zahl, die+ * nicht aus der Konstante kommt.+ */+import { describe, expect, it } from 'vitest'+import { CLOUD_PITCH, cloudPitchLines } from '../cloud-pitch'++describe('cloud pitch', () => {+ it('leads with what the models may do, then the price, then the equipment', () => {+ const [first, second, third] = cloudPitchLines()+ expect(first).toMatch(/without refusing/i)+ expect(second).toMatch(/no credits/i)+ expect(third).toMatch(/image and .* video/i)+ })++ it('never promises unmetered without naming the paid plan and the ceiling', () => {+ const line = cloudPitchLines()[1]+ expect(line).toMatch(/paid plan/i)+ expect(line).toContain(CLOUD_PITCH.flashDailyTokens.toLocaleString('en-US'))+ })++ it('calls the measurement a measurement', () => {+ expect(cloudPitchLines()[0]).toMatch(/measured, not guessed/i)+ })++ it('takes every number from the constant, never from a typed-out string', () => {+ const doubled = cloudPitchLines({+ ...CLOUD_PITCH,+ unfilteredChatModels: CLOUD_PITCH.unfilteredChatModels + 1,+ imageModels: CLOUD_PITCH.imageModels + 1,+ })+ expect(doubled[0]).toContain(String(CLOUD_PITCH.unfilteredChatModels + 1))+ expect(doubled[2]).toContain(String(CLOUD_PITCH.imageModels + 1))+ })++ it('claims nothing the catalogue cannot carry', () => {+ expect(CLOUD_PITCH.unfilteredChatModels).toBeLessThanOrEqual(CLOUD_PITCH.chatModels)+ expect(CLOUD_PITCH.flashModels).toBeLessThanOrEqual(CLOUD_PITCH.chatModels)+ for (const line of cloudPitchLines()) expect(line).not.toMatch(/[–—]/u)+ })+})diff --git a/src/lib/cloud-pitch.ts b/src/lib/cloud-pitch.tsnew file mode 100644index 00000000..b148702f--- /dev/null+++ b/src/lib/cloud-pitch.ts@@ -0,0 +1,61 @@+/**+ * Was der Wolkenschalter dem Nutzer verspricht, in Zahlen.+ *+ * Bis 3.0.0 war der Schalter ein Schalter ohne Argument: er sagte, dass etwas+ * umgestellt wird, nie, was man dafuer bekommt. Die drei Zeilen unten sind das+ * Argument, in der Reihenfolge, in der es zaehlt: erst was die Modelle duerfen,+ * dann was nichts kostet, dann was die eigene Maschine nicht kann.+ *+ * ## Warum die Zahlen hier fest stehen+ *+ * Der Katalog liegt im Web-Repo. Diese Oberflaeche zeigt die Zahlen, BEVOR+ * jemand angemeldet ist, also bevor es einen Katalog zu lesen gibt. Sie stehen+ * deshalb hier, und `scripts/check-cloud-sales.mjs` haelt jede einzelne gegen+ * ihre Quelle im Web-Repo. Wer eine Zahl aendert, ohne die andere Seite zu+ * aendern, faellt dort auf.+ *+ * Nichts hier ist eine Zusage fuer den Einzelfall. "Ohne Ablehnung" ist eine+ * MESSUNG vom 10.09.2026, kein Vertrag, und was eine Anfrage enthalten darf,+ * entscheidet der Server bei jedem Aufruf neu.+ */++export interface CloudPitchNumbers {+ /** Chatmodelle im Katalog. */+ chatModels: number+ /** Davon gemessen ohne Ablehnung. */+ unfilteredChatModels: number+ /** Modelle der Flash-Klasse, die im Chat keine Credits kosten. */+ flashModels: number+ /** Taegliche Obergrenze der Flash-Klasse, Ein- und Ausgabe zusammen. */+ flashDailyTokens: number+ /** Bildmodelle. */+ imageModels: number+ /** Videomodelle. */+ videoModels: number+}++export const CLOUD_PITCH: CloudPitchNumbers = {+ chatModels: 46,+ unfilteredChatModels: 27,+ flashModels: 12,+ flashDailyTokens: 500_000,+ imageModels: 10,+ videoModels: 11,+}++const n = (v: number) => v.toLocaleString('en-US')++/**+ * Die drei Zeilen, in fester Reihenfolge.+ *+ * Die Reihenfolge ist Absicht und kein Layoutdetail: das Alleinstellungsmerkmal+ * steht zuerst, der Preis danach, die Ausstattung zuletzt. Wer mit der+ * Ausstattung anfaengt, klingt wie jeder andere Anbieter.+ */+export function cloudPitchLines(p: CloudPitchNumbers = CLOUD_PITCH): string[] {+ return [+ `${p.unfilteredChatModels} of ${p.chatModels} chat models answer without refusing. Measured, not guessed, and marked in the picker.`,+ `${p.flashModels} of them cost no credits at all in chat, up to ${n(p.flashDailyTokens)} tokens a day on a paid plan.`,+ `${p.imageModels} image and ${p.videoModels} video models on our GPUs, including the ones your own machine cannot run.`,+ ]+}