Skip to content

CatalogOptions

Defined in: packages/core/src/providers/modelCatalog.ts:127

Options shared by catalog reads; every field is injectable for hermetic tests.

optional cacheDir?: string

Defined in: packages/core/src/providers/modelCatalog.ts:131

Override the cache directory (defaults to ~/.gsloth/model-catalog).


optional cacheOnly?: boolean

Defined in: packages/core/src/providers/modelCatalog.ts:155

EXT-161 — read the cache and never reach the network, returning the cached slice whether it is fresh or stale, and null when there is none.

For callers on a latency-critical path that would rather have no answer than a slow one. The context guard runs before the first model call of a session, and a cold fetch there is bounded only by CATALOG_TIMEOUT_MS: a fraction of a second on a fast link, and on a slow or high-latency one whatever the link takes, all of it in front of the user’s first turn — to decide a threshold that has a fallback (the model profile) and whose absence costs only that one session’s preventive compaction. It is the tail this guards, not the median. The cache is filled by gth init and gth models --refresh, which are explicit and can afford to wait.

What the fallback costs in exchange is written where it is paid — see the tier-3 ruling in core/contextWindow.ts.

Ignored when refresh is set — an explicit refresh is a request to go to the network.


optional fetchImpl?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: packages/core/src/providers/modelCatalog.ts:135

Override the fetch implementation (defaults to the global fetch).

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>


optional now?: number

Defined in: packages/core/src/providers/modelCatalog.ts:133

Override “now” for TTL math (defaults to Date.now()).


optional refresh?: boolean

Defined in: packages/core/src/providers/modelCatalog.ts:129

Force a network refresh even when a fresh cache exists (backs gth models --refresh).


optional ttlMs?: number

Defined in: packages/core/src/providers/modelCatalog.ts:137

Override the TTL window in ms (defaults to CATALOG_TTL_MS).