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

Uploaded Python 3

File details

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

File metadata

  • Download URL: portus_ai-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 7b99cdb1340c8229c579bf8cec0eb363e160c161ac756ff1d942a25e4d5fcf3d
MD5 25ed59174c747bdb19886f1b3e9c805c
BLAKE2b-256 8986690f304c55024befd5c046f1680f217cbb9deaca9274a0a99a1cf8cd6fdd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: portus_ai-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0a181ba78b4d237b763716c7bdbeaaf045df5faedd5d0e77ad623478e1506dd1
MD5 91b71fa93b260fd4a93fc8c6ddd4e184
BLAKE2b-256 ab9830620b3852f831691d8bfc27da238f5d1b212fa3a73ad49b1ff7d6369a35

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