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

Ollama support? #1365

Open
BluePhi09 opened this issue Nov 19, 2023 · 2 comments
Open

Ollama support? #1365

BluePhi09 opened this issue Nov 19, 2023 · 2 comments

Comments

@BluePhi09
Copy link

Is there any way to use Ollama to host the llm models?

@MikeyBeez
Copy link

This should be easy:
from langchain.llms import Ollama
ollama = Ollama(base_url='http://localhost:11434', model="llama2")
response = ollama(prompt)

Cheers!

@shaileshjswl
Copy link

Import the Ollama class from langchain.llms

from langchain.llms import Ollama

Create an instance of the Ollama class with specified parameters

ollama = Ollama(base_url='http://localhost:11434', model="llama2")

Define the prompt you want to send to the Ollama model

prompt = "Your prompt goes here"

Make a request to the Ollama model with the provided prompt

response = ollama(prompt)

Print the response from the Ollama model

print(response)

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

3 participants