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.dev1.tar.gz (20.1 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.dev1-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for portus_ai-0.0.4.dev1.tar.gz
Algorithm Hash digest
SHA256 dbee0c7a1a5803aaa5065db067a78618b8cfde818b108e9ce22fdd092fed364a
MD5 1d05347a107b760fae29454692d89c52
BLAKE2b-256 95ad9810db1cf8c8106c3aae466bc8fc4c4a21cc7da4ee1a009489c428c51e45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for portus_ai-0.0.4.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4efda0e93b92bf3ee237ad2411598b2787626814a59bd502d5fa392a026672b
MD5 75d105d80b576e0b188a05d3edf9601c
BLAKE2b-256 b0f0efbcb9526087ea059bf52c2cf3b2db5722bfb0ae0c5c38870e96595d5e4e

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