Python SDK¶
gqi-labs is the dependency-free distribution for the hosted API. It installs
the gqi Python module and contains only HTTP transport and public wire types;
model weights, training, serving, and cloud implementation are not distributed.
Interface¶
from gqi import GQI
client = GQI(api_key="gqi_sk_...")
fitted = client.fit(
task_name="ticket-priority",
X=[
"checkout fails", "minor copy edit", "refund is stuck", "email delayed",
"production is down", "feature request", "wrong invoice", "broken link",
],
y=[10, 1, 7, 4, 10, 2, 5, 2],
)
result = client.predict(
model=fitted.model,
X=["payments fail for every customer"],
)
print(result.rows[0].prediction, result.rows[0].iqr)
Use client.predict(model="GQI", X=X_new) for an intentional zero-shot call.
Prediction does not silently choose the base when model is omitted. LoRA is
the default fit method; config={"method": "full"} returns an immutable
dedicated-model handle.
fit() and predict() block until their jobs finish. Long-running callers
can use submit_fit(), submit_predict(), job(), wait(), and
cancel().
- Every finite target is retained.
- A fitted
ModelHandle, or explicit"GQI"for zero-shot, is required by prediction. FitConfigandPredictConfigvalidate configuration before submission.- Model and engine implementation details remain server-side.
Set GQI_API_KEY to omit api_key from the constructor. See the
REST API reference for the underlying wire contract and hosted limits.