Skip to content

fix(vllm): support LM Studio endpoints - #7036

Merged
waleedlatif1 merged 3 commits into
stagingfrom
codex/fix-lm-studio-vllm-routing
Aug 24, 2026
Merged

fix(vllm): support LM Studio endpoints#7036
waleedlatif1 merged 3 commits into
stagingfrom
codex/fix-lm-studio-vllm-routing

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • pass local provider environment variables into the Ollama Compose app service
  • accept both server-root and versioned OpenAI-compatible URLs for vLLM and LM Studio
  • use the shared Chat Completions token-limit parameter and document the supported setup

Type of Change

  • Bug fix

Testing

  • 24 focused provider and model-discovery tests
  • repository lint and type-check
  • 33 CI audits and block-registry validation
  • Docker Compose configuration validation

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

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 24, 2026 5:20pm

Request Review

@cursor

cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are localized to the vLLM/OpenAI-compat provider path and self-host docs; token parameter rename may affect vLLM servers that only accepted max_completion_tokens, though that’s the intended LM Studio fix.

Overview
Adds LM Studio as a documented self-hosted option alongside vLLM, using the existing VLLM_BASE_URL / VLLM_API_KEY settings and the same vllm/ model-picker prefix.

Runtime: Introduces getOpenAICompatibleApiBaseUrl so discovery and chat calls accept either a server root or a URL that already ends in /v1, without double-appending /v1. Invalid bases with query strings or fragments yield an empty model list instead of a bad fetch. The vLLM provider now sends max_tokens (not max_completion_tokens) for token limits, matching LM Studio’s Chat Completions API.

Docker: docker-compose.ollama.yml loads an optional .env on simstudio so VLLM_* (and other local provider vars) reach the container without inline overrides.

Docs cover LM Studio setup, env var wording, and troubleshooting when requests wrongly route to Ollama if models aren’t discovered via the vllm/ prefix.

Reviewed by Cursor Bugbot for commit e5a7cdc. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds LM Studio support to the existing vLLM integration and completes the fixes requested in the previous URL-handling threads.

  • Normalizes server-root and already-versioned OpenAI-compatible endpoint URLs through a shared helper.
  • Keeps URL normalization within graceful model-discovery and provider-initialization error boundaries.
  • Uses the shared Chat Completions token-limit parameter and forwards local-provider environment configuration through Docker Compose.
  • Adds focused tests and self-hosting documentation for LM Studio setup.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the current code fixes both previously reported URL-handling issues by parsing pathname components safely and keeping normalization within the graceful models-route error boundary.

Important Files Changed

Filename Overview
apps/sim/providers/openai-compat/base-url.ts Parses endpoint URLs, rejects query and fragment components, and normalizes only the pathname to a single /v1 API base.
apps/sim/app/api/providers/vllm/models/route.ts Uses shared URL normalization within the existing graceful error boundary before requesting the models endpoint.
apps/sim/providers/vllm/index.ts Reuses normalized API bases for discovery and inference while preserving endpoint validation and pinned-fetch behavior.
docker-compose.ollama.yml Optionally loads the adjacent .env file into the Sim application service so local-provider configuration reaches the container.

Reviews (3): Last reviewed commit: "fix(vllm): guard discovery URL validatio..." | Re-trigger Greptile

Comment thread apps/sim/providers/openai-compat/base-url.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/providers/vllm/models/route.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1505233. Configure here.

Comment thread apps/sim/app/api/providers/vllm/models/route.ts Outdated

@cursor cursor Bot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e5a7cdc. Configure here.

@waleedlatif1
waleedlatif1 merged commit edf07ec into staging Aug 24, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/fix-lm-studio-vllm-routing branch August 24, 2026 17:58
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.

1 participant