Skip to main content

Portus: NL queries for data

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Portus: NL queries for data

Setup connection

from sqlalchemy import create_engine

engine = create_engine(
    "postgresql://readonly_role:>sU9y95R(e4m@ep-young-breeze-a5cq8xns.us-east-2.aws.neon.tech/netflix"
)

Create portus session

llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
session = portus.open_session(llm)
session.add_db(engine)

Query data

session.ask("list all german shows").df()

Local models

Portus can be used with local LLMs either using ollama or OpenAI API compatible servers (LM Studio, llama.cpp, etc.).

Ollama

  1. Install ollama for your operating system and make sure it is running.
  2. Use an LLMConfig with name of the form ollama:model_name. For an example see qwen3-8b-ollama.yaml.

The model will be downloaded automatically if it doesn't already exist. Alternatively, ollama pull model_name to download the model manually.

OpenAI compatible servers

You can use any OAI compatible server by setting api_base_url in the LLMConfig. For an example, see qwen3-8b.yaml.

Examples of OAI compatible servers:

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

portus_ai-0.0.4.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

portus_ai-0.0.4-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file portus_ai-0.0.4.tar.gz.

File metadata

  • Download URL: portus_ai-0.0.4.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.4

File hashes

Hashes for portus_ai-0.0.4.tar.gz
Algorithm Hash digest
SHA256 db979fb2c6e69983285c291bf505a13f57c119981b423dc519c831733d197876
MD5 02fd0a478198d2ecb1709fa84f7be0a5
BLAKE2b-256 297c92c27d2d1afbffdf77e7de16166c25c47cbc643c11faec1d6a03af964ea4

See more details on using hashes here.

File details

Details for the file portus_ai-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: portus_ai-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.4

File hashes

Hashes for portus_ai-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 47081a8b2cd1e6455ea75b7e5cba3342aab5c7ff832f1ddb18920d6bc684698b
MD5 e128ece9894f16e97d4a6375971db5c5
BLAKE2b-256 743ac2ef5d197b433b33ed144ce338bacda4e6f8be8e90d7be777cbb6547b6ba

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