Skip to main content

GSE AI Server API

This package provides an API for connecting to UB GSE's AI server (powered by LocalAI). See the Computational Literacies Lab handbook page for details about the server.

The documentation provides details on using the API.

Quickstart

from gseai import GSEAIServer

with GSEAIServer("your-api-token") as server:
    # List available models
    models = server.list_models()

    # Simple single-turn chat
    response = server.chat("model-id", "What is machine learning?")

    # Multi-turn chat using the OpenAI-compatible API
    response = server.chat_completions(
        "model-id",
        messages=[{"role": "user", "content": "What is machine learning?"}],
    )

Job queue

Large models can take longer than the server's HTTP timeout to respond. The job queue lets you submit a request and collect the result later — no need to keep a connection open.

from gseai import GSEAIServer

with GSEAIServer("your-api-token") as server:
    # Submit a job and get an ID immediately
    job = server.submit_job("my-job", "qwen2.5-coder", "Explain transformers.")
    job_id = job["job_id"]

    # Come back later and wait for it
    result = server.wait_for_job(job_id)
    print(result["result"])

    # File-in jobs (transcribe, image_edit, etc.)
    job = server.submit_file_job("transcribe-lecture", "transcribe", "whisper-1", "lecture.mp3")

    # Binary-out jobs (speech, images) — fetch the file when done
    audio = server.get_job_result(job_id)
    open("output.mp3", "wb").write(audio)

The CLI supports the same workflow:

# Submit and walk away
gseai queue submit qwen2.5-coder "Explain transformers." -n my-job
# a3f1c7d2-...

# Check status, then fetch result when done
gseai queue status a3f1c7d2-...
gseai queue wait a3f1c7d2-...

# Or submit and wait in one step
gseai queue run qwen2.5-coder "Explain transformers." -n my-job

# File-in jobs
gseai queue upload whisper-1 lecture.mp3 --job-type transcribe -n lecture
gseai queue wait <job-id>

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gseai-1.5.0.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

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

gseai-1.5.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file gseai-1.5.0.tar.gz.

File metadata

  • Download URL: gseai-1.5.0.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gseai-1.5.0.tar.gz
Algorithm Hash digest
SHA256 7133b9a09ba9920fecedfd4b4ebff05234137edc0bcaa876da28af75cef7d7f4
MD5 75e8de2e1f5faf251afd22cb49a30e99
BLAKE2b-256 ff08e881ff077271d03cc897afe95337f5a2faf0f69007bc369de9b9fb032c42

See more details on using hashes here.

File details

Details for the file gseai-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: gseai-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gseai-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb9151a543295fb9732002b974306fb559c19c7a5d88e203ae32facab5cd7aa3
MD5 bf244a55dafd37453af53b873690ed8c
BLAKE2b-256 1577da92b4d21f59b2a4ea45dff97521e3285645565cdeb3a7208e7b9d4e267f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.0.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page