Skip to main content

sqlite-utils-llm

This is a plugin for sqlite-utils that adds a custom SQL function llm(model, prompt) that can be used to call out to an LLM model using the llm command line tool.

Installation

Have sqlite-utils and llm already installed, then install this package with pip:

sqlite-utils install sqlite-utils-llm

Example

Given the following combos.csv file with ice cream flavor combinations we want to complete the suggestion column with a flavor suggestion based on the other two flavors using an LLM.

flavor1,flavor2,suggestion
vanilla,chocolate,
strawberry,vanilla,
chocolate,strawberry,
mint,lemon,

Let's load the data into a SQLite database:

% sqlite-utils insert icecream.db combos combos.csv --csv --empty-null

Now we can use the llm function to update the suggestion column with a flavor suggestion:

% sqlite-utils query icecream.db "UPDATE combos set suggestion=llm('gpt-4o-mini', 'What other flavor would I like if I have choosen ' || flavor1 || ' and ' || flavor2 || '? Return just the name of the flavor.')"

Now we can query the table to see the suggestions:

% sqlite-utils query icecream.db "SELECT * FROM combos" --table
flavor1     flavor2     suggestion
----------  ----------  ------------
vanilla     chocolate   Strawberry
strawberry  vanilla     Chocolate
chocolate   strawberry  Vanilla
mint        lemon       Basil

Metadata

Release files for sqlite-utils-llm 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlite-utils-llm 0.3
File Size Uploaded Provenance Actions
sqlite_utils_llm-0.3.tar.gz 2.3 kB Without provenance Details for sqlite_utils_llm-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlite-utils-llm 0.3
File Interpreter ABI Platform Actions
sqlite_utils_llm-0.3-py3-none-any.whl Python 3 none any Details for sqlite_utils_llm-0.3-py3-none-any.whl

Total release size: 4.8 kB

Release files / sqlite_utils_llm-0.3.tar.gz

Download URL sqlite_utils_llm-0.3.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0d7bf6b8d4dd13e80d0cc674203f6c6e1fe7973b2b75970348879ba66eea7ca0
BLAKE2b-256 checksum
How to use checksums
5162402a0c7c94506366a36e110f13ab2252b0fb12279b68a24bf19ba21b0b37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / sqlite_utils_llm-0.3-py3-none-any.whl

Download URL sqlite_utils_llm-0.3-py3-none-any.whl
Size 2.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccc1f4b82df55e9aca0e831b198b394db701ce2eb2ee5d1860073b07df165222
BLAKE2b-256 checksum
How to use checksums
d67cc7082ddd3c67b923242f5b9fb72bc97694b8902395c194a8fefdc8aaef59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for sqlite-utils-llm 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page