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.1a1.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.1a1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_tools_datasette-0.1a1.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.1a1.tar.gz
Algorithm Hash digest
SHA256 9aa184c18d52eea3f543614a9a84cd53f46d94f1dadf8fb4db7949c38d8aea6c
MD5 24a6ade8bc03c102a7695e0248fdf676
BLAKE2b-256 bf21c0090150ecc0baf4cd694e1179a582d16c9ad7c8f2e07bdc040f76a0c1d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_datasette-0.1a1.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.1a1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_tools_datasette-0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 d77123846b7576645172552e1254dfafad2afeca29b00ee4ad3c0931cacb5787
MD5 be51532d60de87d70bdf9b46ea1f3168
BLAKE2b-256 8780c4e747dec5bdd618c3dd2b7d83ca867086d8df2baff3b69b0626ee52430e

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_datasette-0.1a1-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