Skip to content
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

[Feature] llm Options #307

Open
729993031 opened this issue Dec 15, 2024 · 1 comment
Open

[Feature] llm Options #307

729993031 opened this issue Dec 15, 2024 · 1 comment

Comments

@729993031
Copy link

729993031 commented Dec 15, 2024

Background

I wish to experiment with other LLM models like Tongyi or Gemini, but it's not feasible.

switch (provider) {

Aspiration

Provide a solution akin to browser-use, allowing the integration of custom models.

import { OpenAI } from "@langchain/openai";

const llm = new OpenAI({
  model: "gpt-3.5-turbo-instruct",
  temperature: 0,
  maxTokens: undefined,
  timeout: undefined,
  maxRetries: 2,
  apiKey: process.env.OPENAI_API_KEY,
  // other params...
});
await stagehand.init({llm});

Benefits

  1. less code、lower maintenance complexity
  2. The token cost of GPT-4 is relatively high; in certain scenarios, cheaper models can be employed to achieve similar outcomes.
@conradkoh
Copy link

+1, this would also be nice if we could use with OpenRouter for many reasons (e.g. rate limits, consolidated billing, experimenting with different models to determine the output quality against cost)

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

No branches or pull requests

2 participants