gseai

A Python client for the GSE AI LMStudio server.

The GSEAIServer class wraps LMStudio’s REST API v1, covering the native /api/v1/ endpoints, the OpenAI-compatible /v1/ endpoints, and the Anthropic-compatible /v1/messages endpoint.

Installation

uv add gseai

Quick start

from gseai import GSEAIServer

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

    # Chat using the native API
    response = server.chat("model-id", "What is machine learning?")

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

Indices