Skip to main content

GigaChat integration

Configure and verify the CodeGraph GigaChat provider without freezing vendor catalogs. See the examples and checks before applying it.

Integrations

Use GigaChat as the configured CodeGraph LLM provider when the customer’s data-handling policy allows prompts to leave the CodeGraph boundary for Sber infrastructure. This page covers stable CodeGraph behavior. Model names, quotas, prices, and regional availability change independently and must be checked in the provider portal before a pilot.

What CodeGraph sends

GigaChatProvider.generate() and streaming calls send both system_prompt and user_prompt, plus generation parameters, to the configured provider endpoint. Embedding calls send the supplied text. Remote provider processing remains outside the local-processing boundary.

Classify and redact data before it reaches this provider. The system-wide controls are described in LLM security.

Configure credentials

Keep credentials outside the repository. The current CLI recognizes GIGACHAT_AUTH_KEY; the provider also accepts GIGACHAT_CREDENTIALS through configuration resolution.

$env:GIGACHAT_AUTH_KEY = '<secret-from-approved-store>'

Reference the environment value from config.yaml:

llm:
  provider: gigachat
  gigachat:
    credentials: ${GIGACHAT_AUTH_KEY}
    model: <approved-model-name>
    scope: GIGACHAT_API_PERS
    verify_ssl_certs: true
    ca_bundle_file: ''
    timeout: 60

verify_ssl_certs defaults to true. When a corporate TLS proxy requires a private CA, set ca_bundle_file to the approved bundle instead of disabling verification. Do not commit the resolved credential or a secret-bearing .env file.

Select a model and scope

The runtime validates the configured model against the catalog embedded in src/llm/gigachat_provider.py. Treat that catalog as a compatibility check for the installed CodeGraph revision. Confirm the selected model, access, scope, context limits, quota, and cost with the current provider account.

Avoid copying a model table into operational documentation: it becomes stale without changing CodeGraph. Change one model or scope at a time and keep a rollback value approved for the pilot.

Verify the integration

python -m src.cli llm providers
python -m src.cli llm test --provider gigachat --format json

The llm test command currently proves configuration resolution and client construction. Complete a non-sensitive model-inference workflow, then verify the returned model metadata, latency, error handling, and provider-side audit record before accepting the integration.

Failure handling

  • Credential or scope errors: verify the approved account and rotate the secret; do not log it.
  • TLS errors: validate the endpoint and CA chain; keep verify_ssl_certs enabled.
  • Rate limits: reduce concurrency or request a quota; retries do not create additional authority.
  • Unknown model: choose a model supported by both the installed source and the provider account.
  • Timeout: check network policy and request size before increasing timeout.

On rollback, restore the previous provider/model configuration and rerun both the construction check and a bounded end-to-end workflow.

Source of truth

  • Provider implementation: src/llm/gigachat_provider.py
  • Provider factory: src/llm/factory.py
  • CLI check: src/cli/domain_suite/llm_commands.py
  • Configuration: Configuration