Skip to content

fix(vllm): remove requirement for api key for vllm - #2380

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/vllm
Dec 15, 2025
Merged

fix(vllm): remove requirement for api key for vllm#2380
waleedlatif1 merged 1 commit into
stagingfrom
fix/vllm

Conversation

@waleedlatif1

@waleedlatif1waleedlatif1 commented Dec 15, 2025

Copy link
Copy Markdown
Collaborator

Summary

  • remove requirement for api key for vllm

Fixes#2378

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Dec 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
docsSkippedSkippedDec 15, 2025 6:44pm

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR makes the vLLM API key optional, similar to how Ollama works, enabling self-hosted vLLM instances without authentication to be used out of the box.

  • Made vLLM API key optional in getApiKey() - returns user-provided key if available, otherwise 'empty' placeholder
  • Updated vLLM provider initialization and API routes to conditionally add Authorization header only when VLLM_API_KEY is set
  • Added comprehensive tests for the new vLLM behavior
  • Minor cleanup: removed explanatory comment in Ollama route and converted tests to use it.concurrent

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - straightforward feature addition with good test coverage.
  • The changes are well-scoped, follow existing patterns (consistent with Ollama implementation), and include appropriate tests. The conditional authentication logic is applied consistently across all vLLM-related code paths.
  • No files require special attention.

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/providers/utils.ts5/5Added vLLM provider to the API key exemption list, returning user-provided key or 'empty' placeholder - consistent with existing Ollama pattern but allowing optional authentication.
apps/sim/providers/vllm/index.ts5/5Modified initialize() to conditionally add Authorization header only when VLLM_API_KEY env var is set - allows unauthenticated vLLM access.
apps/sim/app/api/providers/vllm/models/route.ts5/5Same conditional Authorization header pattern applied to the API route for fetching vLLM models - consistent with provider initialization changes.
apps/sim/app/api/providers/ollama/models/route.ts5/5Minor cleanup - removed explanatory comment from error handler.
apps/sim/providers/utils.test.ts5/5Added tests for vLLM API key handling and converted tests to use it.concurrent for parallel execution.

Sequence Diagram

sequenceDiagram
participant User
participant API as API Route
participant Utils as getApiKey()
participant vLLM as vLLM Server
User->>API: Request with model
API->>Utils: getApiKey('vllm', model, userKey?)
alt User provided key
Utils-->>API: Return userKey
else No key provided
Utils-->>API: Return 'empty'
end
API->>API: Build headers
alt VLLM_API_KEY env set
API->>API: Add Authorization header
end
API->>vLLM: Fetch /v1/models
vLLM-->>API: Return models
API-->>User: Return response
Loading

@greptile-appsgreptile-appsBot 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.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
waleedlatif1 merged commit 6009a73 into stagingDec 15, 2025
10 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/vllm branch December 15, 2025 18:48
Sign up for freeto 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.

1 participant

@waleedlatif1