summaryrefslogtreecommitdiff
path: root/models.h
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-02-12 20:57:17 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-02-12 20:57:17 +0100
commitb333b06772c89d96aacb5490d6a219fba7c09cc6 (patch)
tree211df60083a5946baa2ed61d33d8121b7e251b06 /models.h
downloadllmnpc-b333b06772c89d96aacb5490d6a219fba7c09cc6.tar.gz
Engage!
Diffstat (limited to 'models.h')
-rw-r--r--models.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/models.h b/models.h
new file mode 100644
index 0000000..2e1edb7
--- /dev/null
+++ b/models.h
@@ -0,0 +1,45 @@
+#ifndef MODELS_H
+#define MODELS_H
+
+#include "llama.h"
+#include <stddef.h>
+#include <string.h>
+
+typedef struct {
+ const char *name;
+ const char *filepath;
+ int n_gpu_layers;
+ bool use_mmap;
+ int n_ctx;
+ int n_batch;
+ bool embeddings;
+ float temperature;
+ float min_p;
+ uint32_t seed;
+} model_config;
+
+model_config models[] = {
+ {
+ .name = "flan-t5-small",
+ .filepath = "models/flan-t5-small.F16.gguf",
+ .n_gpu_layers = 0,
+ .use_mmap = false,
+ .n_ctx = 512,
+ .n_batch = 512,
+ .embeddings = false,
+ .temperature = 0.8f,
+ .min_p = 0.05f,
+ .seed = LLAMA_DEFAULT_SEED,
+ },
+};
+
+const model_config *get_model_by_name(const char *name) {
+ for (size_t i = 0; i < sizeof(models) / sizeof(models[0]); i++) {
+ if (models[i].name != NULL && strcmp(models[i].name, name) == 0) {
+ return &models[i];
+ }
+ }
+ return NULL;
+}
+
+#endif