Sync-to-Async Adapter Expands Datasette’s LLM Capabilities
Simon Willison has released llm-all-models-async (version 0.1), a plugin that enables Datasette users to leverage synchronous large language models alongside the platform’s native asynchronous support.
Addressing a Key Limitation
Datasette, a popular open-source tool for exploring and publishing data, has increasingly integrated LLM capabilities through plugins. While it supports both sync (direct model execution) and async (API-backed) models, there was previously no way to use synchronous models with features that require asynchronous interfaces.
Willison’s plugin addresses this by creating a “sync-to-async” adapter that uses a thread pool to handle requests. This allows users to extend Datasette’s LLM functionality with models that wouldn’t otherwise be compatible.
Technical Details and Background
The development of this plugin was driven by Willison’s experience building the llm-mrchatterbox plugin, which uses a synchronous model. He sought ways to integrate it with other Datasette LLM features like datasette-enrichments-llm, but encountered compatibility issues.
To enable this functionality, Willison also contributed a new hook mechanism to the core LLM library (version 0.30), which now supports asynchronous wrappers for synchronous models.
Implications for Datasette Users
The release of llm-all-models-async significantly expands the range of LLMs that can be integrated with Datasette, opening up new possibilities for data exploration and analysis. Users can now leverage a wider variety of models—including those that may not have native asynchronous APIs—within their Datasette workflows.
This development aligns with the broader trend of making LLMs more accessible and adaptable across different platforms and use cases.