7814
Ta
tiny-c-agent / files
tiny-c-agent / src / catalog.h
1.6 KB
1// Model metadata generated from models.dev. 2 3#ifndef TINY_CATALOG_H 4#define TINY_CATALOG_H 5 6#include <stdbool.h> 7#include <stddef.h> 8 9// One entry of the compiled-in catalog, describing a model a built-in provider 10// serves. The table itself lives in src/catalog.generated.c; regenerate it with 11// `make catalog` when models.dev changes. 12typedef struct { 13 const char *provider; // built-in provider id 14 const char *id; // model id sent on the wire 15 const char *name; // human-readable name 16 bool supports_images; // whether the model accepts image input 17 long context_limit; // context window in tokens, 0 when unknown 18 long max_output; // maximum reply tokens, 0 when unknown 19 const char *const *effort; // accepted reasoning_effort values; NULL when the 20 size_t effort_len; // model exposes no effort option 21} tiny_model_info; 22 23// Looks up provider/model. Returns NULL when the catalog has no entry, and the 24// caller then falls back to its assumed defaults. 25const tiny_model_info *tiny_catalog_lookup(const char *provider, const char *model); 26 27// Iteration over the compiled-in table, for listing a provider's models. 28size_t tiny_catalog_count(void); 29const tiny_model_info *tiny_catalog_get(size_t index); 30 31// Clamps a desired effort to what `info` accepts, preferring the next higher 32// level when the exact value is unavailable. Returns a level from the entry's 33// own list, or NULL when the desired effort is NULL. When `info` is NULL the 34// desired value is returned unchanged (unknown model). 35const char *tiny_catalog_clamp_effort(const tiny_model_info *info, const char *desired); 36 37#endif