Move llama.cpp chat initialization off the event loop (#195244)

This commit is contained in:
ltechdnb
2026-12-01 17:36:29 +00:00
committed by GitHub
parent cf5fe584e9
commit ff5461c84a
+7 -3
View File
@@ -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