Skip to content

feat: Implement custom OpenAI-compatible LLM support #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Titan-co
Copy link

Adds support for configuring the server to use custom OpenAI-compatible LLMs via environment variables:

  • CUSTOM_LLM_API_KEY
  • CUSTOM_LLM_BASE_URL
  • CUSTOM_LLM_MODEL_NAME

Includes:

  • A new CustomOpenAIClientWrapper class to adapt the OpenAI client to the expected interface.
  • Updates to server.ts to read the new environment variables and conditionally instantiate the custom client with precedence over other LLM configurations.
  • Addition of openai package to stagehand/package.json.
  • Adjustments to build scripts for robustness.

Adds support for configuring the server to use custom
OpenAI-compatible LLMs via environment variables:
- CUSTOM_LLM_API_KEY
- CUSTOM_LLM_BASE_URL
- CUSTOM_LLM_MODEL_NAME

Includes:
- A new `CustomOpenAIClientWrapper` class to adapt the OpenAI client
  to the expected interface.
- Updates to `server.ts` to read the new environment variables and
  conditionally instantiate the custom client with precedence over
  other LLM configurations.
- Addition of `openai` package to `stagehand/package.json`.
- Adjustments to build scripts for robustness.
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