Langchain vs native implementation #438
-
need some guidance. I'm trying to use the langchain interface to llama-cpp to stream the model's response. and naturally, using the native node llama-cpp I get the right results. (I would like to use langchain so I can fully utilize the other 'features': tools, agents, etc... I extracted the implementation for testing, below: import { ChatLlamaCpp } from "@langchain/community/chat_models/llama_cpp"; const llamaPath = "../Meta-Llama-3.1-8B-Instruct-IQ2_M.gguf"; async function chat(prompt) {
} chat("Who was Mozart?"); the response any guidance? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It appears that the Langchain integration wasn't implemented correctly to work well with I plan to add better support for Langchain, but I have to finish some other features first on In the meantime, from its implementation it seems that you can use Langchain for all of its capabilities with |
Beta Was this translation helpful? Give feedback.
It appears that the Langchain integration wasn't implemented correctly to work well with
node-llama-cpp
's generic support for all models when using streaming.I see in its implementation that there's a hardcoded chat template syntax used for a specific model, I think Mistral.
I plan to add better support for Langchain, but I have to finish some other features first on
node-llama-cpp
before I get to it.In the meantime, from its implementation it seems that you can use Langchain for all of its capabilities with
node-llama-cpp
if you don't use streaming.