Skip to content

feat: add support of gpt2giga#1635

Open
doppoluv wants to merge 3 commits into
k8sgpt-ai:mainfrom
doppoluv:feat/gpt2giga
Open

feat: add support of gpt2giga#1635
doppoluv wants to merge 3 commits into
k8sgpt-ai:mainfrom
doppoluv:feat/gpt2giga

Conversation

@doppoluv

Copy link
Copy Markdown
Contributor

📑 Description

Added support for the GPT2Giga proxy provider to integrate with the GigaChat API via OpenAI/Anthropic-compatible interfaces. Key changes include:

  1. Created gpt2giga.go with the client implementation:
    • Acts as a proxy to forward requests to the GigaChat API using OpenAI format
    • Configure() method supports setting proxy endpoints and model parameters
    • GetCompletion() sends requests to the proxy endpoint and processes responses
  2. Added the Gpt2GigaClient to the list of available providers in iai.go
  3. Updated backend and passwordless provider lists

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@doppoluv doppoluv requested review from a team as code owners April 14, 2026 13:40
@github-project-automation github-project-automation Bot moved this to Proposed in Backlog Apr 14, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 14, 2026

Copy link
Copy Markdown

CLA Missing ID CLA Not Signed

@doppoluv doppoluv force-pushed the feat/gpt2giga branch 4 times, most recently from 7e63788 to 639f4f1 Compare April 14, 2026 15:39
Signed-off-by: Semyon Inokov <semen.inokov@gmail.com>
@AlexsJones

Copy link
Copy Markdown
Member

It would be cleaner to reuse the existing OpenAIClient with a custom base URL instead of adding a new gpt2giga provider, as it avoids duplicated logic and maintenance overhead. If a distinct client is required, consider fixing the variable shadowing, adding tests, and updating docs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New provider support. The OpenAI-compatible proxy pattern is well-implemented.

Notes:

  1. Default baseURL is localhost:8090 — consider documenting this as a proxy endpoint that users need to set up themselves.
  2. No error handling for non-200 response bodies (just returns status code). Consider including the response body in the error for debugging.
  3. No support for system messages or conversation history (single-turn only). Document this limitation.

LGTM for a new provider.

@codecov

codecov Bot commented Apr 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.25%. Comparing base (173e4dc) to head (72c126b).
⚠️ Report is 253 commits behind head on main.

Files with missing lines Patch % Lines
pkg/ai/gpt2giga.go 0.00% 50 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1635      +/-   ##
==========================================
+ Coverage   34.76%   43.25%   +8.48%     
==========================================
  Files          94      120      +26     
  Lines        6342     7431    +1089     
==========================================
+ Hits         2205     3214    +1009     
+ Misses       4046     4005      -41     
- Partials       91      212     +121     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AlexsJones

Copy link
Copy Markdown
Member

Hi @doppoluv — steward check-in here. Alex left design feedback back in April that's still open:

It would be cleaner to reuse the existing OpenAIClient with a custom base URL instead of adding a new gpt2giga provider… If a distinct client is required, consider fixing the variable shadowing, adding tests, and updating docs.

Since then the branch has only picked up merges from main — nothing addressing that feedback — so it's stalled. Two ways forward:

  1. Preferred (Alex's suggestion): drop the dedicated Gpt2GigaClient and just point the existing openai backend at the proxy (--baseurl http://localhost:8090). gpt2giga already exposes the OpenAI /chat/completions shape your client targets, so this avoids a duplicated backend and its maintenance.
  2. Keep the dedicated client, but then please: (a) rename the url := fmt.Sprintf(...) local in GetCompletion — it shadows the imported net/url package (a likely golangci-lint trigger, which is currently red); (b) add a unit test — the other backends in pkg/ai use an httptest.Server to cover the happy path plus the non-200 and empty-choices error branches — so codecov/patch goes green; and (c) add a short docs note for the new backend.

Separately, EasyCLA is still unsigned, which is a hard merge blocker regardless of the approach above — the sign link is in the failing check.

Happy to re-review as soon as you've picked a direction and CI is green. If we don't hear back, we'll likely close this as stale in a couple of weeks — just drop a note to keep it open.

🤝 Handled by Alex's Repo Steward — replies reviewed by @AlexsJones.

Learn more or run your own: https://github.com/AlexsJones/repo-steward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Proposed

Development

Successfully merging this pull request may close these issues.

3 participants