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

Uploaded Python 3

File details

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

File metadata

  • Download URL: portus_ai-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 f5d21cad710693429ebec65803146da5699f64e9e35a4a7e0ac1684c536662dd
MD5 39523d1f8fc8d4f5f4e54f13b0522c9b
BLAKE2b-256 4706aa94b132de860cefe9bc6887af375ff3955fcb40adfc4bc527a0e5ba3dd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: portus_ai-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 73f70ccf658bf3a5001cdec3fdd38d05a2a777f8cd039cccff2843ec249651a6
MD5 9b14150aca1de18145ee2277c4174693
BLAKE2b-256 bef88d1b688a845f2c6c828daa67b3055f2afe720432878a2b63b43722e7bb60

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