Install & Compatibility
Where this runs
tested against v0.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.900s · 32.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.9s · import 0.822s · 32MB
31MB installed
● package 31MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
GigaChat
✓ from gigachat import GigaChat
Main client class for API interactions.
Messages
✓ from gigachat.models import Messages
✗ from gigachat import Messages
Messages is a model class, not top-level.
ChatCompletion
✓ from gigachat.models import ChatCompletion
✗ from gigachat import ChatCompletion
ChatCompletion is a model, not directly in gigachat namespace.
Initialize GigaChat client with token, send a chat message, and print the response.
from gigachat import GigaChat
import os
# Use environment variable for token (replace with your actual token)
token = os.environ.get('GIGACHAT_TOKEN', '')
with GigaChat(credentials=token, verify_ssl_certs=False) as giga:
response = giga.chat("Hello, how are you?")
print(response.choices[0].message.content)
Errors
Common errors & fixes
ImportError: cannot import name 'GigaChat' from 'gigachat'
Older versions (pre 0.1.30) used a different import path.
fixUpgrade gigachat: pip install --upgrade gigachat
gigachat.exceptions.AuthenticationError: ...
Invalid or missing credentials token.
fixEnsure you provide a valid token as the 'credentials' parameter or set the GIGACHAT_TOKEN environment variable.
AttributeError: 'Messages' object has no attribute 'dict'
Pydantic V2 removed .dict() for models; use .model_dump() instead.
fixReplace .dict() with .model_dump() for Pydantic models.
Upgrade
Version history
0.2.1latest on PyPI · released Apr 27, 2026
Audit
Dependencies
httpxrequiredHTTP client for API calls
pydanticrequiredData validation and serialization