Skip to main content

Datasette enrichment for analyzing row data using a locally hosted - or remote - ollama instance

Project description

datasette-enrichments-ollama

PyPI Changelog Tests License

Datasette enrichment for analyzing row data using a locally hosted Ollama instance

I'm not a programmer so feel free to takeover this repo through a fork.

Requirement

you must have a running instance of ollama to use this plugin. At present this is only avialable on Linux or Macos. See more here: https://github.com/ollama/ollama

This is a straight fork from datasette-enrichment-gpt

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-enrichments-ollama

Configuration

This plugin needs an API url for the ollama instance. Configure that in metadata.yml like so

plugins:
  datasette-enrichments-ollama:
    api_url: "http://localhost:11434/api/generate"

Or to avoid that key being visible on /-/metadata set it as an environment variable and use this:

plugins:
  datasette-enrichments-ollama:
    api_url:
      $env: OLLAMA_API_URL

Usage

Once installed, this plugin will allow users to select rows to enrich and run them through prompts using models that are installed and registered in the ollama service, then saving the result of the prompt in the specified column.

Development

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

cd datasette-enrichments-ollama
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

datasette-enrichments-ollama-0.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

datasette_enrichments_ollama-0.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file datasette-enrichments-ollama-0.1.tar.gz.

File metadata

File hashes

Hashes for datasette-enrichments-ollama-0.1.tar.gz
Algorithm Hash digest
SHA256 926060f7a9d0de9473e30dea5af07948281d5e301066758e963bd982bbf48696
MD5 8813fa5ac61a4b15198c8aef745ae323
BLAKE2b-256 fb27614e2639800d6077a512b8aa1a062f8f8e89addac69f8714810b8646b9f3

See more details on using hashes here.

File details

Details for the file datasette_enrichments_ollama-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_enrichments_ollama-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6963c07f63f673fdf3a9b58d3e529f1aacf577df5be3c8d721353999b11b016d
MD5 ca60b7c375c9497cfdd90d1074614254
BLAKE2b-256 56dc36bc625c1b07f4b2e8b2c05e02066153f4b340850c724297b83c7bd8f899

See more details on using hashes here.

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