Add preliminary README

This commit is contained in:
2025-06-28 20:43:50 +02:00
parent 60f6f9e55a
commit 88dd89a3ed
6 changed files with 140 additions and 3 deletions

View File

@@ -4,18 +4,22 @@ import com.pablotj.ia.chat.boot.domain.exception.BusinessLogicException;
import de.kherud.llama.LlamaModel;
import de.kherud.llama.ModelParameters;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class LlmModelLoader implements AutoCloseable {
@Value(value = "${model.gguf.name}")
private String modelName;
private LlamaModel model;
@PostConstruct
public void init() {
try {
ModelParameters params = new ModelParameters()
.setModelFilePath("models/openchat-3.5-0106.Q4_K_M.gguf")
.setModelFilePath(String.format("models/%s.gguf", modelName))
.setSeed(42)
.setNThreads(8)
.setNGpuLayers(0)

View File

@@ -1,2 +1,5 @@
spring.application.name = ia-chat-boot
server.port = 8080
! Model
model.gguf.name = openchat-3.5-0106.Q4_K_M