Skip to main content

LLM tools for running queries against SQLite

Project description

llm-tools-sqlite

PyPI Changelog Tests License

LLM tools for running queries against SQLite

Installation

Install this plugin in the same environment as LLM.

llm install llm-tools-sqlite

Usage

To use this with the LLM command-line tool:

llm -T 'SQLite("content.db")' \
  "Count rows in the most interesting looking table" --td

Or use llm chat to chat with your database over multiple rounds:

llm chat -T 'SQLite("content.db")' 

This tool currently only supports read-only queries. Attempts to write to the database will fail with an error.

With the LLM Python API:

import llm
from llm_tools_sqlite import SQLite

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

result = model.chain(
    "Show me the three most interesting looking tables",
    tools=[SQLite("content.db")]
)
for s in result:
    print(s, end="", flush=True)

Development

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

cd llm-tools-sqlite
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_sqlite-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_sqlite-0.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_tools_sqlite-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_sqlite-0.1.tar.gz
Algorithm Hash digest
SHA256 b7e23f8bda244af93fc52f336297a4a65dae49438d853fe32529daceaa3b24a5
MD5 6ba931dfe176377463c9d123f6dc8ecf
BLAKE2b-256 ad9773c7ebc83335cd2d27345efa88194a9af56279816541626e4b969e9904ce

See more details on using hashes here.

Provenance

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

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

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_sqlite-0.1-py3-none-any.whl.

File metadata

  • Download URL: llm_tools_sqlite-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_tools_sqlite-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d46dfa368ea80ae2f21a0df63400e39adaa17a23770f75b1cd245b0a698048dc
MD5 fbbfca4f304e6cefbaa9396dd9f3423b
BLAKE2b-256 f8d678da51dcc803b28802fbaafd562afa0c1942d370796e3a2523fd38de4820

See more details on using hashes here.

Provenance

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

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

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