goniszewski / grimoire

Bookmark manager for the wizards 🧙
https://grimoire.pro
MIT License
2.1k stars 64 forks source link

Ollama URL from settings is not respected. #71

Closed c157fl closed 8 months ago

c157fl commented 8 months ago

Hi there.

Describe the bug

Ollama URL from the settings is not respected when adding a link. I was able to bypass it by replacing all localhost:11434: find "." -type f | xargs sed -i "s/localhost:11434/aaa.bbb.ccc.ddd:11434"/g" and then building the image locally.

To Reproduce

Steps to reproduce the behavior:

  1. Change the ollama url in the settings and toggle tag/summary.
  2. Open network panel.
  3. Add an entry.
  4. See request being fired at localhost.

Expected behavior

Request in 5 should be targeted at the ollama url in the settings.

Screenshots

image

(Edit for formatting)

goniszewski commented 8 months ago

Hello @c157fl! I have a silly question, did you save the updated setting beforehand? If yes, did you check if, after refreshing the page, the problem still persists?

The state management is something that needs to be improved, but I need a plan for it. Sorry for the inconvenience!

c157fl commented 8 months ago

Hi @goniszewski. Not silly, my fault for not saying that part. That is correct. I had tested the url (to select the model) and then saved. Then tried a request and then while preserving the log in the network panel went back and got the screenshot. I had also done some refreshes in the meanwhile before I made the change.

Could you tell me where would the url be stored for the user? It may be the case that have an issue in my pocketbase installation (#72).

No worries!

c157fl commented 8 months ago

Did a full reset:

  1. Created user again,
  2. went to settings,
  3. filled the ollama url,
  4. tested the connection,
  5. selected the model,
  6. enabled the boxes,
  7. pressed save.
  8. Went back to main page,
  9. Refreshed, (necessary to activate AI features it seemed)
  10. Tried to adding a url
  11. Got an error from the request going into localhost.

Perhaps the url could be configured as an environment variable?

goniszewski commented 8 months ago

Strange. You can also check the JSON for user options in the PocketBase UI, to see if the value there matches the one you've set.

c157fl commented 8 months ago

Went into pocketbase and the URL there matched the URL defined in the settings. I logged out and back in and still localhost was still the target of the request. It would seems that the url is not being retrieved when performing the request to ollama.

goniszewski commented 8 months ago

@c157fl the issue should be now resolved in the latest Docker image (available in the next ~40 minutes).

Thank you for reporting this bug!

c157fl commented 8 months ago

Working perfectly. Thank you!