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

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_tools_datasette-0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 154616de8f3c51d6495a084b7d91196ec2006a4fde0cfa471eea0652bc9b0e9e
MD5 86afd31822c2da348791c83d9e50b6b4
BLAKE2b-256 929aefd1c4190f014a2689185e6be0dfe1d9b2f9365c8b871c75d956616ae149

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for llm_tools_datasette-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 757df5afb45eb3dac6049ef37f8792ca7c3af7e5ca087fdb41e4a65baebb4f7f
MD5 831d4cae44bc6ef278be133f8d1518e3
BLAKE2b-256 36fe8f171646d45766ffe2ff71a709d92fcc8c279d981171ff40b0b14a42ef38

See more details on using hashes here.

Provenance

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