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

docs: change quickstart to ollama #249

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Askir
Copy link
Contributor

@Askir Askir commented Nov 23, 2024

The docker images don't support this yet so probably best to merge after release.

Comment on lines 23 to 25
dockerfile: Dockerfile
context: ../pgai/projects/extension
target: pgai-test-db
Copy link
Contributor Author

Choose a reason for hiding this comment

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

images need to exchanged for the real ones, once they work. This is how I tested it though.

Copy link
Member

Choose a reason for hiding this comment

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

done

Before we start we need to tell ollama to download an embedding model so we can use it with pgai. For this example we will use the "nomic-embed-text" model.
To download it into the container simply run:
```
docker-compose exec ollama ollama pull nomic-embed-text
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
docker-compose exec ollama ollama pull nomic-embed-text
docker compose exec ollama ollama pull nomic-embed-text

Copy link
Member

Choose a reason for hiding this comment

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

done

@@ -123,20 +121,20 @@ To create and run a vectorizer, then query the auto-generated embeddings created
```sql
SELECT
chunk,
embedding <=> ai.openai_embed('text-embedding-3-small', 'good food', dimensions=>768) as distance
embedding <=> ai.ollama('nomic-embed-text', 'good food', host => 'http://ollama:11434') as distance,
Copy link
Member

@JamesGuthrie JamesGuthrie Nov 27, 2024

Choose a reason for hiding this comment

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

Suggested change
embedding <=> ai.ollama('nomic-embed-text', 'good food', host => 'http://ollama:11434') as distance,
embedding <=> ai.ollama_embed('nomic-embed-text', 'good food', host => 'http://ollama:11434') as distance

Copy link
Member

Choose a reason for hiding this comment

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

done

```shell
docker compose up -d db
docker compose up -d
Copy link
Member

Choose a reason for hiding this comment

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

Note: this still won't work, because the vectorizer worker isn't robust to failures in connecting to the DB etc. I've opened a PR which fixes this: #263

Copy link
Member

Choose a reason for hiding this comment

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

done

@JamesGuthrie JamesGuthrie marked this pull request as ready for review December 2, 2024 14:48
@JamesGuthrie JamesGuthrie requested a review from a team as a code owner December 2, 2024 14:48
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.

2 participants