gseai
A Python client and command-line tool for the GSE AI LocalAI server.
The GSEAIServer class wraps LocalAI’s OpenAI-compatible /v1/
endpoints and the Anthropic-compatible /v1/messages endpoint. The gseai
CLI exposes the same functionality without writing any Python.
Installation
To add gseai as a dependency of a Python project:
uv add gseai
To install the gseai CLI as a system-wide tool:
uv tool install gseai
Quick start — Python
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?"}],
)
Quick start — CLI
export GSEAI_API_TOKEN=your-api-token
gseai models
gseai chat gemma-4-e2b-it "What is machine learning?"
gseai audio transcribe whisper-1 lecture.mp3
gseai images generate stable-diffusion "a red barn in a snowy field"
Queue jobs
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 open connection required. See Queue jobs for the full guide.
from gseai import GSEAIServer
with GSEAIServer("your-api-token") as server:
# Submit and walk away
job = server.submit_job("my-job", "qwen2.5-coder", "Explain transformers.")
# Come back later
result = server.wait_for_job(job["job_id"])
print(result["result"])
gseai queue submit qwen2.5-coder "Explain transformers." -n my-job
# a3f1c7d2-...
# Come back later
gseai queue wait a3f1c7d2-...
Contents: