A local language model runs on your own machine instead of sending prompts and data to a hosted service. It supports private-document and data-file querying without transferring content to a third party. section 12.0
Use a local model when:
- Privacy matters for documents, PDFs, JSON, or CSV data. section 12.0
- You can accept greater setup cost, hardware requirements, slower inference, and potentially weaker answers than cloud models. section 7.3.9 section 12.0
from langchain.llms import GPT4All model = 'mistral-7b-openorca.Q4_0.gguf' llm = GPT4All(model = model)
Load the Mistral 7B GGUF model through GPT4All. section 12.2.3
Querying structured data
A prompt can provide a pandas DataFrame schema and require a Python statement in response. LangChain then invokes the local model; the returned statement can query the DataFrame. Mistral 7B may produce extra text or imperfect filters, so inspect generated responses before execution. section 12.2.3

