Skip to content

add an option to not set the api key - #389

Merged
EItanya merged 5 commits into
mainfrom
peterj/fix388
May 15, 2025
Merged

EItanya merged 5 commits into
mainfrom
peterj/fix388

Conversation

@peterj

@peterj peterj commented May 15, 2025

Copy link
Copy Markdown
Collaborator

Fix on the UI side:

  • I added a check box, so when check the api key isn't required (no errors/warnings)

Controller:

  • when trying to retrieve the API key from the modelconfig we don't check for the Secret if the APIsecret ref is empty AND the BaseURL is set; otherwise we retrieve the secret (and fail if both apisecretref and baseurl are emptY).

@peterj
peterj requested review from EItanya and ilackarms as code owners May 15, 2025 00:37
Signed-off-by: Peter Jausovec <[email protected]>

@sbx0r sbx0r left a comment

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.

Looks like a preparation for kgateway 😃 🚀

@EItanya EItanya left a comment

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.

I like these changes overall, I don't love a specific field in the REST API called IsGateway. Can we be more generic, or infer from the hostname?

Signed-off-by: Peter Jausovec <[email protected]>
Comment thread ui/src/app/models/new/page.tsx Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wait so for this, it seems we are just deciding that if there is no key, then we must be using a gateway? That won't work tho. Because we may use a key with or without a gateway. I don't think we should just try to infer anything with this PR. We should be very explicit with an option that "ApiKeyRequired" which defaults to true, but can be overridden. Maybe for Ollama it can default to false.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I can change the UI option to say something like "I don't need an API key" or something like that, so it's not specific to the gateway.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sounds good

Signed-off-by: Peter Jausovec <[email protected]>
@EItanya
EItanya merged commit 119e0e8 into main May 15, 2025
@EItanya
EItanya deleted the peterj/fix388 branch May 15, 2025 23:27
peterj added a commit that referenced this pull request May 16, 2025
…to persistent-sessions

* 'persistent-sessions' of github.com:kagent-dev/kagent:
  Docker - improve slow CI multi arch build (#398)
  added bug_report and version
  invoke with/without session works properly
  eitanya/fix-name-template (#399)
  add non-interactive CLI commands
  add an option to not set the api key (#389)
Raghavendiran-2002 pushed a commit to Raghavendiran-2002/kagent that referenced this pull request Apr 30, 2026
* add an option to not set the api key

Signed-off-by: Peter Jausovec <[email protected]>

* ui fix

Signed-off-by: Peter Jausovec <[email protected]>

* pr feedback

Signed-off-by: Peter Jausovec <[email protected]>

* change the text

Signed-off-by: Peter Jausovec <[email protected]>

---------

Signed-off-by: Peter Jausovec <[email protected]>
Co-authored-by: Eitan Yarmush <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants