Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: show local model comparisons with zero API cost and sourced quality
Adam Eivyd095e21f8c3d
diff --git a/client/src/components/models/ModelComparison.jsx b/client/src/components/models/ModelComparison.jsxindex 6db2f8fcc4..7120816181 100644--- a/client/src/components/models/ModelComparison.jsx+++ b/client/src/components/models/ModelComparison.jsx@@ -45,7 +45,7 @@ const valueText = (metric, money = false) => metric ? `${metric.estimated ? '≈function MetricEvidence({ metric }) {if (!metric) return <span>Needs research</span>;- return <details><summary className="cursor-pointer">{metric.estimated ? 'Estimated' : 'Sourced'} · {formatCount(metric.sources.length)} references</summary>+ return <details><summary className="cursor-pointer">{metric.sources.length ? <>{metric.estimated ? 'Estimated' : 'Sourced'} · {formatCount(metric.sources.length)} references</> : 'Configured cost'}</summary><p className="my-2 max-w-xl whitespace-normal text-port-text-muted">{metric.method}</p><ul className="space-y-1">{metric.sources.map(source => <li key={source.url + source.retrievedAt}><a className="text-port-accent underline break-all" href={source.url} target="_blank" rel="noreferrer">{new URL(source.url).hostname}</a> · {source.retrievedAt.slice(0, 10)}<p className="max-w-xl whitespace-normal text-port-text-muted">{source.methodology}</p></li>)}</ul></details>;@@ -222,6 +222,7 @@ export default function ModelComparison() {? 'Task cost includes the token usage of each model and effort on the same benchmark. It is an API reference cost, not a quote for your workload or subscription. Missing task costs stay unplotted until researched; token rates are never substituted.': 'Token price is the rate per token, not cost per task. Higher effort can use more reasoning tokens at the same rate, so vertical effort curves do not mean equal task cost. Choose Cost per benchmark task to compare reasoning expense.'}</p></section>+ <p className="text-xs text-port-text-muted">Local inference shows $0 API charges; hardware and electricity are excluded. Local quality references are estimates until measured on your build. Zero-cost points are hidden on the log cost scale.</p><ComparisonValueGuide rows={selected} /><GenerationDelta rows={selected} priceId={price[0]} /><details className="rounded-xl border border-port-border bg-port-card p-4"><summary className="cursor-pointer font-medium">Methodology and confidence</summary><p className="mt-2 text-sm text-port-text-muted">PortOS index v1 uses {catalog?.composite?.anchor || 'the versioned reference index'} as its stable scale. Exact results take priority. Other evaluations are calibrated using at least three shared model/effort configurations, then combined by their median. Uncalibrated benchmark scores are never mixed directly. Missing effort levels use interpolation or a low-confidence nearest-effort estimate for the same model. Unknown members of a recognized family receive a low-confidence median family baseline with source range. No improvement is assumed for a new generation without evidence. Each estimate retains its method and source dates below; missing models stay in the coverage list for research.</p></details>diff --git a/client/src/components/models/ModelComparison.test.jsx b/client/src/components/models/ModelComparison.test.jsxindex f2ad8b027a..b63e721bb3 100644--- a/client/src/components/models/ModelComparison.test.jsx+++ b/client/src/components/models/ModelComparison.test.jsx@@ -111,3 +111,17 @@ it('defaults fit visible to active and toggles back to full axes', async () => {expect(screen.getByRole('button', { name: 'Fit visible' })).toHaveAttribute('aria-pressed', 'false');});++it('plots local zero API costs with configured evidence and explains their exclusion on a log scale', async () => {+ const localCost = { value: 0, estimated: false, method: 'Local inference: $0 API charges. Hardware and electricity excluded.', sourceIds: [] };+ api.getModelComparison.mockResolvedValue({ composite: { sources: [], rows: [+ { ...row('ornith-1.0-35b', 'reasoning', 19, 0, true), costPerTask: localCost },+ ] } });+ render(<ModelComparison />);+ expect(await screen.findByTestId('scatter-example:ornith-1.0-35b')).toHaveAttribute('data-values', '[[0,19]]');+ expect(screen.getByText('Configured cost')).toBeTruthy();+ expect(screen.getByText(/Local inference shows \$0 API charges/)).toBeTruthy();+ fireEvent.click(screen.getByLabelText('Log cost scale'));+ expect(screen.queryByTestId('scatter-example:ornith-1.0-35b')).toBeNull();+ expect(screen.getByText(/No points match/)).toBeTruthy();+});diff --git a/data.reference/model-comparison.json b/data.reference/model-comparison.jsonindex a56252fce6..4c3e7aec54 100644--- a/data.reference/model-comparison.json+++ b/data.reference/model-comparison.json@@ -56256,6 +56256,81 @@"tokensPerSecond": null,"quota": null,"notes": "OpenRouter routed price, not the model creator first-party price. Cached-token, audio and per-request charges are not represented by this schema; free routes remain subject to upstream limits and terms."+ },+ {+ "provider": "Ornith",+ "model": "ornith-1.0-35b",+ "effort": "reasoning",+ "billing": "local",+ "costPerTask": null,+ "inputPerMillion": null,+ "outputPerMillion": null,+ "reasoningPerMillion": null,+ "responseSeconds": null,+ "tokensPerSecond": null,+ "quota": null,+ "id": "portos-research-20261001-ornith-1.0-35b-base",+ "configuration": "Qwen3.5 35B A3B base-model proxy; unmeasured post-training and local build",+ "benchmark": "PortOS Research Index v1 (AA v4.3.2 scale)",+ "quality": {+ "value": 19,+ "source": {+ "url": "https://huggingface.co/ornith-ai/Ornith-1.0-35B",+ "retrievedAt": "2026-10-01T01:32:34Z",+ "methodology": "PortOS estimate: use the published Qwen3.5 35B A3B reasoning AA v4.3.2 index (19, itself a publisher estimate) as a low-confidence base-model proxy. The Ornith model card identifies Qwen3.5 post-training. No gain from coding post-training, requested effort, quantization or runtime is assumed. This is not an Ornith general-intelligence measurement. Base score: https://artificialanalysis.ai/models/qwen3-5-35b-a3b."+ }+ },+ "notes": "Ornith publisher coding results are stored separately; their percentages are not AA index points. Local API charges are zero, while hardware, electricity and throughput remain machine-specific. Research required for a measured general-intelligence score."+ },+ {+ "provider": "Ornith",+ "model": "ornith-1.0-35b",+ "effort": "reasoning",+ "billing": "local",+ "costPerTask": null,+ "inputPerMillion": null,+ "outputPerMillion": null,+ "reasoningPerMillion": null,+ "responseSeconds": null,+ "tokensPerSecond": null,+ "quota": null,+ "id": "ornith-publisher-20261001-35b-terminal-bench-2.1-terminus2",+ "configuration": "Ornith publisher Terminal-Bench 2.1 (Terminus-2)",+ "benchmark": "Ornith publisher Terminal-Bench 2.1 (Terminus-2)",+ "quality": {+ "value": 64.2,+ "source": {+ "url": "https://huggingface.co/ornith-ai/Ornith-1.0-35B",+ "retrievedAt": "2026-10-01T01:32:34Z",+ "methodology": "Publisher coding success percentage; Harbor/Terminus-2, 128K context, temperature 1.0, top_p 1.0; five-run average. The model card reports a four-hour timeout and an adjusted chat template. This is not a general-intelligence index or local throughput measurement."+ }+ },+ "notes": "Publisher result for the base checkpoint; local quantization and hardware are unmeasured. Keep this harness-specific score separate from the AA intelligence index."+ },+ {+ "provider": "Ornith",+ "model": "ornith-1.0-35b",+ "effort": "reasoning",+ "billing": "local",+ "costPerTask": null,+ "inputPerMillion": null,+ "outputPerMillion": null,+ "reasoningPerMillion": null,+ "responseSeconds": null,+ "tokensPerSecond": null,+ "quota": null,+ "id": "ornith-publisher-20261001-35b-swebench-verified",+ "configuration": "Ornith publisher SWE-bench Verified (OpenHands)",+ "benchmark": "Ornith publisher SWE-bench Verified (OpenHands)",+ "quality": {+ "value": 75.6,+ "source": {+ "url": "https://huggingface.co/ornith-ai/Ornith-1.0-35B",+ "retrievedAt": "2026-10-01T01:32:34Z",+ "methodology": "Publisher coding success percentage; OpenHands, temperature 1.0, top_p 0.95, 256K context. This is not a general-intelligence index or local throughput measurement."+ }+ },+ "notes": "Publisher result for the base checkpoint; local quantization and hardware are unmeasured. Keep this harness-specific score separate from the AA intelligence index."}]}diff --git a/server/lib/README.md b/server/lib/README.mdindex 39dd29a122..4b516076c3 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -776,7 +776,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `chatgptText.js` | `stripChatgptCitations(text)` removes opaque ChatGPT citation tokens while preserving ordinary Markdown and asset links. |-| `modelComparisonComposite.js` | `buildModelComparisonComposite(observations, inventory)` derives a stable sourced index with calibrated and effort estimates, route-specific price references and explicit research gaps. |+| `modelComparisonComposite.js` | `buildModelComparisonComposite(observations, inventory)` derives a stable sourced index with calibrated and effort estimates, route-specific price references, zero API charges for local-inference inventory and explicit research gaps. || `messageLogError.js` | `messageLogError(error)` projects mailbox failures to allowlisted codes and HTTP error status, excluding provider text and credentials. |diff --git a/server/lib/comparisonModelScope.js b/server/lib/comparisonModelScope.jsindex 164a330c1a..1288604a06 100644--- a/server/lib/comparisonModelScope.js+++ b/server/lib/comparisonModelScope.js@@ -102,6 +102,7 @@ const ALIASES = new Map([['gemini-3.1-pro', 'gemini-3.1-pro-preview'],['grok-3-mini', 'grok-3-mini-reasoning'],['kimi-k2-instruct', 'kimi-k2'],+ ['qwen3-coder-30b-a3b', 'qwen3-coder-30b-a3b-instruct'],['nemotron-3-ultra', 'nemotron-3-ultra-550b-a55b'],['claude-fable-5-1', 'claude-fable-5.1'],// Published Bedrock model ids and dated API aliases for the same weights.@@ -174,7 +175,9 @@ export function catalogSlugForProviderModel(modelId) {// A local-shaped id never reaches the rules below, declared or not: they were// written for hosted ids and mis-strip a GGUF repo name. A declared entry// resolves to its reviewed benchmark name; an undeclared one resolves to ''.- if (isLocalCatalogId(modelId)) return catalogSlugForLocalModel(modelId);+ // OpenCode can qualify a local install id with its runtime namespace.+ const localId = modelId.replace(/^(?:ollama|lmstudio)\//i, '');+ if (isLocalCatalogId(localId)) return catalogSlugForLocalModel(localId);// Bedrock's namespace and serving-version suffix are not weight revisions.if (slug.startsWith('amazon-bedrock/')) slug = slug.slice('amazon-bedrock/'.length)diff --git a/server/lib/comparisonModelScope.test.js b/server/lib/comparisonModelScope.test.jsindex 5551bd0a71..f6b7bfb845 100644--- a/server/lib/comparisonModelScope.test.js+++ b/server/lib/comparisonModelScope.test.js@@ -28,7 +28,11 @@ describe('catalogSlugForProviderModel', () => {for (const id of ['ornith:35b', 'lmstudio-community/Ornith-1.0-35B-GGUF', 'ORNITH:35B']) {expect(catalogSlugForProviderModel(id)).toBe('ornith-1.0-35b');}- expect(catalogSlugForProviderModel('qwen3-coder:30b')).toBe('qwen3-coder-30b-a3b');+ expect(catalogSlugForProviderModel('qwen3-coder:30b')).toBe('qwen3-coder-30b-a3b-instruct');+ expect(catalogSlugForProviderModel('ollama/qwen3-coder:30b')).toBe('qwen3-coder-30b-a3b-instruct');+ expect(catalogSlugForProviderModel('qwen3-coder-30b-a3b')).toBe('qwen3-coder-30b-a3b-instruct');+ expect(catalogSlugForProviderModel('qwen2.5-coder:32b')).toBe('qwen2.5-coder-instruct-32b');+ expect(catalogSlugForProviderModel('lmstudio-community/Qwen2.5-Coder-7B-Instruct-GGUF')).toBe('qwen2.5-coder-instruct-7b');expect(catalogSlugForProviderModel('unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF')).toBe('devstral-small-2-24b');});@@ -43,7 +47,6 @@ describe('catalogSlugForProviderModel', () => {// so silence — not a wrong guess — is the correct answer.expect(catalogSlugForProviderModel('hf.co/fdtn-ai/Foundation-Sec-8B-Reasoning-Q8_0-GGUF:Q8_0')).toBe('');expect(catalogSlugForProviderModel('qwen3.8:27b-mlx')).toBe('');- expect(catalogSlugForProviderModel('qwen2.5-coder:32b')).toBe('');expect(catalogSlugForProviderModel('lmstudio-community/LFM2.5-1.2B-Thinking-GGUF')).toBe('');});diff --git a/server/lib/localLlmCatalog.js b/server/lib/localLlmCatalog.jsindex 7dfe2ac2ca..977d97b96d 100644--- a/server/lib/localLlmCatalog.js+++ b/server/lib/localLlmCatalog.js@@ -695,7 +695,7 @@ export const LOCAL_LLM_CATALOG = [// ── Coding / agentic tier ──{key: 'qwen3-coder-30b',- benchmarkModel: 'qwen3-coder-30b-a3b',+ benchmarkModel: 'qwen3-coder-30b-a3b-instruct',name: 'Qwen3-Coder 30B',category: 'coding',recommendedFor: ['coding', 'general'],@@ -715,6 +715,7 @@ export const LOCAL_LLM_CATALOG = [},{key: 'qwen2.5-coder-7b',+ benchmarkModel: 'qwen2.5-coder-instruct-7b',name: 'Qwen2.5-Coder 7B',category: 'coding',recommendedFor: ['coding'],@@ -743,6 +744,7 @@ export const LOCAL_LLM_CATALOG = [},{key: 'qwen2.5-coder-32b',+ benchmarkModel: 'qwen2.5-coder-instruct-32b',name: 'Qwen2.5-Coder 32B',category: 'coding',recommendedFor: ['coding', 'reasoning'],diff --git a/server/lib/modelComparisonComposite.js b/server/lib/modelComparisonComposite.jsindex e85eaa5500..955a72153a 100644--- a/server/lib/modelComparisonComposite.js+++ b/server/lib/modelComparisonComposite.js@@ -134,7 +134,6 @@ export function buildModelComparisonComposite(observations, inventory) {if (sameModelEvidence.length) quality = derived(median(sameModelEvidence.map(metric => metric.value)), sameModelEvidence,'Same-model configuration baseline; the published evaluation does not establish this requested effort. Low confidence, research required.');}- if (quality && /gguf|mlx|:\d+b|quantized/i.test(entry.model)) quality = derived(quality.value, [quality], 'Public base-model reference for a local build; quantization and runtime differences have not been measured.');const familyRows = familyAnchors.get(familyKey(modelSlug(entry.model))) || [];const baseline = (field, candidates) => {const values = candidates.filter(row => row[field] && (field === 'quality' || row[field].value > 0));@@ -147,7 +146,14 @@ export function buildModelComparisonComposite(observations, inventory) {const sameEffort = familyRows.filter(row => effortKey(row.effort) === effort);quality = baseline('quality', sameEffort.length ? sameEffort : familyRows);}+ if (quality && (provider.localInference || /gguf|mlx|:\d+b|quantized/i.test(entry.model))) {+ quality = derived(quality.value, [quality], 'Public base-model reference for a local build; quantization and runtime differences have not been measured. ' + quality.method);+ }+ const localCost = () => ({ value: 0, estimated: false, sources: [],+ method: 'Local inference: $0 API charges. Hardware, electricity and runtime opportunity costs are excluded; throughput is not a dollar price.',+ });const price = field => {+ if (provider.localInference) return localCost();// Exact endpoint/tier first; otherwise show an explicitly labeled API reference.const route = row => /^OpenRouter routed model (.+); standard pricing tier$/.exec(row.configuration || '')?.[1];const standardTier = row => !/above \d|minimum \d|long.context|batch|:free/i.test(row.configuration || '');@@ -163,12 +169,12 @@ export function buildModelComparisonComposite(observations, inventory) {};if (incomparableReason) quality = null;const input = price('inputPerMillion'), output = price('outputPerMillion');- const blended = input && output ? { ...derived((3 * input.value + output.value) / 4, [input, output], '3:1 uncached input/output token mix; USD per 1M total tokens. API reference, not subscription or local operating cost.'), estimated: input.estimated || output.estimated } : null;+ const blended = input && output ? { ...derived((3 * input.value + output.value) / 4, [input, output], provider.localInference ? input.method : '3:1 uncached input/output token mix; USD per 1M total tokens. API reference, not subscription or local operating cost.'), estimated: input.estimated || output.estimated } : null;const taskRow = latest(modelRows.filter(row => effortKey(row.effort) === effort && row.benchmark === COMPARISON_ANCHOR), 'costPerTask');rows.push({ id: `${provider.id}:${entry.model}:${effort}`, providerId: provider.id, provider: provider.name,model: entry.model, comparisonModel: modelSlug(entry.model), modelKey: `${provider.id}:${entry.model}`, effort, quality, incomparableReason,inputPerMillion: input, outputPerMillion: output, blendedPerMillion: blended,- costPerTask: incomparableReason ? null : evidenceMetric(taskRow, 'costPerTask', `${COMPARISON_ANCHOR} task cost; API reference`, false),+ costPerTask: incomparableReason ? null : provider.localInference ? localCost() : evidenceMetric(taskRow, 'costPerTask', `${COMPARISON_ANCHOR} task cost; API reference`, false),needsResearch: !quality || quality.estimated || !input || !output || input.estimated || output.estimated,});}diff --git a/server/routes/modelComparison.js b/server/routes/modelComparison.jsindex a293955e5e..3fda1d5817 100644--- a/server/routes/modelComparison.js+++ b/server/routes/modelComparison.js@@ -4,6 +4,7 @@ import { validateRequest, modelComparisonImportSchema } from '../lib/validation.import { getPublicModelComparison, importModelComparison } from '../services/modelComparison.js';import { getSelectableProviders } from '../services/providers.js';import { effortLevelsForProvider, filterSelectableModels } from '../lib/providerModels.js';+import { localRuntimeKind } from '../lib/modelPinMembership.js';import { gatewayIdForProvider } from '../lib/providerGateways.js';import { buildModelComparisonComposite } from '../lib/modelComparisonComposite.js';@@ -13,6 +14,7 @@ export function createModelComparisonRoutes(providerService = { getSelectableProconst [catalog, result] = await Promise.all([getPublicModelComparison(), providerService.getSelectableProviders()]);const inventory = result.providers.filter(provider => provider.enabled !== false).map(provider => ({id: provider.id, name: provider.name, gateway: gatewayIdForProvider(provider) || null,+ localInference: provider.servicePlan === 'local' || (!provider.servicePlan && !gatewayIdForProvider(provider) && Boolean(localRuntimeKind(provider))),models: filterSelectableModels(provider.models).filter(model => typeof model === 'string' && model).map(model => ({model, efforts: effortLevelsForProvider(provider, model) || [],})),diff --git a/server/routes/modelComparison.test.js b/server/routes/modelComparison.test.jsindex 3f77101bc0..caca2f6e8c 100644--- a/server/routes/modelComparison.test.js+++ b/server/routes/modelComparison.test.js@@ -41,7 +41,7 @@ it('merges newer installed evidence with shipped evidence and includes only seleexpect(result.body.observations.find(row => row.id === observation.id).quality.value).toBe(1);expect(result.body.observations.find(row => row.id === observation.id).notes).toBe(localObservation.notes);expect(result.body.observations).toHaveLength(seed.observations.length);- expect(result.body.inventory).toEqual([{ id: 'example-provider', name: 'Example provider', gateway: null, models: [{ model: observation.model, efforts: [] }] }]);+ expect(result.body.inventory).toEqual([{ id: 'example-provider', name: 'Example provider', gateway: null, localInference: false, models: [{ model: observation.model, efforts: [] }] }]);expect(result.body.composite.rows.length).toBeGreaterThan(0);expect(result.body.composite.rows.every(row => row.providerId === 'example-provider')).toBe(true);for (const path of ['/comparison/discover', '/comparison/run']) expect((await request(app).post(path).send({})).status).toBe(404);@@ -130,3 +130,46 @@ it('loads legacy benchmark labels after upgrade and preserves evidence through sexpect((await request(app).post('/comparison/import').send({ schemaVersion: 1, observations: [changed] })).status).toBe(409);expect((await request(app).get('/comparison')).status).toBe(200);});++it('plots local Ornith and Qwen Coder with zero API charges and sourced quality without borrowing hosted costs', async () => {+ const providers = [+ { id: 'ollama', name: 'Ollama', models: ['ornith:35b', 'qwen3-coder:30b', 'qwen2.5-coder:32b', 'unknown:7b'] },+ { id: 'local-wrapper', name: 'Example CLI', ollamaBacked: true, models: ['ollama/qwen3-coder:30b'] },+ { id: 'declared-local', name: 'Example private runtime', servicePlan: 'local', models: ['ornith:35b'] },+ { id: 'lmstudio', name: 'LM Studio', models: ['lmstudio-community/Ornith-1.0-35B-GGUF'] },+ { id: 'hosted', name: 'Example hosted', servicePlan: 'paid', ollamaBacked: true, models: ['qwen/qwen3-coder-30b-a3b-instruct'] },+ { id: 'gateway', name: 'Example gateway', gatewayBacked: 'openrouter', ollamaBacked: true, models: ['qwen/qwen3-coder-30b-a3b-instruct'] },+ { id: 'free-tier', name: 'Example free service', servicePlan: 'free', models: ['qwen/qwen3-coder-30b-a3b-instruct'] },+ ];+ const localApp = express();+ localApp.use('/comparison', createModelComparisonRoutes({ getSelectableProviders: async () => ({ providers }) }));+ localApp.use(errorMiddleware);+ const result = await request(localApp).get('/comparison');+ expect(result.status).toBe(200);+ const { rows, sources } = result.body.composite;+ const local = rows.filter(row => ['ollama', 'local-wrapper', 'declared-local', 'lmstudio'].includes(row.providerId));+ expect(local.length).toBeGreaterThanOrEqual(7);+ for (const row of local) {+ for (const field of ['inputPerMillion', 'outputPerMillion', 'blendedPerMillion', 'costPerTask']) {+ expect(row[field]).toMatchObject({ value: 0, estimated: false, sourceIds: [] });+ expect(row[field].method).toContain('Hardware, electricity');+ }+ if (row.model === 'unknown:7b') {+ expect(row.quality).toBeNull();+ } else {+ expect(row.quality.estimated).toBe(true);+ expect(row.quality.sourceIds.length).toBeGreaterThan(0);+ expect(row.quality.method).toContain('local build');+ }+ }+ const ornith = local.find(row => row.model === 'ornith:35b');+ expect(ornith.quality.value).toBe(19);+ expect(ornith.quality.method).toContain('base-model proxy');+ expect(sources[ornith.quality.sourceIds[0]].url).toBe('https://huggingface.co/ornith-ai/Ornith-1.0-35B');+ expect(local.find(row => row.model === 'qwen3-coder:30b').quality.value).toBeGreaterThan(0);+ for (const row of rows.filter(row => ['hosted', 'gateway', 'free-tier'].includes(row.providerId))) {+ expect(row.inputPerMillion.value).toBeGreaterThan(0);+ expect(row.costPerTask).toBeNull();+ }+ expect(result.body.observations.find(row => row.id === 'ornith-publisher-20261001-35b-swebench-verified').quality.value).toBe(75.6);+});