Skip to content

Add support for service account when using litellm#295

Merged
luis5tb merged 4 commits into
RHEcosystemAppEng:mainfrom
luis5tb:worktree-litellm-sa
Jun 23, 2026
Merged

Add support for service account when using litellm#295
luis5tb merged 4 commits into
RHEcosystemAppEng:mainfrom
luis5tb:worktree-litellm-sa

Conversation

@luis5tb

@luis5tb luis5tb commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@luis5tb luis5tb force-pushed the worktree-litellm-sa branch 2 times, most recently from 5033377 to 0d11a7a Compare June 12, 2026 08:19
@luis5tb luis5tb changed the title [WIP] Add support for service account when using litellm Add support for service account when using litellm Jun 12, 2026
@luis5tb luis5tb force-pushed the worktree-litellm-sa branch 2 times, most recently from 85492da to 6c469a1 Compare June 22, 2026 14:55
r2dedios
r2dedios previously approved these changes Jun 23, 2026

@r2dedios r2dedios left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM! 🚀

Comment thread src/lightspeed_agent/core/agent.py
Comment thread deploy/openshift/templates/handler-deployment.yaml
@IlonaShishov

Copy link
Copy Markdown
Collaborator

Maybe good to add a short description to PR

@IlonaShishov IlonaShishov left a comment

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.

LGTM

luis5tb and others added 4 commits June 23, 2026 12:30
Allow using a service account credentials JSON file (GOOGLE_APPLICATION_CREDENTIALS)
as a secure alternative to GOOGLE_API_KEY when accessing Vertex AI models, both
via direct Gemini and LiteLLM with vertex_ai/* providers.

- Add google_application_credentials setting to config
- Set GOOGLE_APPLICATION_CREDENTIALS env var in _setup_environment()
- Mount GCP SA key in agent deployment (conditional on gcpServiceAccountKey)
- Make gcp-sa-secret conditional on key presence (not handler-only)
- Fix handler deployment to also be conditional on key presence
- Default cloudLocation to global (aligns with Python settings default)
- Update docs, .env.example, secrets.yaml.example, and OpenShift README

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The marketplace handler on OpenShift is a standalone service that does
not need GCP service account credentials, Gemini API keys, or access
to the Google Commerce Procurement API. Remove GOOGLE_APPLICATION_CREDENTIALS,
GOOGLE_API_KEY, GOOGLE_CLOUD_PROJECT, and the gcp-sa-key volume mount
from the handler deployment template.

Also add gcp-sa-secret checksum to the agent deployment and clean up
GOOGLE_APPLICATION_CREDENTIALS in tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a file existence check when GOOGLE_APPLICATION_CREDENTIALS is
configured. The agent now warns at startup if the specified
credentials file path does not exist, making credential
misconfiguration easier to diagnose.

Changes:
- Add pathlib-based file existence check in _setup_environment()
- Log warning when credentials file path is invalid
- Update test to use tmp_path fixture with actual file
- Add new test for missing credentials file warning

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Restore GOOGLE_CLOUD_PROJECT environment variable to the handler
deployment template, sourced from the existing secret with
optional: true. This was previously removed but is being added back
to keep the handler ready for future Marketplace Procurement API
integration if needed.

This is a no-op on OpenShift since no Pub/Sub events arrive to
trigger the code paths that use this variable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@luis5tb luis5tb force-pushed the worktree-litellm-sa branch from e844e7a to c07203b Compare June 23, 2026 10:30
@luis5tb luis5tb merged commit de58ecc into RHEcosystemAppEng:main Jun 23, 2026
14 checks passed
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.

3 participants