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>
Metadata
Release files for gseai 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gseai-1.5.0.tar.gz | 35.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gseai-1.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.2 kB
Release files / gseai-1.5.0.tar.gz
| Download URL | gseai-1.5.0.tar.gz |
|---|---|
| Size | 35.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7133b9a09ba9920fecedfd4b4ebff05234137edc0bcaa876da28af75cef7d7f4
|
|
BLAKE2b-256 checksum How to use checksums |
ff08e881ff077271d03cc897afe95337f5a2faf0f69007bc369de9b9fb032c42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / gseai-1.5.0-py3-none-any.whl
| Download URL | gseai-1.5.0-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb9151a543295fb9732002b974306fb559c19c7a5d88e203ae32facab5cd7aa3
|
|
BLAKE2b-256 checksum How to use checksums |
1577da92b4d21f59b2a4ea45dff97521e3285645565cdeb3a7208e7b9d4e267f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|