Skip to main content

Package for Inferencing AI at DSC

Project description

AIDSC: Lightweight Classroom Inference Client

aidsc is a Python client designed for students and researchers to perform LLM inference on classroom clusters. It acts as a gateway to the Zeus control plane, allowing you to run models on high-performance classroom hardware from your local machine.

🚀 Key Features

  • Classroom-Ready: Built specifically for inferencing classroom machines running LLMs.
  • Seamless Remote Access: Automatic SSH tunneling via PAMD to bridge the gap to internal networks.
  • Smart Connectivity: Checks for existing local tunnels before prompting for credentials.
  • Persistent Credentials: Optional encrypted-style saving to .env (git-ignored automatically).
  • Lightweight & Typed: Pydantic-validated payloads ensuring your requests always match the Zeus API.

🌐 Connectivity Logic

The client automatically resolves connectivity in this order:

  1. Local Check: Checks localhost:32553. If healthy, it proceeds immediately.
  2. Environment/Dotenv: Looks for PAMD_USER and PAMD_PASS in your system or .env file.
  3. Interactive Setup: If credentials are missing or the port is closed, it clears the console and guides you through establishing an SSH tunnel.
  4. Background Persistence: After establishing a tunnel, it asks if you'd like to keep it running in the background after your script exits.

🛠️ Usage Reference

1. Initialization

from aidsc import aidsc

client = aidsc(
    local_base_url="http://127.0.0.1:32553", # Override local Zeus URL
    infer_timeout=600.0,                      # Global timeout for inference calls (seconds)
    dotenv_path=".env"                       # Custom path to .env file
)

# Ensure connectivity (checks local port, prompts for SSH if needed)
client.ensure_ready()

2. Request Parameters

The LanguageInferenceRequest object allows fine-grained control over the job:

from aidsc import LanguageArgs, LanguageInferenceRequest

req = LanguageInferenceRequest(
    args=LanguageArgs(
        model="gpt-oss-20b",           # The target model name
        questions=["Recipe for rice?"], # List of prompts/questions
    ),
    max_new_tokens=512,                # Tokens to generate per response
    max_context_length=8192,           # Context window (alias: max_model_len)
    max_server_uptime=604800,          # How long the server can stay alive (seconds)
    total_concurrent_models=1,         # Instances of the model to run
    max_num_seqs=8                     # Max sequences for batching
)

3. Inference & Overrides

You can override specific parameters during the infer() call:

response = client.infer(
    req,
    server=117,             # Target a specific machine ID (e.g., 117)
    max_new_tokens=1024,    # Override the request's max_new_tokens
    client_timeout=300      # Specific timeout for this request
)

⚙️ Configuration Reference

Environment Variables

These can be set in your OS or in a .env file in your project root.

Variable Default Description
PAMD_USER - Your FSU/PAMD username (e.g., abc20z).
PAMD_PASS - Your PAMD password (used for sshpass).
aidsc_ZEUS_LOCAL_URL http://127.0.0.1:32553 The local port where the tunnel maps.
aidsc_ZEUS_REMOTE_URL http://144.174.11.196:32553 Internal IP of the Zeus orchestration server.

Client Settings (aidsc())

Parameter Type Description
local_base_url str URL to reach Zeus (default: aidsc_ZEUS_LOCAL_URL).
infer_timeout float Max time to wait for an inference result (default: 600.0).
dotenv_path str Custom path to load .env from.

Request Settings (LanguageInferenceRequest)

Field Default Description
max_new_tokens 512 Max tokens generated for each question.
max_context_length 8192 Total tokens (prompt + completion) allowed.
max_server_uptime 604800 Kill server after this many seconds of idle.
total_concurrent_models 1 Number of engine instances to spin up.
max_num_seqs 8 Maximum number of concurrent sequences.

🏗️ Project Architecture

  • client.py: The high-level API. Handles the "Automatic SSH" logic, process detachment, and console UI.
  • models.py: Pydantic definitions for all request types.
  • connectivity.py: Low-level logic for checking local port health.
  • zeus_client.py: The underlying HTTP client for the Zeus REST API.

🔒 Security Note

The client uses sshpass to handle password-based SSH connections to the PAMD jump host. Your .env file is automatically added to .gitignore when you run setup_interactive() to prevent accidental exposure of your credentials.

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

aidsc-0.1.5.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

aidsc-0.1.5-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file aidsc-0.1.5.tar.gz.

File metadata

  • Download URL: aidsc-0.1.5.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22","id":"wilma","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for aidsc-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ffe496032c7a75f1d11cf4f363841cb6260ceb3abc0d59fe4ba0e97ca1d95f91
MD5 4ba2db6750be6a563263853ed6bf86b0
BLAKE2b-256 088cff06635c73073ee6b0a90001a2d7b3956d051621c401b5215d313714a7fd

See more details on using hashes here.

File details

Details for the file aidsc-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: aidsc-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22","id":"wilma","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for aidsc-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e110f3d27218db1264a893f0f6c808b9e4fd674bdeedc4e383605edd9da48301
MD5 5c11b8a1dc6d4371f6796b2f43e237d2
BLAKE2b-256 c383d8d96e8e82f38cd012568e3deaafa9cd51061780d859d541669779c83083

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