LLM model definition for Candil.
A model is either local (a .gguf file on disk served by a local
engine) or remote (a model name offered by a remote provider such as
OpenAI or Anthropic).
Local model fields
:alias— unique atom identifier:type—:local:model_dir— directory where the model file is stored:filename— file name of the.ggufmodel (e.g."llama-3-8b.gguf"):download_url— URL to download the model from (HuggingFace, etc.):context_size— context window in tokens (default:4096):engine— atom alias of theCandil.Engineto use:usage— list of intended usages (see below):model_args— extra CLI args passed to the engine at model load time
Remote model fields
:alias— unique atom identifier:type—:remote:name— provider model ID (e.g."gpt-4o","claude-opus-4-5"):context_size— context window in tokens:provider— atom alias of theCandil.Providerto use:usage— list of intended usages
Usage types
:chat, :completion, :embeddings, :reasoning, :vision,
:code, :translation, :summarisation
Summary
Functions
Returns true if the model file exists on disk.
Returns the full path to the model file on disk.
Returns all valid usage type atoms.
Validates a model struct. Returns :ok or {:error, [reasons]}.
Types
@type model_type() :: :local | :remote
@type usage() ::
:chat
| :completion
| :embeddings
| :reasoning
| :vision
| :code
| :translation
| :summarisation
Functions
Returns true if the model file exists on disk.
Always returns false for remote models.
Returns the full path to the model file on disk.
Returns nil for remote models.
@spec usage_types() :: [usage()]
Returns all valid usage type atoms.
Validates a model struct. Returns :ok or {:error, [reasons]}.