hecate_plugin_llm (hecate_sdk v0.6.2)
View SourceLLM access for plugins via the daemon's serve_llm domain.
Provides capability-based model selection so plugins never hardcode model names. Delegates all LLM operations to the daemon's chat_to_llm and manage_providers modules.
Capabilities
Models are classified into three tiers:
- fast — Smallest, fastest models. Good for classification, extraction, simple Q&A. (e.g. Haiku, GPT-4o-mini, small local)
- balanced — Mid-tier models. Good for most tasks: summarization, code generation, analysis. (e.g. Sonnet, GPT-4o, medium local)
- smart — Largest, most capable models. Good for complex reasoning, planning, architecture. (e.g. Opus, o1/o3, large local)
Usage
{ok, Model} = hecate_plugin_llm:select_model(#{capability => balanced}),
{ok, Reply} = hecate_plugin_llm:chat(Model, [
#{role => <<"user">>, content => <<"Summarize this document">>}
]).
Summary
Functions
Send a chat completion request.
Send a chat completion request with options.
Start a streaming chat completion.
List all models available through the daemon's providers.
Select a model by capability tier.
Types
Functions
Send a chat completion request.
Send a chat completion request with options.
Opts may include telemetry fields: venture_id, division_id, agent_id, task_id.
Start a streaming chat completion.
Returns {ok, Ref}. The calling process receives messages: {llm_chunk, Ref, ChunkMap} {llm_done, Ref, FinalMap} {llm_error, Ref, Reason}
List all models available through the daemon's providers.
-spec select_model(#{capability := capability(), _ => _}) -> {ok, binary()} | {error, term()}.
Select a model by capability tier.
Queries the daemon's available models, classifies each by capability, and returns the best match.
Options: capability — fast | balanced | smart (required) provider — binary(), restrict to a specific provider (optional)
Returns the model name (binary) suitable for chat/2,3.