auto-playwright icon indicating copy to clipboard operation
auto-playwright copied to clipboard

Add Ollama support

Open inluxc opened this issue 2 years ago • 8 comments

Add Ollama support instead of chatGPT.

inluxc avatar Nov 13 '23 08:11 inluxc

What needs to be done to support it?

lucgagan avatar Nov 13 '23 15:11 lucgagan

Basically Ollama support is an open-source alternative to chatGPT by Meta which is free. https://ollama.ai/

inluxc avatar Nov 13 '23 15:11 inluxc

But does it work with OpenAI SDK?

lucgagan avatar Nov 13 '23 16:11 lucgagan

Using a universal connector would probably satisfy everyone, and facilitate adoption: https://github.com/BerriAI/litellm.

sabatale avatar Nov 19 '23 00:11 sabatale

That looks good. Would you be open to implementing that?

lucgagan avatar Nov 20 '23 01:11 lucgagan

Considering Langchain Python/JS already fits the use case (playwright and non-OpenAI frameworks), I'm not sure this is really needed.

sabatale avatar Nov 21 '23 20:11 sabatale

Considering Langchain Python/JS already fits the use case (playwright and non-OpenAI frameworks), I'm not sure this is really needed.

I got also interested: it seems the JS/TS version of Playwright is not available as I see https://python.langchain.com/docs/integrations/toolkits/playwright, but not the JS version?

danielvanmil avatar Dec 29 '23 12:12 danielvanmil

Ollama is self-hosted drop-in-replacement of OpenAI and should work out of the box with this project. There is a Blogpost from Ollama : https://ollama.com/blog/openai-compatibility where also is an Example.

As far as I see, there is just a baseURL that needs to be provided besides the Model. Api Key is not necessary for Self-Hosted Ollama and is ignored when passed.

probably a small change here will help: https://github.com/lucgagan/auto-playwright/blob/22c8f2f1e70e794795bc7b4c2d3118e2180d8300/src/completeTask.ts#L12

michaelschort avatar Apr 04 '24 21:04 michaelschort