Skip to content

Conversation

viknesh-ai
Copy link

Summary

Added support for configuring a custom OpenAI-compatible API provider. This allows users to input a custom base URL, model name, and optional API key — enabling integration with tools like Ollama or LM Studio.
Helps developers test without requiring authentication or relying on hosted OpenAI APIs.

Fixes #N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

Manual testing in local development environment using a custom provider input in the Credentials UI.
Settings are persisted using Zustand store.
Could not verify with full end-to-end behavior due to login/auth limitation in local setup. Reviewers should focus on data binding and store updates.

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)

Screenshots/Videos

waleedlatif1 and others added 3 commits August 1, 2025 13:19
…n, deployed chat improvements (simstudioai#843)

* fix(domain): fix telemetry endpoint, only add redirects for hosted version (simstudioai#822)

* fix(otel): change back telemetry endpoint

* only add redirects for hosted version

---------

Co-authored-by: waleedlatif <[email protected]>

* fix(search-modal): fixed search modal keyboard nav (simstudioai#823)

* fixed search modal keyboard nav

* break down file

---------

Co-authored-by: waleedlatif <[email protected]>

* improvement(docs): add base exec charge info to docs (simstudioai#826)

* improvement(doc-tags-subblock): use table for doc tags subblock in create_document tool for KB (simstudioai#827)

* improvement(doc-tags-subblock): use table for doc tags create doc tool in KB block

* enforce max tags

* remove red warning text

* fix(bugs): fixed rb2b csp, fixed overly-verbose logs, fixed x URLs (simstudioai#828)

Co-authored-by: waleedlatif <[email protected]>

* feat(wand): subblock level wand configuration + migrate old wand usage to this (simstudioai#829)

* feat(wand): subblock level wand configuration + migrate old wand usage to this

* fix build issue

* Update apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/wand-prompt-bar/wand-prompt-bar.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* remove optional param

* remove unused test file

* address greptile comments

* change to enum for gen type

* fix caching issue

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* feat(tools): added hunter.io tools/block, added default values of first option in dropdowns to avoid operation selector issue, added descriptions & param validation & updated docs (simstudioai#825)

* feat(tools): added hunter.io tools/block, added default values of first option in dropdowns to avoid operation selector issue

* fix

* added description for all outputs, fixed param validation for tools

* cleanup

* add dual validation, once during serialization and once during execution

* improvement(docs): add base exec charge info to docs (simstudioai#826)

* improvement(doc-tags-subblock): use table for doc tags subblock in create_document tool for KB (simstudioai#827)

* improvement(doc-tags-subblock): use table for doc tags create doc tool in KB block

* enforce max tags

* remove red warning text

* fix(bugs): fixed rb2b csp, fixed overly-verbose logs, fixed x URLs (simstudioai#828)

Co-authored-by: waleedlatif <[email protected]>

* fixed serialization errors to appear like execution errors, also fixed contrast on cmdk modal

* fixed required for tools, added tag dropdown for kb tags

* fix remaining tools with required fields

* update utils

* update docs

* fix kb tags

* fix types for exa

* lint

* updated contributing guide + pr template

* Test pre-commit hook with linting

* Test pre-commit hook again

* remove test files

* fixed wealthbox tool

* update telemetry endpoints

---------

Co-authored-by: waleedlatif <[email protected]>
Co-authored-by: Vikhyath Mondreti <[email protected]>

* fix(deployed-chat): trigger blocks should not interfere with deployed chat exec (simstudioai#832)

* fix(deployed-chat): allow non-streaming responses in deployed chat, allow partial failure responses in deployed chat (simstudioai#833)

* fix(deployed-chat): allow non-streaming responses in deployed chat, allow partial failure responses in deployed chat

* fix(csp): runtime variable resolution for CSP

* cleanup

---------

Co-authored-by: waleedlatif <[email protected]>

* fix(sockets): duplicate block op should go through debounced path (simstudioai#834)

* improvement(sockets): add batch subblock updates for duplicate to clear queue faster (simstudioai#835)

* improvement(sockets): duplicate op should let addBlock take subblock values instead of separate looped op (simstudioai#836)

* improvement(sockets): addBlock can accept subblock values

* cleanup unused code

* fix(deploy-modal): break down deploy modal into separate components (simstudioai#837)

Co-authored-by: waleedlatif <[email protected]>

* fix(kb-tags): docs page kb tags ui (simstudioai#838)

* fix(kb-tags): docs page kb tags ui

* remove console logs

* remove console error

* fix(chat-deploy): fixed form submission access patterns, fixed kb block filters (simstudioai#839)

* fix(chat-deploy): fixed form submission access patterns

* fix(kb-block): fix tag filters component, removed unused component

* fixed kb block subcomponents

---------

Co-authored-by: waleedlatif <[email protected]>

* fix(kb-tags): ui fixes, delete persistence for doc page header (simstudioai#841)

* fix deletion of tags + refactor next slot calc

* fix kb tag filters count ui

* fix(chat-deploy): added new image upload component, fixed some state issues with success view (simstudioai#842)

* fix(chat-deploy): added new image upload component, fixed some state issues with success view

* cleanup

---------

Co-authored-by: waleedlatif <[email protected]>

* feat(deploy-chat): added a logo upload for the chat, incr font size

* fix(deploy-modal): break down deploy modal into separate components (simstudioai#837)

Co-authored-by: waleedlatif <[email protected]>

---------

Co-authored-by: waleedlatif <[email protected]>
Co-authored-by: Vikhyath Mondreti <[email protected]>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link

vercel bot commented Aug 3, 2025

Someone is attempting to deploy a commit to the Sim Studio Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR adds support for custom OpenAI-compatible API providers, allowing users to configure local or self-hosted LLM services like Ollama or LM Studio instead of relying solely on hosted OpenAI APIs. The implementation extends the existing credentials/settings system by adding three new components:

  1. New Credentials Component (credentials.tsx): Creates a user interface that allows selection between OpenAI, Azure, and Custom OpenAI providers. When "Custom OpenAI" is selected, it conditionally renders input fields for base URL, model name, and API key configuration.

  2. Extended Store Types (types.ts): Adds llmProvider (string) and customOpenAI (object with baseURL, modelName, apiKey) fields to the General interface, along with corresponding setter method signatures.

  3. Store Implementation (store.ts): Implements the actual state management with default values (llmProvider: 'openai' and empty customOpenAI configuration) and provides setLLMProvider and setCustomOpenAI methods for updating the configuration.

The feature integrates with the existing Zustand-based settings system and follows the established UI patterns. The implementation focuses on local state management rather than full backend persistence, which aligns with the developer's testing limitations mentioned in the PR description. This change enables developers to test workflows with local LLM providers without requiring OpenAI authentication, improving the development experience for those using alternative AI backends.

Confidence score: 2/5

  • This PR has several implementation issues that could cause problems, including incomplete type definitions and missing backend persistence
  • Score reflects concerns about type safety violations, inconsistent formatting, unused imports, and the lack of integration with existing API persistence patterns
  • Pay close attention to the type definitions in types.ts and the store implementation in store.ts

3 files reviewed, 8 comments

Edit Code Review Bot Settings | Greptile

@@ -0,0 +1,68 @@
import { useState } from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Remove unused import - useState is imported but never used in this component

Suggested change
import { useState } from 'react'
import { Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui'

Comment on lines +19 to +23
customOpenAI: {
baseURL: string
modelName: string
apiKey: string
}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Inconsistent indentation in object definition. Should align with the file's formatting style.

const handleInputChange = (key: keyof typeof customOpenAI, value: string) => {
setCustomOpenAI({
...customOpenAI,
[key]: value ,
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: Extra space before comma

Suggested change
[key]: value ,
[key]: value,

Comment on lines +40 to +44
setCustomOpenAI: (data: {
baseURL: string
modelName: string
apiKey: string
}) => void
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Inconsistent indentation in object type definition. Should align with the file's formatting style.

Comment on lines +36 to +40
customOpenAI: {
baseURL: '',
modelName: '',
apiKey: '',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Inconsistent indentation - the object properties should align with the opening brace

Suggested change
customOpenAI: {
baseURL: '',
modelName: '',
apiKey: '',
},
customOpenAI: {
baseURL: '',
modelName: '',
apiKey: '',
},

import { Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui'
import { useGeneralStore } from '@/stores/settings/general/store'

export function Credentials({ onOpenChange }: { onOpenChange: (open: boolean) => void }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The onOpenChange prop is received but never used - consider removing if not needed

Suggested change
export function Credentials({ onOpenChange }: { onOpenChange: (open: boolean) => void }) {
export function Credentials() {

Comment on lines +82 to +88
setLLMProvider: (provider) => {
set({ llmProvider: provider })
},

setCustomOpenAI: (data) => {
set({ customOpenAI: data })
},
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: These settings are not persisted to the backend via updateSetting() like other settings. Consider if these should be saved to user preferences or remain local-only

@@ -118,6 +133,8 @@ export const useGeneralStore = create<GeneralStore>()(
get().updateSetting('telemetryNotifiedUser', notified)
},


Copy link
Contributor

Choose a reason for hiding this comment

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

style: Remove unnecessary empty line

@Lutherwaves
Copy link

@viknesh-ai do you plan on continuing this one?

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