mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Ollama: add description
This commit is contained in:
@@ -200,8 +200,18 @@ export const llmOllamaRouter = createTRPCRouter({
|
||||
const [modelName, modelTag] = model.name.split(':');
|
||||
|
||||
// pretty label and description
|
||||
const label = capitalizeFirstLetter(modelName) + ((modelTag && modelTag !== 'latest') ? ` · ${modelTag}` : '');
|
||||
const description = OLLAMA_BASE_MODELS[modelName]?.description ?? 'Model unknown';
|
||||
const label = capitalizeFirstLetter(modelName) + ((modelTag && modelTag !== 'latest') ? ` (${modelTag})` : '');
|
||||
let description = OLLAMA_BASE_MODELS[modelName]?.description ?? 'Model unknown';
|
||||
|
||||
// prepend the parameters count and quantization level
|
||||
if (model.details?.quantization_level || model.details?.format || model.details?.parameter_size) {
|
||||
let firstLine = model.details.parameter_size ? `${model.details.parameter_size} parameters ` : '';
|
||||
if (model.details.quantization_level)
|
||||
firstLine += `(${model.details.quantization_level}` + ((model.details.format) ? `, ${model.details.format})` : ')');
|
||||
if (model.size)
|
||||
firstLine += `, ${Math.round(model.size / 1024 / 1024).toLocaleString()} MB`;
|
||||
description = firstLine + '\n\n' + description;
|
||||
}
|
||||
|
||||
/* Find the context window from the 'num_ctx' line in the parameters string, if present
|
||||
* - https://github.com/enricoros/big-AGI/issues/309
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
|
||||
/*const wireOllamaModelDetailsSchema = z.object({
|
||||
const wireOllamaModelDetailsSchema = z.object({
|
||||
parent_model: z.string().optional(),
|
||||
format: z.string().optional(), // e.g. gguf
|
||||
family: z.string().optional(), // e.g. llama, phi2, stablelm
|
||||
families: z.array(z.string()).nullable().optional(),// e.g. null, [llama], [phi2]
|
||||
// families: z.array(z.string()).nullable().optional(),// e.g. null, [llama], [phi2]
|
||||
parameter_size: z.string().optional(), // e.g. 7B, 3B, 34B, 6B, 30B
|
||||
quantization_level: z.string().optional(), // e.g. Q4_0, Q8_0, F16, ...
|
||||
}).optional();*/
|
||||
});
|
||||
|
||||
/**
|
||||
* List Local Models (/api/tags) - Response
|
||||
@@ -31,7 +31,7 @@ export const wireOllamaModelInfoSchema = z.object({
|
||||
modelfile: z.string(),
|
||||
parameters: z.string().optional(),
|
||||
template: z.string().optional(),
|
||||
// details: wireOllamaModelDetailsSchema.optional(),
|
||||
details: wireOllamaModelDetailsSchema.nullable().optional(),
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user