LLamaCPP model seems to require model parameters to be set at model creation, not invocation of chain using model
Labels: name: stale

### System Info

Langchain 0.0.202, langchainplus-sdk 0.0.10, Python 3.10.11, Linux, Fedora 36

### Who can help?

@hwchase17

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [X] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Load the model with the following code. I'm arbitrarily using the Manticore-13B.ggmlv3.q4_0.bin model downloaded from HuggingFace 
```
 def llamaCppLoader(self):
        Globals().logMessage('Loading LlamaCpp model')
        loadPath = self._modelPath + "/Manticore-13B.ggmlv3.q4_0.bin"
        startTime = time.time()
        model = LlamaCpp(model_path=loadPath, streaming=True, max_tokens=15, temperature=.001, n_threads=20, n_ctx=2048, callbacks=[ResultCallback()])
        elapsedTime = time.time() - startTime
        logMessage = f'Loaded model and tokenizer in {elapsedTime:.3f} seconds'
        Globals().logMessage(logMessage)
        Globals().setModel(model)
        Globals().setTokenizer(None)
~~~
Run the query using the following code
~~~
 def runLlamaCppQuery(self):
        model = Globals().getModel()
        params = {}
        params['max_tokens'] = self._maxNewTokens
        params['repeat_penalty'] = self._repetitionPenalty
        params['temperature'] = self._temperature
        params['top_k'] = self._topK
        params['top_p'] = self._topP 
        params['verbose'] = True
        params['n_ctx'] = 1024
        params['n_threads'] = 20
        queryStop = StoppingCriteriaList([QueryStop()])
        Globals().setStopQuery(False)
        startTime = time.time()
        Globals().logMessage('Starting query')
        chain = RetrievalQA.from_chain_type(llm=Globals().getModel(), chain_type='stuff', 
                                            retriever=Globals().getDocumentStore().as_retriever(search_kwargs={'k': self._numMatches}, kwargs=params))
        result = chain.run(query=self._query)
        endTime = time.time()
        elapsedTime = endTime - startTime
        Globals().logMessage(f'Completed query in {elapsedTime:.3f} seconds'
~~~


### Expected behavior

I'm writing a program that I can load a set of documents into a vector index (FAISS) and then run a 
RetrievalQA chain to ask questions about the document(s) I've loaded. I seem to have this working when 
I load regular models or GPTQ models, where I'm using HuggingFace APIs to do this.

I have this sort of working where I'm using Langchain APIs to load a LLamaCPP model and then
create and run a RetrievalQA chain to run the query.

I'm doing this as a  learning exercise to learn about AI and LLMs, so it's possible I'm doing something 
wrong, or maybe I'm running into a philosophical difference between how the HuggingFace APIs work 
and how Langchain APIs work.

The problem I am encountering is that it seems that with Langchain, I have to set the model parameters such as temperature, topP, topK, max_tokens, etc at the time I load the model (llamaCppLoader) 
and that they are ignored if I specify them when I create and run the RetrievalQA 
chain (runLlamaCppQuery).

I noticed this with max_tokens, where if I set it to a small value like 15 when I load the model and 
then a larger value like 2000 when I create the RetrievalQA chain. The query result I get is short, 
about 15 words, even though I override it to 2000 when I create the RetrievalQA chain.

Maybe this is the way it is supposed to work, but then it seems a bit cumbersome since this 
seems to mean I need to reload the model each time I run a new query, while I don't when 
using the HuggingFace APIs for the other model types.

Also, if I pass an invalid parameter name when I create the RetrievalQA chain, it does not get
 flagged as an invalid parameter. For instance,
```
params['xxx'] = 'junk'
~~~
 does not get flagged.