This repository was archived by the owner on May 30, 2026. It is now read-only.
feat(provider): add GigaChat via the gigachat library - #62
Open
Rai220 wants to merge 1 commit into
Open
Conversation
Add GigaChat as a first-class LLM provider (model prefix `gigachat::`),
routed through the official `gigachat` library instead of the OpenAI SDK
(GigaChat is not OpenAI-compatible: OAuth, `function` role, single
`function_call`).
- llm.py: gigachat routing + dedicated _chat_gigachat path with converters
(OpenAI tools<->GigaChat functions, tool_calls<->function_call). Handles
two GigaChat quirks: function results must be valid JSON (plain text is
wrapped as {"result": ...}) and the system message must be first (later
system-reminders are demoted to user).
- Auth via GIGACHAT_CREDENTIALS (OAuth key) or GIGACHAT_USER/GIGACHAT_PASSWORD
(basic auth); GIGACHAT_SCOPE/BASE_URL/VERIFY_SSL_CERTS/PROFANITY_CHECK are
all env-configurable. Default model gigachat::GigaChat-3-Ultra.
- Wired into config, pricing, safety, server_runtime, model_catalog_api,
agent_task_pipeline, launcher_bootstrap, plugin_api, server.py.
- Settings UI card (settings_ui.js/settings.js) + provider icon.
- gigachat>=0.2.1 dependency; tests (conversion unit tests + provider wiring)
and docs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds GigaChat as a first-class LLM provider (model prefix
gigachat::), routed through the officialgigachatlibrary rather than the OpenAI SDK — GigaChat is not OpenAI-compatible (OAuth,functionrole instead oftool, a singlefunction_callinstead of atool_callsarray).Default model:
gigachat::GigaChat-3-Ultra. Everything is env/Settings-configurable.What's included
ouroboros/llm.py—gigachat::routing + a dedicated_chat_gigachatpath (mirrors the existing_chat_anthropic) with native function-calling:tools→ GigaChatfunctions;function_call: "auto"/"none"; nativefunction_callresponse parsed back into OpenAItool_calls.{"result": ...}), and thesystemmessage must be first (later system-reminders are demoted touser).GIGACHAT_CREDENTIALS(authorization key, OAuth) orGIGACHAT_USER/GIGACHAT_PASSWORD(basic auth).GIGACHAT_SCOPE/GIGACHAT_BASE_URL/GIGACHAT_VERIFY_SSL_CERTS/GIGACHAT_PROFANITY_CHECKare all configurable.config.py,pricing.py,safety.py,server_runtime.py,model_catalog_api.py(lists models via the library's native async client),agent_task_pipeline.py,launcher_bootstrap.py,contracts/plugin_api.py,server.py(secret redaction + restart keys),provider_models.py.settings_ui.js/settings.js) + provider icon.gigachat>=0.2.1(lazy-imported).tests/test_gigachat_conversion.py(converters: tool↔function, tool_calls↔function_call, JSON-result wrapping, system-demotion, response normalization) + provider-wiring updates across 8 test files.Verification
get_weather), and a full agent task (read a file via tool → summarize) all succeed onGigaChat-3-Ultra. The model catalog lists realgigachat::models.Notes / known limitations
function_callper turn; parallel OpenAItool_callsare collapsed to the first.few_shot_examples,return_parameters,function_ranker, forced-specific-function,functions_state_idthreading.🤖 Generated with Claude Code