miurla/morphic

[BUG] Fresh build fails with TypeValidationError

AxelFooley opened this issue · 1 comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Just deployed using docker compose and an ollama instance available on the network with model llama2-uncensored.

Software loads fine, i can reach the home page but then every search results in a "Bad Request" error on page and in container logs i see this:

morphic-1  |  POST /search/JFBlcF4 200 in 3779ms
morphic-1  | The streamable value has been slow to update. This may be a bug or a performance issue or you forgot to call `.done()`.

morphic-1  | TypeValidationError [AI_TypeValidationError]: Type validation failed: Value: {"proceed":"Nvidia has been experiencing significant growth due to several factors, including its dominance in the gaming industry and increasing demand for artificial intelligence (AI) and data center technologies. The company's graphics processing units (GPUs) are widely used in gaming consoles and PCs, while its Tesla GPUs are popular with AI researchers and developers. Additionally, Nvidia has been expanding into new markets such as self-driving cars and robotics, which have the potential to drive significant growth in the future."}.
morphic-1  | Error message: [
morphic-1  |   {
morphic-1  |     "expected": "'inquire' | 'proceed'",
morphic-1  |     "received": "undefined",
morphic-1  |     "code": "invalid_type",
morphic-1  |     "path": [
morphic-1  |       "next"
morphic-1  |     ],
morphic-1  |     "message": "Required"
morphic-1  |   }
morphic-1  | ]
morphic-1  |     at safeValidateTypes (/app/.next/server/chunks/ssr/node_modules_cf7988._.js:2282:20)
morphic-1  |     at safeParseJSON (/app/.next/server/chunks/ssr/node_modules_cf7988._.js:2327:16)
morphic-1  |     ... 3 lines matching cause stack trace ...
morphic-1  |     at async processEvents (/app/.next/server/chunks/ssr/[root of the server]__3f2901._.js:2618:29) {
morphic-1  |   cause: ZodError: [
morphic-1  |     {
morphic-1  |       "expected": "'inquire' | 'proceed'",
morphic-1  |       "received": "undefined",
morphic-1  |       "code": "invalid_type",
morphic-1  |       "path": [
morphic-1  |         "next"
morphic-1  |       ],
morphic-1  |       "message": "Required"
morphic-1  |     }
morphic-1  |   ]
morphic-1  |       at get error [as error] (/app/.next/server/chunks/ssr/node_modules_zod_lib_index_mjs_8e7072._.js:665:31)
morphic-1  |       at safeValidateTypes (/app/.next/server/chunks/ssr/node_modules_cf7988._.js:2284:41)
morphic-1  |       at safeParseJSON (/app/.next/server/chunks/ssr/node_modules_cf7988._.js:2327:16)
morphic-1  |       at generateObject (/app/.next/server/chunks/ssr/_68d4f9._.js:2509:231)
morphic-1  |       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
morphic-1  |       at async taskManager (/app/.next/server/chunks/ssr/[root of the server]__3f2901._.js:1365:24)
morphic-1  |       at async processEvents (/app/.next/server/chunks/ssr/[root of the server]__3f2901._.js:2618:29) {
morphic-1  |     issues: [ [Object] ],
morphic-1  |     addIssue: [Function (anonymous)],
morphic-1  |     addIssues: [Function (anonymous)],
morphic-1  |     errors: [ [Object] ]
morphic-1  |   },
morphic-1  |   value: {
morphic-1  |     proceed: "Nvidia has been experiencing significant growth due to several factors, including its dominance in the gaming industry and increasing demand for artificial intelligence (AI) and data center technologies. The company's graphics processing units (GPUs) are widely used in gaming consoles and PCs, while its Tesla GPUs are popular with AI researchers and developers. Additionally, Nvidia has been expanding into new markets such as self-driving cars and robotics, which have the potential to drive significant growth in the future."
morphic-1  |   }
morphic-1  | }
morphic-1  |  POST /search/JFBlcF4 200 in 1952ms

Expected Behavior

I can see the answer on screen

Steps To Reproduce

Deploy using docker compose provided file
Configure env file using a local instance of ollama serving llama2-uncensored model
Do a search

Environment

- OS: Docker
- Browser: Brave Browser

Anything else?

No response

This error occurs when the LLM is unable to produce output with the correct structure.
Currently, the Ollama provider is unstable. For more details, please check the following issue: #215

Try using a different model or attempt with a different provider.