Skip to main content

Expose Datasette instances to LLM as a tool

Project description

llm-tools-datasette

PyPI Changelog Tests License

Expose Datasette instances to LLM as a tool

Installation

Install this plugin in the same environment as LLM. You'll need at least the 0.26a1 alpha.

llm install llm-tools-datasette

Usage

First find the URL to a database within your Datasette instance. For example, https://datasette.io/content.

To use this with the LLM command-line tool:

llm --tool 'Datasette("https://datasette.io/content")' "Show tables" --td

This plugin works well with llm chat:

llm chat --tool 'Datasette("https://datasette.io/content")' --td

(Omit the --td option if you don't want to see debugging details.)

With the LLM Python API:

import llm
from llm_tools_datasette import Datasette

model = llm.get_model("gpt-4.1-mini")

result = model.chain(
    "Show most interesting tables",
    tools=[Datasette("https://datasette.io/content")],
).text()

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-tools-datasette
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

llm install -e '.[test]'

To run the tests:

python -m pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_tools_datasette-0.1a0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_tools_datasette-0.1a0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file llm_tools_datasette-0.1a0.tar.gz.

File metadata

  • Download URL: llm_tools_datasette-0.1a0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_tools_datasette-0.1a0.tar.gz
Algorithm Hash digest
SHA256 13fd02006bb7d754089a3c38ecf8f3ef597d8a9ca252cdee3e62d2c30844123c
MD5 bb95bb438a8b01c9f7cdda254eba74a1
BLAKE2b-256 5827d07e5cdef6496899daffe4e2fac699db176b72318fd6ce39d1c242ede278

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_datasette-0.1a0.tar.gz:

Publisher: publish.yml on simonw/llm-tools-datasette

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_tools_datasette-0.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_tools_datasette-0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd2c456115d56f4abbb56205c3cc26f5cf917a66278efbcf610d9e4d90d5d2a4
MD5 7896e2f335bfd223607298ce8a8590e8
BLAKE2b-256 904d19ca3c6059606e5ad848ec907be8f7db3bc1cfd98cecf7994c9465ad250c

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_datasette-0.1a0-py3-none-any.whl:

Publisher: publish.yml on simonw/llm-tools-datasette

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page