Registry / llm-agents / gigachat

gigachat

JSON →
library0.2.1pypypi✓ verified 86d ago

Python library for GigaChat API by Sberbank. Current version 0.2.1, supports chat completions, embeddings, function calling, structured output (JSON schema), and streaming. Released regularly with minor updates.

pip install gigachat
INSTALL
IMPORT
SIG · GIGACHAT
G
gigachat
llm-agentspythonv0.2.1
Install
3.9s avg
Import
861ms
Disk
31MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.900s · 32.7MB
glibc
py 3.103.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)
Debug
Known issues
breakingIn v0.2.0, the synchronous client no longer uses 'requests' library; it uses 'httpx'. Code that relied on requests internals may break.
fix
Update to use httpx-based patterns. The client API remains the same.
affects: >=0.2.0
breakingIn v0.2.0, Pydantic V2 is used instead of V1. Models like Messages, ChatCompletion have changed their internal schema. Serialization with .dict() now returns a dict, not a Model instance.
fix
If you use .dict() or .json() on models, ensure compatibility with Pydantic V2. Use .model_dump() instead of .dict() if needed.
affects: >=0.2.0
deprecatedThe 'user' parameter in GigaChat().chat() is deprecated in favor of passing user_id in the message dict.
fix
Use message format: {'role': 'user', 'content': '...', 'user_id': '...'}
affects: >=0.1.40
gotchaThe client defaults to verify_ssl_certs=False. For production, set verify_ssl_certs=True to avoid security warnings.
fix
Instantiate with GigaChat(credentials=..., verify_ssl_certs=True)
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'GigaChat' from 'gigachat'
Older versions (pre 0.1.30) used a different import path.
fix
Upgrade gigachat: pip install --upgrade gigachat
gigachat.exceptions.AuthenticationError: ...
Invalid or missing credentials token.
fix
Ensure 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.
fix
Replace .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
Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
gigachat — pip install gigachat · libregistry