Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions client/src/lib/demo-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import type { AvailableModels, Tool } from './types';

export const DEMO_MODELS: AvailableModels = {
openai: ['gpt-5.1', 'gpt-5-mini', 'gpt-4.1', 'gpt-4.1-mini'],
anthropic: [
'claude-opus-4-5',
'claude-opus-4-1',
'claude-sonnet-4',
'claude-haiku-4-5',
],
google: [
'gemini-3-pro-preview',
'gemini-2.5-pro',
'gemini-2.5-flash',
'gemini-2.5-flash-lite',
],
};

export const DEMO_TOOLS: Tool[] = [
{
id: 'instructions',
label: 'Instructions',
enabled: false,
config: {
prompt: "you're in a bad mood",
},
},
{
id: 'consensus',
label: 'Consensus',
enabled: false,
isWorkflow: true,
config: {
models: [
{
provider: 'anthropic',
model: 'claude-opus-4-5',
},
{
provider: 'google',
model: 'gemini-3-pro-preview',
},
{
provider: 'openai',
model: 'gpt-5.1',
},
],
},
},
];
23 changes: 8 additions & 15 deletions client/src/store/config-store.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
import { create } from 'zustand';
import type { ConfigState, AvailableModels, Chat } from '@/lib/types';
import { DEMO_MODELS, DEMO_TOOLS } from '@/lib/demo-config';

const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3001';
const isDemoMode = import.meta.env.VITE_DEMO_MODE === 'true';
const DEMO_MODELS = {
openai: ['gpt-5.1', 'gpt-5-mini', 'gpt-4.1', 'gpt-4.1-mini'],
anthropic: [
'claude-opus-4-5',
'claude-opus-4-1',
'claude-sonnet-4',
'claude-haiku-4-5',
],
google: [
'gemini-3-pro-preview',
'gemini-2.5-pro',
'gemini-2.5-flash',
'gemini-2.5-flash-lite',
],
};

export const useConfigStore = create<ConfigState>((set, get) => ({
currentProvider: 'openai',
Expand Down Expand Up @@ -100,6 +86,13 @@ export const useConfigStore = create<ConfigState>((set, get) => ({
},

loadConfig: async () => {
if (isDemoMode) {
set({
tools: DEMO_TOOLS,
isConfigLoaded: true,
});
return;
}
try {
const response = await fetch(`${API_URL}/api/config`);
if (response.ok) {
Expand Down