Enable Auto Model Downloading¶
By default, CreateAgent fails immediately if a model referenced by the
graph is not already on disk. This is the right behaviour for production —
you control exactly what is installed and when. During development and
prototyping, however, it adds friction: you must list models, identify
which ones are missing, download them, and only then create an agent.
The allow_auto_model_downloading session flag removes that ceremony.
When enabled, CreateAgent automatically downloads any missing models
before building the graph, at the cost of a longer first call.
Development flag
This flag is intended for local development and prototyping only. Do not enable it in production. Unpredictable network latency, disk-space exhaustion, or catalog mismatches are all harder to handle gracefully in production code than they are with an explicit download-then-create flow.
Quick start¶
C++¶
client.ConfigureSession(Tryll::Client::InferenceEngine::Llama,
/*allowAutoModelDownloading=*/true);
// No pre-download step needed — CreateAgent handles it.
auto agent = client.CreateAgent(graph);
Python¶
client.configure_session(
engine=tryll_client.InferenceEngine.LLAMA,
allow_auto_model_downloading=True,
)
# No pre-download step needed — create_agent handles it.
agent = client.create_agent(graph)
Unity¶
bool autoDownload = TryllRuntimeSettings.Load().AllowAutoModelDownloading;
TryllClient.Instance.ConfigureSession(TryllInferenceEngine.Llama, autoDownload);
// No pre-download step needed — CreateAgent handles it.
var agent = await TryllClient.Instance.CreateAgentAsync(graph);
Tick the Allow Auto Model Downloading checkbox in
Project Settings → Tryll Client to enable it without changing code.
This toggles the AllowAutoModelDownloading field on TryllRuntimeSettings,
which you then pass into ConfigureSession as shown above.
Tip
Commit the TryllRuntimeSettings asset with the flag set to false
so team members default to the explicit download flow. Individual
developers can override it locally.
Unreal¶
TryllSubsystem->ConfigureSession(
ETryllInferenceEngine::Llama,
/*bAllowAutoModelDownloading=*/true);
// No pre-download step needed — CreateAgent handles it.
TryllSubsystem->CreateAgent(Graph, ...);
The flag is also exposed as
UTryllRuntimeSettings::bAllowAutoModelDownloading in
Project Settings → Plugins → Tryll Client, so you can flip it
without touching code.
What happens under the hood¶
ConfigureSessionstores the flag for the lifetime of the session (until the nextConfigureSessioncall or the socket is closed).- When
CreateAgentarrives, the server inspects every node in the graph and collects the list of models it references (NodeFactory::CollectRequirements). - Each model is classified:
- On disk — nothing to do, proceed immediately.
- Absent, repo configured — download it first.
- Absent, no repo — fail immediately with
ErrorResponse(ModelAutoDownloadFailed). - Downloads proceed sequentially. While each download runs, the server
streams
DownloadProgressframes back to the client using the samerequest_idas theCreateAgentcall (see progress frames below). - Once all downloads finish, the graph is compiled and
CreateAgentResponseis sent.
Progress frames¶
Because download progress is reported through the same
DownloadProgress message type used by DownloadModelRequest, existing
client-side progress handlers already work without changes. The frames
arrive on the CreateAgent request_id, not a separate one.
Note
The terminal frame for the CreateAgent request is always
CreateAgentResponse (on success) or ErrorResponse (on failure) —
never DownloadComplete.
Timeouts¶
Downloading a model can take minutes. When allow_auto_model_downloading
is set, the Tryll client libraries automatically extend the default
CreateAgent timeout from 30 seconds to 30 minutes. You can still
pass an explicit timeout to override this:
// C++: explicit 10-minute override
auto agent = client.CreateAgent(graph, {}, std::chrono::minutes(10));
Error handling¶
| Error | Meaning | Recovery |
|---|---|---|
ModelAutoDownloadFailed (6006) |
A required model has no download source (no huggingface_repo configured in the catalog), or the transfer failed. |
Check ErrorResponse.message for the model name. Add the model to the catalog or fix the network issue, then retry. |
GraphCompilationFailed (3003) |
The graph itself is invalid (independent of model availability). | Fix the graph description. |
Related¶
- How-to: Pin and unpin models — explicit model lifecycle management, recommended for production.
- Reference: Model Management — catalog schema, download flow, model status enum.
- Reference: Error Codes — full error catalog.