Repository navigation
Releases: BrianCLowe/xAIkit
Releases · BrianCLowe/xAIkit
Release list
v0.4.1
Added
AsyncXaiClientfetches a non-default host model list withhttpx.AsyncClientinside awaited calls, so the event loop is not blocked. The fetch timeout is the resolved SDK timeout capped at 30 seconds. SyncXaiClientis unchanged. A failed list still warns once and uses the static catalog. (XK-AHC-1, XK-AHC-2, XK-AHC-3)
Fixed
- Direct catalog calls with no timeout honor
XAI_SDK_TIMEOUT_SECONDS, otherwise 180. A failed fetch stores its persist, fixture, or bootstrap fallback on that timeout, including the 60 second deadline window, and a newer fallback replaces the previous one. One latest live snapshot is shared across timeouts. A successful live load clears every per-timeout fallback. Caller inject and an explicit fixture or persist load still replace the shared snapshot. (XK-CTF-1, XK-CTF-2, XK-CTF-3) - Non-default host model lists keep
created(Unix seconds) andowned_byfromGET /v1/models. Image best and economy on that host use those created times. A missing or non-integercreatedstays unset, payload prices are ignored, and the default host is unchanged. (XK-HCC-1, XK-HCC-2, XK-HCC-3)
v0.4.0
Added
XaiClientandAsyncXaiClienttake keyword-onlytimeout(seconds).XAI_SDK_TIMEOUT_SECONDSis the fallback, then 180. Every xai-sdk client gets that timeout. A gRPC deadline raisesXaiTimeoutError. Callers with long streams should raise timeout= on the client. (XK-TO-1, XK-TO-2, XK-TO-3)
Fixed
list_modelscheckssdk_timeoutbefore the fetch. A bad value raisesValueErrorand does not cache. A deadline (XaiTimeoutErroror gRPCDEADLINE_EXCEEDED) uses the same persist, fixture, and bootstrap fallbacks as any other SDK failure, cached for 60 seconds (CATALOG_TIMEOUT_RETRY_SECONDS) instead of the full TTL. If every SDK list fails and any error is a deadline, that deadline is the one raised.
v0.3.1
Added
XaiClientandAsyncXaiClienttakebase_url, withXAI_BASE_URLas a fallback andhttps://api.x.ai/v1as the default. REST calls and the stt, tts, and realtime websockets use that base. Chat on an empty path or/v1stays on gRPC; any other path uses REST/chat/completions. Invalid URLs raiseValueErrorwithout echoing credentials. Collections, batch, OAuth connect, and the usage meter price fetch do not followbase_url. (#93)- Non-default
base_urlhosts restrict best and economy to that host'sGET /v1/modelslist (fetched once per client, roles from the static catalog). An unpinned role with no listed model raisesRoleUnavailableOnHostbefore the request. A failed model list warns and uses the static catalog, still on the configured host. The default host is unchanged. (#94) - The usage meter applies the documented 10% US endpoint token premium on
us.api.x.aito input, cached input, output, and image input tokens. The rate is one hardcoded host table. Servercost_in_usd_ticksstay unchanged. Other hosts and per-unit fees stay at the base price. (#95)
v0.3.0
Best-model picks change in this release. If you rely on best or economy model selection, review the ranking notes below.
Changed
- Best-model ranking: snapshot-dated ids now rank behind the plain id and
-latestalias for bothbestandeconomy. Undottedgrok-4andgrok-5date suffixes are no longer parsed as a minor version. (#90) - Best-model ranking:
-litemodels rank last forbestin every role unless a lite model is the only option. The extend, edit, and r2v extras are offered only on the unversionedgrok-imagine-video. (#91) - Best-model ranking: stable models rank ahead of preview models for
best(XK-AC-RANK-4..6). (#89) - Best-model ranking: plain Imagine Video 1.5 ranks above its snapshots, and transcribe ids are kept off voice. (#87)
Fixed
- Imagine image generation returns every image when
nis greater than 1, and usage metering counts the images actually returned. (#88)
Dependencies
- Bump multidict from 6.7.1 to 6.9.1. (#86)