You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Projects using ChatOllama have a default keepAlive added if the client has not set it. This overrides the value set by other clients or the server. If the ChatOllama client doesn't explicitly set keepAlive, the langchainjs library should not set it.
For example, by default my ollama server is set to never unload a model:
If I use the langchainjs library and explicitly set a timeout, it works as expected:
$ 2>&- node --loader ts-node/esm ollama.ts 1800Response: 2 + 2 = 4
$ ollama psNAME ID SIZE PROCESSOR UNTIL llama3.2:latest a80c4f17acd5 3.1 GB 100% GPU 29 minutes from now
If the langchainjs client doesn't set a keepAlive value, the expectation is the value previously set for the model should remain unchanged, but that's not the case:
$ 2>&- node --loader ts-node/esm ollama.ts Response: 2 + 2 = 4.
$ ollama psNAME ID SIZE PROCESSOR UNTIL llama3.2:latest a80c4f17acd5 3.1 GB 100% GPU 4 minutes from now
Hey @rick-github! I'm here to help you with any bugs, questions, or if you'd like to become a contributor. Let's tackle this issue together!
I found a similar discussion regarding the keepAlive setting in LangChain.js. The issue was that the library sets a default keepAlive value for ChatOllama to "5m" when the client does not explicitly set it. This behavior can override the server's settings, which might not be desirable in all cases [1].
In the discussion, it was noted that upgrading to Node.js version 20 resolved a related issue with the UND_ERR_HEADERS_TIMEOUT error, which might be relevant if you're experiencing similar timeout issues [2].
If you want to avoid the default keepAlive setting, you might consider explicitly setting it to undefined or another value that aligns with your server's configuration. However, as of now, there doesn't seem to be a built-in option in LangChain.js to disable the default keepAlive behavior entirely.
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
No response
Description
Projects using ChatOllama have a default
keepAlive
added if the client has not set it. This overrides the value set by other clients or the server. If the ChatOllama client doesn't explicitly setkeepAlive
, the langchainjs library should not set it.For example, by default my ollama server is set to never unload a model:
If I use the langchainjs library and explicitly set a timeout, it works as expected:
If the langchainjs client doesn't set a
keepAlive
value, the expectation is the value previously set for the model should remain unchanged, but that's not the case:System Info
platform: linux
The text was updated successfully, but these errors were encountered: