mealie-recipes / mealie

Mealie is a self hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the url and mealie will automatically import the relevant data or add a family recipe with the UI editor
https://docs.mealie.io
GNU Affero General Public License v3.0
6.64k stars 683 forks source link

[BUG] - Create from image returns "Something Went Wrong!" when using Ollama #4097

Closed death2all110 closed 2 weeks ago

death2all110 commented 2 weeks ago

First Check

What is the issue you are experiencing?

When Mealie is configured with Ollama instead of OpenAI, scraping from image does not work.

Steps to Reproduce

  1. Configure mealie with 'Ollama' set model to 'Llava'
  2. Attempt to scrape a recipe from image.
  3. Error occurs.

Please provide relevant logs

2024-08-24T21:30:22.764627828-05:00 usermod: no changes
2024-08-24T21:30:23.045062752-05:00 Switching to dedicated user
2024-08-24T21:30:23.052368721-05:00 
2024-08-24T21:30:23.052370976-05:00         User uid:    99
2024-08-24T21:30:23.052371667-05:00         User gid:    100
2024-08-24T21:30:23.052372208-05:00         
2024-08-24T21:30:25.768937874-05:00 DEBUG    2024-08-25T02:30:25 - Language set to en
2024-08-24T21:30:33.682875977-05:00 INFO     2024-08-25T02:30:33 - Started server process [1]
2024-08-24T21:30:33.683406478-05:00 INFO     2024-08-25T02:30:33 - Waiting for application startup.
2024-08-24T21:30:33.684080120-05:00 INFO     2024-08-25T02:30:33 - start: database initialization
2024-08-24T21:30:33.697842395-05:00 INFO     2024-08-25T02:30:33 - Database connection established.
2024-08-24T21:30:33.711042869-05:00 INFO     2024-08-25T02:30:33 - Context impl PostgresqlImpl.
2024-08-24T21:30:33.711616963-05:00 INFO     2024-08-25T02:30:33 - Will assume transactional DDL.
2024-08-24T21:30:33.757242647-05:00 DEBUG    2024-08-25T02:30:33 - Migration not needed.
2024-08-24T21:30:33.758623313-05:00 INFO     2024-08-25T02:30:33 - Checking for migration data fixes
2024-08-24T21:30:34.526181254-05:00 DEBUG    2024-08-25T02:30:34 - No food found with slug: 'dairy-products-and-dairy-substitutes' skipping fix
2024-08-24T21:30:34.528396465-05:00 DEBUG    2024-08-25T02:30:34 - No group found with an empty name; skipping fix
2024-08-24T21:30:34.545122924-05:00 DEBUG    2024-08-25T02:30:34 - Database exists
2024-08-24T21:30:34.545995722-05:00 INFO     2024-08-25T02:30:34 - end: database initialization
2024-08-24T21:30:34.546420844-05:00 DEBUG    2024-08-25T02:30:34 - Registering daily callback: purge_group_registration
2024-08-24T21:30:34.546811221-05:00 DEBUG    2024-08-25T02:30:34 - Registering daily callback: purge_password_reset_tokens
2024-08-24T21:30:34.547166111-05:00 DEBUG    2024-08-25T02:30:34 - Registering daily callback: purge_group_data_exports
2024-08-24T21:30:34.547564934-05:00 DEBUG    2024-08-25T02:30:34 - Registering daily callback: create_mealplan_timeline_events
2024-08-24T21:30:34.547967413-05:00 DEBUG    2024-08-25T02:30:34 - Registering daily callback: delete_old_checked_list_items
2024-08-24T21:30:34.548393197-05:00 DEBUG    2024-08-25T02:30:34 - Registering minutely callback: post_group_webhooks
2024-08-24T21:30:34.549031692-05:00 DEBUG    2024-08-25T02:30:34 - Registering daily callback: locked_user_reset
2024-08-24T21:30:34.549617958-05:00 DEBUG    2024-08-25T02:30:34 - Daily job: purge_group_registration
2024-08-24T21:30:34.550172996-05:00 DEBUG    2024-08-25T02:30:34 - Daily job: purge_password_reset_tokens
2024-08-24T21:30:34.550709028-05:00 DEBUG    2024-08-25T02:30:34 - Daily job: purge_group_data_exports
2024-08-24T21:30:34.551227246-05:00 DEBUG    2024-08-25T02:30:34 - Daily job: create_mealplan_timeline_events
2024-08-24T21:30:34.551792833-05:00 DEBUG    2024-08-25T02:30:34 - Daily job: delete_old_checked_list_items
2024-08-24T21:30:34.552301684-05:00 DEBUG    2024-08-25T02:30:34 - Hourly job: locked_user_reset
2024-08-24T21:30:34.552823008-05:00 DEBUG    2024-08-25T02:30:34 - Minutely job: post_group_webhooks
2024-08-24T21:30:34.553563074-05:00 INFO     2024-08-25T02:30:34 - -----SYSTEM STARTUP-----
2024-08-24T21:30:34.553997965-05:00 INFO     2024-08-25T02:30:34 - ------APP SETTINGS------
2024-08-24T21:30:34.554810329-05:00 INFO     2024-08-25T02:30:34 - {
2024-08-24T21:30:34.554812913-05:00     "TESTING": false,
2024-08-24T21:30:34.554813474-05:00     "PRODUCTION": true,
2024-08-24T21:30:34.554814186-05:00     "LOG_CONFIG_OVERRIDE": "/app/data/logconf.prod.json",
2024-08-24T21:30:34.554814707-05:00     "LOG_LEVEL": "DEBUG",
2024-08-24T21:30:34.554815238-05:00     "theme": {
2024-08-24T21:30:34.554815999-05:00         "light_primary": "#E58325",
2024-08-24T21:30:34.554816440-05:00         "light_accent": "#007A99",
2024-08-24T21:30:34.554816891-05:00         "light_secondary": "#973542",
2024-08-24T21:30:34.554819326-05:00         "light_success": "#43A047",
2024-08-24T21:30:34.554819796-05:00         "light_info": "#1976D2",
2024-08-24T21:30:34.554820227-05:00         "light_warning": "#FF6D00",
2024-08-24T21:30:34.554820668-05:00         "light_error": "#EF5350",
2024-08-24T21:30:34.554821099-05:00         "dark_primary": "#E58325",
2024-08-24T21:30:34.554821610-05:00         "dark_accent": "#007A99",
2024-08-24T21:30:34.554822061-05:00         "dark_secondary": "#973542",
2024-08-24T21:30:34.554822441-05:00         "dark_success": "#43A047",
2024-08-24T21:30:34.554822972-05:00         "dark_info": "#1976D2",
2024-08-24T21:30:34.554823273-05:00         "dark_warning": "#FF6D00",
2024-08-24T21:30:34.554823574-05:00         "dark_error": "#EF5350"
2024-08-24T21:30:34.554823884-05:00     },
2024-08-24T21:30:34.554824215-05:00     "BASE_URL": "https://meals.someotherurl.net",
2024-08-24T21:30:34.554824505-05:00     "STATIC_FILES": "/spa/static",
2024-08-24T21:30:34.554824806-05:00     "IS_DEMO": false,
2024-08-24T21:30:34.554825096-05:00     "HOST_IP": "*",
2024-08-24T21:30:34.554825377-05:00     "API_HOST": "0.0.0.0",
2024-08-24T21:30:34.554825668-05:00     "API_PORT": 9000,
2024-08-24T21:30:34.554825948-05:00     "API_DOCS": true,
2024-08-24T21:30:34.554826229-05:00     "TOKEN_TIME": 8766,
2024-08-24T21:30:34.554826559-05:00     "GIT_COMMIT_HASH": "0d06494bbfc62fc8a1771a85fd308190891d6167",
2024-08-24T21:30:34.554827010-05:00     "ALLOW_SIGNUP": false,
2024-08-24T21:30:34.554827331-05:00     "DAILY_SCHEDULE_TIME": "23:45",
2024-08-24T21:30:34.554827641-05:00     "SECURITY_MAX_LOGIN_ATTEMPTS": 5,
2024-08-24T21:30:34.554827942-05:00     "SECURITY_USER_LOCKOUT_TIME": 24,
2024-08-24T21:30:34.554828242-05:00     "DB_ENGINE": "postgres",
2024-08-24T21:30:34.554828533-05:00     "DEFAULT_GROUP": "My Family",
2024-08-24T21:30:34.554829495-05:00     "SMTP_HOST": "smtp.gmail.com",
2024-08-24T21:30:34.554829805-05:00     "SMTP_PORT": "587",
2024-08-24T21:30:34.554831679-05:00     "SMTP_FROM_NAME": "Mealie",
2024-08-24T21:30:34.554831999-05:00     "SMTP_FROM_EMAIL": "mealie@someotherurl.net",
2024-08-24T21:30:34.554832290-05:00     "SMTP_AUTH_STRATEGY": "TLS",
2024-08-24T21:30:34.554832581-05:00     "LDAP_AUTH_ENABLED": true,
2024-08-24T21:30:34.554832871-05:00     "LDAP_SERVER_URL": "ldap://sso.someotherurl.net",
2024-08-24T21:30:34.554833162-05:00     "LDAP_TLS_INSECURE": false,
2024-08-24T21:30:34.554833643-05:00     "LDAP_TLS_CACERTFILE": null,
2024-08-24T21:30:34.554833943-05:00     "LDAP_ENABLE_STARTTLS": false,
2024-08-24T21:30:34.554834234-05:00     "LDAP_BASE_DN": "ou=users,dc=ldap,dc=goauthentik,dc=io",
2024-08-24T21:30:34.554834554-05:00     "LDAP_QUERY_BIND": "cn=ldapservice,ou=users,dc=ldap,dc=goauthentik,dc=io",
2024-08-24T21:30:34.554834835-05:00     "LDAP_QUERY_PASSWORD": "password",
2024-08-24T21:30:34.554835145-05:00     "LDAP_USER_FILTER": "(memberOf=cn=mealie_users,ou=groups,dc=ldap,dc=goauthentik,dc=io)",
2024-08-24T21:30:34.554835456-05:00     "LDAP_ADMIN_FILTER": "(memberOf=cn=mealie_users,ou=groups,dc=ldap,dc=goauthentik,dc=io)",
2024-08-24T21:30:34.554835757-05:00     "LDAP_ID_ATTRIBUTE": "cn",
2024-08-24T21:30:34.554836047-05:00     "LDAP_MAIL_ATTRIBUTE": "mail",
2024-08-24T21:30:34.554836328-05:00     "LDAP_NAME_ATTRIBUTE": "name",
2024-08-24T21:30:34.554836628-05:00     "OIDC_AUTH_ENABLED": false,
2024-08-24T21:30:34.554837360-05:00     "OIDC_CLIENT_ID": null,
2024-08-24T21:30:34.554837660-05:00     "OIDC_CONFIGURATION_URL": null,
2024-08-24T21:30:34.554837971-05:00     "OIDC_SIGNUP_ENABLED": true,
2024-08-24T21:30:34.554838271-05:00     "OIDC_USER_GROUP": null,
2024-08-24T21:30:34.554838572-05:00     "OIDC_ADMIN_GROUP": null,
2024-08-24T21:30:34.554838852-05:00     "OIDC_AUTO_REDIRECT": false,
2024-08-24T21:30:34.554839143-05:00     "OIDC_PROVIDER_NAME": "OAuth",
2024-08-24T21:30:34.554839444-05:00     "OIDC_REMEMBER_ME": false,
2024-08-24T21:30:34.554840205-05:00     "OIDC_SIGNING_ALGORITHM": "RS256",
2024-08-24T21:30:34.554840506-05:00     "OIDC_USER_CLAIM": "email",
2024-08-24T21:30:34.554840796-05:00     "OIDC_GROUPS_CLAIM": "groups",
2024-08-24T21:30:34.554841077-05:00     "OIDC_TLS_CACERTFILE": null,
2024-08-24T21:30:34.554841367-05:00     "OPENAI_BASE_URL": "https://ollama.someotherurl.net/v1",
2024-08-24T21:30:34.554841668-05:00     "OPENAI_API_KEY": "ollama",
2024-08-24T21:30:34.554841968-05:00     "OPENAI_MODEL": "llava",
2024-08-24T21:30:34.554842259-05:00     "OPENAI_ENABLE_IMAGE_SERVICES": true,
2024-08-24T21:30:34.554842549-05:00     "OPENAI_WORKERS": 2,
2024-08-24T21:30:34.554842830-05:00     "OPENAI_SEND_DATABASE_DATA": true,
2024-08-24T21:30:34.554843130-05:00     "OPENAI_REQUEST_TIMEOUT": 180,
2024-08-24T21:30:34.554843431-05:00     "WORKER_PER_CORE": 1,
2024-08-24T21:30:34.554843752-05:00     "UVICORN_WORKERS": 1
2024-08-24T21:30:34.554844082-05:00 }
2024-08-24T21:30:34.555760171-05:00 DEBUG    2024-08-25T02:30:34 - Local time: 23:45 | UTC time: 23:45
2024-08-24T21:30:34.556356707-05:00 DEBUG    2024-08-25T02:30:34 - Current time is 2024-08-25 02:30:34.554920+00:00 and DAILY_SCHEDULE_TIME (in UTC) is ScheduleTime(hour=23, minute=45)
2024-08-24T21:30:34.556996635-05:00 DEBUG    2024-08-25T02:30:34 - Time left: 21:14:25
2024-08-24T21:30:34.557595766-05:00 INFO     2024-08-25T02:30:34 - Daily tasks scheduled for 2024-08-25 23:45:00+00:00
2024-08-24T21:30:34.560979362-05:00 INFO     2024-08-25T02:30:34 - Application startup complete.
2024-08-24T21:30:34.562245642-05:00 INFO     2024-08-25T02:30:34 - Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)
2024-08-24T21:30:53.168560739-05:00 INFO     2024-08-25T02:30:53 - [127.0.0.1:36626] 200 OK "GET /api/app/about HTTP/1.1"
2024-08-24T21:30:59.232464727-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_part_begin with no data
2024-08-24T21:30:59.233057015-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_header_field with data[60:79]
2024-08-24T21:30:59.233588939-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_header_value with data[81:122]
2024-08-24T21:30:59.234037135-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_header_end with no data
2024-08-24T21:30:59.234472907-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_header_field with data[124:136]
2024-08-24T21:30:59.234945900-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_header_value with data[138:147]
2024-08-24T21:30:59.235408112-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_header_end with no data
2024-08-24T21:30:59.235829588-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_headers_finished with no data
2024-08-24T21:30:59.236496517-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_part_data with data[151:7224]
2024-08-24T21:30:59.238025633-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_part_data with data[0:62224]
2024-08-24T21:30:59.239990221-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_part_data with data[0:256000]
2024-08-24T21:30:59.240933852-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_part_data with data[0:19488]
2024-08-24T21:30:59.241439216-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_part_end with no data
2024-08-24T21:30:59.241800908-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_part_begin with no data
2024-08-24T21:30:59.242387455-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_header_field with data[19550:19569]
2024-08-24T21:30:59.242973161-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_header_value with data[19571:19598]
2024-08-24T21:30:59.243490297-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_header_end with no data
2024-08-24T21:30:59.244003315-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_headers_finished with no data
2024-08-24T21:30:59.244642872-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_part_data with data[19602:19605]
2024-08-24T21:30:59.245283361-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_part_end with no data
2024-08-24T21:30:59.245722500-05:00 DEBUG    2024-08-25T02:30:59 - Calling on_end with no data
2024-08-24T21:30:59.258036812-05:00 DEBUG    2024-08-25T02:30:59 - Language set to en
2024-08-24T21:30:59.301048152-05:00 DEBUG    2024-08-25T02:30:59 - STREAM b'IHDR' 16 13
2024-08-24T21:30:59.301516265-05:00 DEBUG    2024-08-25T02:30:59 - STREAM b'IDAT' 41 8192
2024-08-24T21:30:59.313846878-05:00 DEBUG    2024-08-25T02:30:59 - Importing BlpImagePlugin
2024-08-24T21:30:59.315205753-05:00 DEBUG    2024-08-25T02:30:59 - Importing BmpImagePlugin
2024-08-24T21:30:59.315657175-05:00 DEBUG    2024-08-25T02:30:59 - Importing BufrStubImagePlugin
2024-08-24T21:30:59.316375771-05:00 DEBUG    2024-08-25T02:30:59 - Importing CurImagePlugin
2024-08-24T21:30:59.317127360-05:00 DEBUG    2024-08-25T02:30:59 - Importing DcxImagePlugin
2024-08-24T21:30:59.318073165-05:00 DEBUG    2024-08-25T02:30:59 - Importing DdsImagePlugin
2024-08-24T21:30:59.322945250-05:00 DEBUG    2024-08-25T02:30:59 - Importing EpsImagePlugin
2024-08-24T21:30:59.324143852-05:00 DEBUG    2024-08-25T02:30:59 - Importing FitsImagePlugin
2024-08-24T21:30:59.324872227-05:00 DEBUG    2024-08-25T02:30:59 - Importing FliImagePlugin
2024-08-24T21:30:59.325539427-05:00 DEBUG    2024-08-25T02:30:59 - Importing FpxImagePlugin
2024-08-24T21:30:59.326373320-05:00 DEBUG    2024-08-25T02:30:59 - Image: failed to import FpxImagePlugin: No module named 'olefile'
2024-08-24T21:30:59.326885998-05:00 DEBUG    2024-08-25T02:30:59 - Importing FtexImagePlugin
2024-08-24T21:30:59.327704132-05:00 DEBUG    2024-08-25T02:30:59 - Importing GbrImagePlugin
2024-08-24T21:30:59.328438618-05:00 DEBUG    2024-08-25T02:30:59 - Importing GifImagePlugin
2024-08-24T21:30:59.328876535-05:00 DEBUG    2024-08-25T02:30:59 - Importing GribStubImagePlugin
2024-08-24T21:30:59.329539997-05:00 DEBUG    2024-08-25T02:30:59 - Importing Hdf5StubImagePlugin
2024-08-24T21:30:59.330308327-05:00 DEBUG    2024-08-25T02:30:59 - Importing IcnsImagePlugin
2024-08-24T21:30:59.331775747-05:00 DEBUG    2024-08-25T02:30:59 - Importing IcoImagePlugin
2024-08-24T21:30:59.332678791-05:00 DEBUG    2024-08-25T02:30:59 - Importing ImImagePlugin
2024-08-24T21:30:59.333747058-05:00 DEBUG    2024-08-25T02:30:59 - Importing ImtImagePlugin
2024-08-24T21:30:59.334602492-05:00 DEBUG    2024-08-25T02:30:59 - Importing IptcImagePlugin
2024-08-24T21:30:59.335357878-05:00 DEBUG    2024-08-25T02:30:59 - Importing JpegImagePlugin
2024-08-24T21:30:59.335822805-05:00 DEBUG    2024-08-25T02:30:59 - Importing Jpeg2KImagePlugin
2024-08-24T21:30:59.336283475-05:00 DEBUG    2024-08-25T02:30:59 - Importing McIdasImagePlugin
2024-08-24T21:30:59.336999085-05:00 DEBUG    2024-08-25T02:30:59 - Importing MicImagePlugin
2024-08-24T21:30:59.337750233-05:00 DEBUG    2024-08-25T02:30:59 - Image: failed to import MicImagePlugin: No module named 'olefile'
2024-08-24T21:30:59.338204190-05:00 DEBUG    2024-08-25T02:30:59 - Importing MpegImagePlugin
2024-08-24T21:30:59.338931352-05:00 DEBUG    2024-08-25T02:30:59 - Importing MpoImagePlugin
2024-08-24T21:30:59.340950233-05:00 DEBUG    2024-08-25T02:30:59 - Importing MspImagePlugin
2024-08-24T21:30:59.341673869-05:00 DEBUG    2024-08-25T02:30:59 - Importing PalmImagePlugin
2024-08-24T21:30:59.342791969-05:00 DEBUG    2024-08-25T02:30:59 - Importing PcdImagePlugin
2024-08-24T21:30:59.343492301-05:00 DEBUG    2024-08-25T02:30:59 - Importing PcxImagePlugin
2024-08-24T21:30:59.344015919-05:00 DEBUG    2024-08-25T02:30:59 - Importing PdfImagePlugin
2024-08-24T21:30:59.353125613-05:00 DEBUG    2024-08-25T02:30:59 - Importing PixarImagePlugin
2024-08-24T21:30:59.353848317-05:00 DEBUG    2024-08-25T02:30:59 - Importing PngImagePlugin
2024-08-24T21:30:59.354240878-05:00 DEBUG    2024-08-25T02:30:59 - Importing PpmImagePlugin
2024-08-24T21:30:59.354631094-05:00 DEBUG    2024-08-25T02:30:59 - Importing PsdImagePlugin
2024-08-24T21:30:59.355389536-05:00 DEBUG    2024-08-25T02:30:59 - Importing QoiImagePlugin
2024-08-24T21:30:59.356100848-05:00 DEBUG    2024-08-25T02:30:59 - Importing SgiImagePlugin
2024-08-24T21:30:59.357026094-05:00 DEBUG    2024-08-25T02:30:59 - Importing SpiderImagePlugin
2024-08-24T21:30:59.358215028-05:00 DEBUG    2024-08-25T02:30:59 - Importing SunImagePlugin
2024-08-24T21:30:59.359181022-05:00 DEBUG    2024-08-25T02:30:59 - Importing TgaImagePlugin
2024-08-24T21:30:59.360106849-05:00 DEBUG    2024-08-25T02:30:59 - Importing TiffImagePlugin
2024-08-24T21:30:59.360619857-05:00 DEBUG    2024-08-25T02:30:59 - Importing WebPImagePlugin
2024-08-24T21:30:59.362837984-05:00 DEBUG    2024-08-25T02:30:59 - Importing WmfImagePlugin
2024-08-24T21:30:59.363596816-05:00 DEBUG    2024-08-25T02:30:59 - Importing XbmImagePlugin
2024-08-24T21:30:59.365383578-05:00 DEBUG    2024-08-25T02:30:59 - Importing XpmImagePlugin
2024-08-24T21:30:59.366334193-05:00 DEBUG    2024-08-25T02:30:59 - Importing XVThumbImagePlugin
2024-08-24T21:30:59.413533677-05:00 DEBUG    2024-08-25T02:30:59 - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-08-24T21:30:59.414691663-05:00 DEBUG    2024-08-25T02:30:59 - load_verify_locations cafile='/opt/pysetup/.venv/lib/python3.10/site-packages/certifi/cacert.pem'
2024-08-24T21:30:59.471081142-05:00 DEBUG    2024-08-25T02:30:59 - connect_tcp.started host='ollama.someotherurl.net' port=443 local_address=None timeout=180 socket_options=None
2024-08-24T21:30:59.533685442-05:00 DEBUG    2024-08-25T02:30:59 - connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x15213ae97310>
2024-08-24T21:30:59.534239427-05:00 DEBUG    2024-08-25T02:30:59 - start_tls.started ssl_context=<ssl.SSLContext object at 0x15213ad9a940> server_hostname='ollama.someotherurl.net' timeout=180
2024-08-24T21:30:59.542837095-05:00 DEBUG    2024-08-25T02:30:59 - start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x15213ae97c70>
2024-08-24T21:30:59.543574817-05:00 DEBUG    2024-08-25T02:30:59 - send_request_headers.started request=<Request [b'POST']>
2024-08-24T21:30:59.544429430-05:00 DEBUG    2024-08-25T02:30:59 - send_request_headers.complete
2024-08-24T21:30:59.544783338-05:00 DEBUG    2024-08-25T02:30:59 - send_request_body.started request=<Request [b'POST']>
2024-08-24T21:30:59.546465924-05:00 DEBUG    2024-08-25T02:30:59 - send_request_body.complete
2024-08-24T21:30:59.547000733-05:00 DEBUG    2024-08-25T02:30:59 - receive_response_headers.started request=<Request [b'POST']>
2024-08-24T21:30:59.554453279-05:00 DEBUG    2024-08-25T02:30:59 - receive_response_headers.complete return_value=(b'HTTP/1.1', 400, b'Bad Request', [(b'Server', b'openresty'), (b'Date', b'Sun, 25 Aug 2024 02:30:59 GMT'), (b'Content-Type', b'application/json; charset=utf-8'), (b'Content-Length', b'99'), (b'Connection', b'keep-alive')])
2024-08-24T21:30:59.555816803-05:00 INFO     2024-08-25T02:30:59 - HTTP Request: POST https://ollama.someotherurl.net/v1/chat/completions "HTTP/1.1 400 Bad Request"
2024-08-24T21:30:59.556665394-05:00 DEBUG    2024-08-25T02:30:59 - receive_response_body.started request=<Request [b'POST']>
2024-08-24T21:30:59.557389681-05:00 DEBUG    2024-08-25T02:30:59 - receive_response_body.complete
2024-08-24T21:30:59.558045920-05:00 DEBUG    2024-08-25T02:30:59 - response_closed.started
2024-08-24T21:30:59.558920901-05:00 DEBUG    2024-08-25T02:30:59 - response_closed.complete
2024-08-24T21:30:59.559939824-05:00 DEBUG    2024-08-25T02:30:59 - HTTP Request: POST https://ollama.someotherurl.net/v1/chat/completions "400 Bad Request"
2024-08-24T21:30:59.561532791-05:00 DEBUG    2024-08-25T02:30:59 - Encountered httpx.HTTPStatusError
2024-08-24T21:30:59.561534875-05:00 Traceback (most recent call last):
2024-08-24T21:30:59.561535536-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/openai/_base_client.py", line 1590, in _request
2024-08-24T21:30:59.561536348-05:00     response.raise_for_status()
2024-08-24T21:30:59.561536859-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/httpx/_models.py", line 761, in raise_for_status
2024-08-24T21:30:59.561537410-05:00     raise HTTPStatusError(message, request=request, response=self)
2024-08-24T21:30:59.561537891-05:00 httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://ollama.someotherurl.net/v1/chat/completions'
2024-08-24T21:30:59.561539784-05:00 For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
2024-08-24T21:30:59.562110812-05:00 DEBUG    2024-08-25T02:30:59 - Not retrying
2024-08-24T21:30:59.562580949-05:00 DEBUG    2024-08-25T02:30:59 - Re-raising status error
2024-08-24T21:30:59.564949269-05:00 ERROR    2024-08-25T02:30:59 - OpenAI Request Failed
2024-08-24T21:30:59.564950231-05:00 Traceback (most recent call last):
2024-08-24T21:30:59.564950722-05:00   File "/app/mealie/services/openai/openai.py", line 175, in get_response
2024-08-24T21:30:59.564950982-05:00     response = await self._get_raw_response(prompt, user_messages, temperature, force_json_response)
2024-08-24T21:30:59.564951213-05:00   File "/app/mealie/services/openai/openai.py", line 140, in _get_raw_response
2024-08-24T21:30:59.564951423-05:00     return await client.chat.completions.create(
2024-08-24T21:30:59.564951684-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 1339, in create
2024-08-24T21:30:59.564951904-05:00     return await self._post(
2024-08-24T21:30:59.564953247-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/openai/_base_client.py", line 1816, in post
2024-08-24T21:30:59.564953888-05:00     return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
2024-08-24T21:30:59.564955040-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/openai/_base_client.py", line 1510, in request
2024-08-24T21:30:59.564955651-05:00     return await self._request(
2024-08-24T21:30:59.564956272-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/openai/_base_client.py", line 1611, in _request
2024-08-24T21:30:59.564956924-05:00     raise self._make_status_error_from_response(err.response) from None
2024-08-24T21:30:59.564957525-05:00 openai.BadRequestError: Error code: 400 - {'error': {'message': 'invalid image input', 'type': 'invalid_request_error', 'param': None, 'code': None}}
2024-08-24T21:30:59.565390833-05:00 ERROR    2024-08-25T02:30:59 - OpenAI Request Failed
2024-08-24T21:30:59.565392366-05:00 Traceback (most recent call last):
2024-08-24T21:30:59.565392866-05:00   File "/app/mealie/services/openai/openai.py", line 175, in get_response
2024-08-24T21:30:59.565393297-05:00     response = await self._get_raw_response(prompt, user_messages, temperature, force_json_response)
2024-08-24T21:30:59.565393758-05:00   File "/app/mealie/services/openai/openai.py", line 140, in _get_raw_response
2024-08-24T21:30:59.565394279-05:00     return await client.chat.completions.create(
2024-08-24T21:30:59.565394710-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 1339, in create
2024-08-24T21:30:59.565395111-05:00     return await self._post(
2024-08-24T21:30:59.565395501-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/openai/_base_client.py", line 1816, in post
2024-08-24T21:30:59.565396193-05:00     return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
2024-08-24T21:30:59.565396664-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/openai/_base_client.py", line 1510, in request
2024-08-24T21:30:59.565397054-05:00     return await self._request(
2024-08-24T21:30:59.565397495-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/openai/_base_client.py", line 1611, in _request
2024-08-24T21:30:59.565397896-05:00     raise self._make_status_error_from_response(err.response) from None
2024-08-24T21:30:59.565398307-05:00 openai.BadRequestError: Error code: 400 - {'error': {'message': 'invalid image input', 'type': 'invalid_request_error', 'param': None, 'code': None}}
2024-08-24T21:30:59.566063512-05:00 DEBUG    2024-08-25T02:30:59 - Failed to parse OpenAI response as <class 'mealie.schema.openai.recipe.OpenAIRecipe'>. Response: None
2024-08-24T21:30:59.569010795-05:00 INFO     2024-08-25T02:30:59 - [192.168.11.1:0] 500 Internal Server Error "POST /api/recipes/create-from-image HTTP/1.1"
2024-08-24T21:30:59.574051889-05:00 ERROR    2024-08-25T02:30:59 - Exception in ASGI application
2024-08-24T21:30:59.574055376-05:00 Traceback (most recent call last):
2024-08-24T21:30:59.574055887-05:00   File "/app/mealie/services/recipe/recipe_service.py", line 468, in build_recipe_from_images
2024-08-24T21:30:59.574056468-05:00     openai_recipe = OpenAIRecipe.parse_openai_response(response)
2024-08-24T21:30:59.574056859-05:00   File "/app/mealie/schema/openai/_base.py", line 24, in parse_openai_response
2024-08-24T21:30:59.574057280-05:00     return cls.model_validate_json(response or "")
2024-08-24T21:30:59.574057931-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/pydantic/main.py", line 597, in model_validate_json
2024-08-24T21:30:59.574058742-05:00     return cls.__pydantic_validator__.validate_json(json_data, strict=strict, context=context)
2024-08-24T21:30:59.574059414-05:00 pydantic_core._pydantic_core.ValidationError: 1 validation error for OpenAIRecipe
2024-08-24T21:30:59.574060065-05:00   Invalid JSON: EOF while parsing a value at line 1 column 0 [type=json_invalid, input_value='', input_type=str]
2024-08-24T21:30:59.574061137-05:00     For further information visit https://errors.pydantic.dev/2.8/v/json_invalid
2024-08-24T21:30:59.574061528-05:00 
2024-08-24T21:30:59.574062079-05:00 The above exception was the direct cause of the following exception:
2024-08-24T21:30:59.574063141-05:00 
2024-08-24T21:30:59.574063862-05:00 Traceback (most recent call last):
2024-08-24T21:30:59.574066367-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
2024-08-24T21:30:59.574067238-05:00     result = await app(  # type: ignore[func-returns-value]
2024-08-24T21:30:59.574068210-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2024-08-24T21:30:59.574068972-05:00     return await self.app(scope, receive, send)
2024-08-24T21:30:59.574069713-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
2024-08-24T21:30:59.574070404-05:00     await super().__call__(scope, receive, send)
2024-08-24T21:30:59.574071086-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__
2024-08-24T21:30:59.574071737-05:00     await self.middleware_stack(scope, receive, send)
2024-08-24T21:30:59.574072398-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
2024-08-24T21:30:59.574073029-05:00     raise exc
2024-08-24T21:30:59.574075745-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
2024-08-24T21:30:59.574076536-05:00     await self.app(scope, receive, _send)
2024-08-24T21:30:59.574077237-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
2024-08-24T21:30:59.574078840-05:00     await responder(scope, receive, send)
2024-08-24T21:30:59.574079472-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
2024-08-24T21:30:59.574080073-05:00     await self.app(scope, receive, self.send_with_gzip)
2024-08-24T21:30:59.574080674-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
2024-08-24T21:30:59.574082888-05:00     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2024-08-24T21:30:59.574083509-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-24T21:30:59.574084110-05:00     raise exc
2024-08-24T21:30:59.574084731-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-24T21:30:59.574085313-05:00     await app(scope, receive, sender)
2024-08-24T21:30:59.574085904-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 756, in __call__
2024-08-24T21:30:59.574086495-05:00     await self.middleware_stack(scope, receive, send)
2024-08-24T21:30:59.574087086-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 776, in app
2024-08-24T21:30:59.574087707-05:00     await route.handle(scope, receive, send)
2024-08-24T21:30:59.574088919-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 297, in handle
2024-08-24T21:30:59.574089571-05:00     await self.app(scope, receive, send)
2024-08-24T21:30:59.574090172-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 77, in app
2024-08-24T21:30:59.574090763-05:00     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2024-08-24T21:30:59.574091484-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-24T21:30:59.574092095-05:00     raise exc
2024-08-24T21:30:59.574092686-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-24T21:30:59.574093298-05:00     await app(scope, receive, sender)
2024-08-24T21:30:59.574093899-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 72, in app
2024-08-24T21:30:59.574094510-05:00     response = await func(request)
2024-08-24T21:30:59.574095111-05:00   File "/app/mealie/routes/_base/routers.py", line 35, in custom_route_handler
2024-08-24T21:30:59.574095702-05:00     response = await original_route_handler(request)
2024-08-24T21:30:59.574097145-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 278, in app
2024-08-24T21:30:59.574097966-05:00     raw_response = await run_endpoint_function(
2024-08-24T21:30:59.574098608-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
2024-08-24T21:30:59.574099680-05:00     return await dependant.call(**values)
2024-08-24T21:30:59.574100271-05:00   File "/app/mealie/routes/recipe/recipe_crud_routes.py", line 289, in create_recipe_from_image
2024-08-24T21:30:59.574100882-05:00     recipe = await self.service.create_from_images(images, translate_language)
2024-08-24T21:30:59.574101473-05:00   File "/app/mealie/services/recipe/recipe_service.py", line 270, in create_from_images
2024-08-24T21:30:59.574102044-05:00     recipe_data = await openai_recipe_service.build_recipe_from_images(
2024-08-24T21:30:59.574102615-05:00   File "/app/mealie/services/recipe/recipe_service.py", line 471, in build_recipe_from_images
2024-08-24T21:30:59.574103216-05:00     raise ValueError("Unable to parse recipe from image") from e
2024-08-24T21:30:59.574103817-05:00 ValueError: Unable to parse recipe from image
2024-08-24T21:30:59.574553747-05:00 ERROR    2024-08-25T02:30:59 - Exception in ASGI application
2024-08-24T21:30:59.574555290-05:00 Traceback (most recent call last):
2024-08-24T21:30:59.574555851-05:00   File "/app/mealie/services/recipe/recipe_service.py", line 468, in build_recipe_from_images
2024-08-24T21:30:59.574556281-05:00     openai_recipe = OpenAIRecipe.parse_openai_response(response)
2024-08-24T21:30:59.574556652-05:00   File "/app/mealie/schema/openai/_base.py", line 24, in parse_openai_response
2024-08-24T21:30:59.574557053-05:00     return cls.model_validate_json(response or "")
2024-08-24T21:30:59.574557444-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/pydantic/main.py", line 597, in model_validate_json
2024-08-24T21:30:59.574557794-05:00     return cls.__pydantic_validator__.validate_json(json_data, strict=strict, context=context)
2024-08-24T21:30:59.574558165-05:00 pydantic_core._pydantic_core.ValidationError: 1 validation error for OpenAIRecipe
2024-08-24T21:30:59.574558536-05:00   Invalid JSON: EOF while parsing a value at line 1 column 0 [type=json_invalid, input_value='', input_type=str]
2024-08-24T21:30:59.574558906-05:00     For further information visit https://errors.pydantic.dev/2.8/v/json_invalid
2024-08-24T21:30:59.574559257-05:00 
2024-08-24T21:30:59.574559688-05:00 The above exception was the direct cause of the following exception:
2024-08-24T21:30:59.574560049-05:00 
2024-08-24T21:30:59.574560449-05:00 Traceback (most recent call last):
2024-08-24T21:30:59.574560780-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
2024-08-24T21:30:59.574561131-05:00     result = await app(  # type: ignore[func-returns-value]
2024-08-24T21:30:59.574561642-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2024-08-24T21:30:59.574562062-05:00     return await self.app(scope, receive, send)
2024-08-24T21:30:59.574562413-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
2024-08-24T21:30:59.574562774-05:00     await super().__call__(scope, receive, send)
2024-08-24T21:30:59.574563094-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__
2024-08-24T21:30:59.574563685-05:00     await self.middleware_stack(scope, receive, send)
2024-08-24T21:30:59.574563916-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
2024-08-24T21:30:59.574564156-05:00     raise exc
2024-08-24T21:30:59.574564407-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
2024-08-24T21:30:59.574564657-05:00     await self.app(scope, receive, _send)
2024-08-24T21:30:59.574564878-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
2024-08-24T21:30:59.574565799-05:00     await responder(scope, receive, send)
2024-08-24T21:30:59.574566050-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
2024-08-24T21:30:59.574566330-05:00     await self.app(scope, receive, self.send_with_gzip)
2024-08-24T21:30:59.574566581-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
2024-08-24T21:30:59.574566831-05:00     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2024-08-24T21:30:59.574567052-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-24T21:30:59.574567302-05:00     raise exc
2024-08-24T21:30:59.574567523-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-24T21:30:59.574567773-05:00     await app(scope, receive, sender)
2024-08-24T21:30:59.574567994-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 756, in __call__
2024-08-24T21:30:59.574568234-05:00     await self.middleware_stack(scope, receive, send)
2024-08-24T21:30:59.574568484-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 776, in app
2024-08-24T21:30:59.574568735-05:00     await route.handle(scope, receive, send)
2024-08-24T21:30:59.574568955-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 297, in handle
2024-08-24T21:30:59.574569206-05:00     await self.app(scope, receive, send)
2024-08-24T21:30:59.574569446-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 77, in app
2024-08-24T21:30:59.574569677-05:00     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2024-08-24T21:30:59.574569937-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-24T21:30:59.574570178-05:00     raise exc
2024-08-24T21:30:59.574570398-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-24T21:30:59.574570649-05:00     await app(scope, receive, sender)
2024-08-24T21:30:59.574570969-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 72, in app
2024-08-24T21:30:59.574571240-05:00     response = await func(request)
2024-08-24T21:30:59.574571490-05:00   File "/app/mealie/routes/_base/routers.py", line 35, in custom_route_handler
2024-08-24T21:30:59.574571741-05:00     response = await original_route_handler(request)
2024-08-24T21:30:59.574571981-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 278, in app
2024-08-24T21:30:59.574572242-05:00     raw_response = await run_endpoint_function(
2024-08-24T21:30:59.574572512-05:00   File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
2024-08-24T21:30:59.574573083-05:00     return await dependant.call(**values)
2024-08-24T21:30:59.574573304-05:00   File "/app/mealie/routes/recipe/recipe_crud_routes.py", line 289, in create_recipe_from_image
2024-08-24T21:30:59.574573524-05:00     recipe = await self.service.create_from_images(images, translate_language)
2024-08-24T21:30:59.574573744-05:00   File "/app/mealie/services/recipe/recipe_service.py", line 270, in create_from_images
2024-08-24T21:30:59.574573965-05:00     recipe_data = await openai_recipe_service.build_recipe_from_images(
2024-08-24T21:30:59.574574195-05:00   File "/app/mealie/services/recipe/recipe_service.py", line 471, in build_recipe_from_images
2024-08-24T21:30:59.574574426-05:00     raise ValueError("Unable to parse recipe from image") from e
2024-08-24T21:30:59.574574666-05:00 ValueError: Unable to parse recipe from image

Mealie Version

Image: hkotel/mealie:latest Version: v1.12.0 Build: 0d06494bbfc62fc8a1771a85fd308190891d6167

Deployment

Unraid

Additional Deployment Details

Image used for testing: IMG_20200326_182132

PeterJT commented 2 weeks ago

As an FYI , using OpenAI and the gpt-4o-mini model, I had no issues with that image / recipe.

death2all110 commented 2 weeks ago

Thanks for confirming. I tested calling the API with cURL and that seemed to work with another image, and the working image from cURL does not work in Mealie either. So It does not appear to be an ollama issue, but the way Mealie is calling the API.

Gangoke commented 2 weeks ago

I'm also getting Error 400 Bad Request trying to use ollama (llava) for Create from Image. Parser is working tho so i know Mealie can talk to Ollama. Like you said, must be the way Mealie is calling the API for images.

death2all110 commented 2 weeks ago

@michael-genson (Sorry to tag you directly, but you were the main guy behind the OpenAI implementation, and I figured since I saved you all a bunch of debug and troubleshooting effort, this might be ok.)

After a bunch of troubleshooting and debugging on my end with manually calling the API, it looks like the reason for the 400 bad request is due to the image format. Ollama does not currently support webp, and only supports jpg and png for now: https://github.com/ollama/ollama/issues/2457.

Not sure the feasibility, but would it be possible to either do png/jpg instead of webp, or maybe see that the "OPENAI_BASE_URL" env variable is set, so convert from webp to png/jpg before passing to Ollama?

michael-genson commented 2 weeks ago

Huh, weird. Okay yeah that's an easy fix, I only chose webp because we already convert images to webp in Mealie

death2all110 commented 2 weeks ago

Thank you! I'll keep an eye on it and see if I can test once its merged.

death2all110 commented 2 weeks ago

@boc-the-git @michael-genson would it be possible to get this put into a stable build? like a v1.12.1? Not sure if there are any plans for a another stable build before 2.0 with the households feature (which will break some things for me so I'm currently not on the nightly)

lowlyocean commented 2 weeks ago

Although the initial error has gone away, I'm still seeing 500 Internal Server Error. Has anyone got this working? If so can you share what version Ollama and what model you're using?

death2all110 commented 2 weeks ago

I haven't had a chance to test this, but when I was testing with cURL, debug logs from Ollama mentioned the context was too long so was truncated, I then found bakllava had a larger context size than standard llava, so might try that @lowlyocean

lowlyocean commented 1 week ago

Tried bakllava 7b q4_K_S , , I just keep getting response "no slots available after 10 retries" from Ollama on most attempts, but I saw (only one time) that it returned some JSON reply, having nonsense values. I think the prompt is too large to work on a local model.

If I remove the System role message from the request Mealie generates, it replies more often - but every response is nonsense (and not JSON formatted).

death2all110 commented 1 week ago

Yes, I tried bakllava as well and it didn't work. Using standard llava, but creating a model file with an increased context size 4096 instead of standard 2048, worked. Unfortunately, it still wasn't 100% and would take liberties with what would be generated. (Example peanut butter fudge recipe turned into peanut butter cookies). At this point I'm waiting for ollama to get support for Phi 3.5-Vision which seems impressive from what I have seen. And I hear MiniCPM-V is decent as well, but ollama also has no support for that. Not sure of any other vision models that aren't llava based.