|
|
|
|
|
LLM_TYPE = "llama_cpp" |
|
|
|
|
|
MODEL_PATH = None |
|
|
|
LLM_CONFIG_LLAMA_CPP = { |
|
"llm_type": "llama_cpp", |
|
"model_path": MODEL_PATH, |
|
"n_ctx": 20000, |
|
"n_gpu_layers": 0, |
|
"n_threads": 8, |
|
"temperature": 0.7, |
|
"top_p": 0.9, |
|
"top_k": 40, |
|
"repeat_penalty": 1.1, |
|
"max_tokens": 1024, |
|
"stop": ["User:", "\n\n"] |
|
} |
|
|
|
|
|
LLM_CONFIG_OLLAMA = { |
|
"llm_type": "ollama", |
|
"base_url": "http://localhost:11434", |
|
"model_name": "ollama model name", |
|
"temperature": 0.7, |
|
"top_p": 0.9, |
|
"n_ctx": 20000, |
|
"stop": ["User:", "\n\n"] |
|
} |
|
|
|
def get_llm_config(): |
|
if LLM_TYPE == "llama_cpp": |
|
return LLM_CONFIG_LLAMA_CPP |
|
elif LLM_TYPE == "ollama": |
|
return LLM_CONFIG_OLLAMA |
|
else: |
|
raise ValueError(f"Invalid LLM_TYPE: {LLM_TYPE}") |
|
|