Documentation
¶
Overview ¶
Package modelcache persists resolved model.Config values to disk so OpenRouter model configs survive a restart without requiring a fresh catalog fetch.
There is deliberately no TTL or background refresh: startup always refetches every configured OpenRouter model (see the settings-models ticket), and a user who wants fresher data restarts jungi. The cache exists purely as a fallback for when a startup fetch fails (offline, rate limited, etc.) and as the store the /model search flow writes through to so a searched-and-selected model is not lost on restart.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadInto ¶
func LoadInto()
LoadInto reads the on-disk cache and registers every entry into the model runtime registry via model.Register, so cached OpenRouter configs resolve through model.ForModel immediately at startup.
func Put ¶
Put loads the on-disk cache, sets id's entry to cfg with the current time, and writes the cache back out. It is the write-through path used whenever a model.Config is resolved from the network (settings-configured OpenRouter models at startup, or the /model search flow).
Types ¶
type Cache ¶
Cache is an in-memory, JSON-serialisable map of model identifiers to their cached Entry.
Source Files
¶
- modelcache.go