Storage, Settings, and Discovery
Storage Architecture
Files:
webui/storage/app-storage.tswebui/storage/store.tswebui/storage/types.tswebui/storage/backends/indexeddb-storage-backend.ts
AppStorage is a facade over multiple stores and a storage backend.
Stores extend the Store base class and use a StorageBackend interface.
The default backend is IndexedDB via IndexedDBStorageBackend.
Global helpers:
getAppStorage()setAppStorage(storage)
Stores
SettingsStore
Key-value store for app settings. Example keys used by the UI:
proxy.enabledproxy.url
ProviderKeysStore
Stores API keys by provider name.
Used by AgentInterface to resolve API keys for the active session.
SessionsStore
Persists full session data plus lightweight metadata. Includes helpers for save, load, delete, update title, and latest session ID.
CustomProvidersStore
Stores manual providers and auto-discovery providers. Supported types include:
ollama,llama.cpp,vllm,lmstudioopenai-completions,openai-responses,anthropic-messages
Model Discovery
File: webui/utils/model-discovery.ts
Discovery helpers:
discoverOllamaModels(baseUrl, apiKey)discoverLlamaCppModels(baseUrl, apiKey)discoverVLLMModels(baseUrl, apiKey)
Each function returns Model[] compatible with the AI module.
Proxy Utilities
File: webui/utils/proxy-utils.ts
Helpers:
shouldUseProxyForProvider(provider, apiKey)applyProxyIfNeeded(model, apiKey, proxyUrl)createStreamFn(getProxyUrl)
These are used by AgentInterface to handle CORS-sensitive providers in browser contexts.
Auth Token Utilities
File: webui/utils/auth-token.ts
getAuthToken()prompts and stores a token inlocalStorage.clearAuthToken()removes the stored token.
