Class Introduction
Function
Interconnects with LLM parameters. The valid value of each parameter varies depending on model configurations.
Prototype
from mx_rag.llm import LLMParameterConfig LLMParameterConfig(max_tokens, presence_penalty, frequency_penalty, temperature, top_p, seed, stream)
Parameters
Example
from mx_rag.llm import Text2TextLLM, LLMParameterConfig
from mx_rag.utils import ClientParam
llm = Text2TextLLM(base_url="https://{ip}:{port}/v1/chat/completions",
model_name="qianwen-7b",
llm_config=LLMParameterConfig(max_tokens=512),
client_param=ClientParam(ca_file="/path/to/ca.crt")
)
res = llm.chat("Please introduce Beijing.")
print(res)
for res in llm.chat_streamly("Please introduce Beijing."):
print(res)
Parent topic: LLMParameterConfig