diff --git a/homeassistant/components/llama_cpp/api.py b/homeassistant/components/llama_cpp/api.py index 6fce2905f2fa..ba259d29b33f 100644 --- a/homeassistant/components/llama_cpp/api.py +++ b/homeassistant/components/llama_cpp/api.py @@ -64,9 +64,13 @@ async def async_create_client( base_url=config_entry_data[CONF_BASE_URL], http_client=get_async_client(hass), ) - # Cache current platform data which gets added to each request - # (caching done by library) - _ = await hass.async_add_executor_job(client.platform_headers) + + def warm_up_client() -> None: + """Cache platform headers and resolve the SDK's lazy chat resources.""" + client.platform_headers() + _ = client.chat.completions + + await hass.async_add_executor_job(warm_up_client) return client