Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
download.cpp File Reference

entropic download subcommand — fetch GGUF models to the canonical install path. More...

#include <entropic/config/bundled_models.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <filesystem>
#include <string>
#include <sys/wait.h>
#include <unistd.h>
Include dependency graph for download.cpp:

Go to the source code of this file.

Classes

struct  entropic::cli::DownloadArgs
 

Namespaces

namespace  entropic
 Activate model on GPU (WARM → ACTIVE).
 

Functions

DownloadArgs entropic::cli::parse_download_args (int argc, char *argv[])
 Parse command-line args for entropic download.
 
const entropic::config::BundledModelEntryentropic::cli::resolve_entry (const entropic::config::BundledModels &registry, const std::string &key)
 Resolve a registry entry by key with user-friendly error output.
 
int entropic::cli::fetch_to (const entropic::config::BundledModelEntry &entry, const std::filesystem::path &target_dir, const std::string &key)
 Download one registry entry to a target directory.
 
int entropic::cli::fetch_mmproj_if_paired (const entropic::config::BundledModelEntry &entry, const entropic::config::BundledModels &registry, const std::filesystem::path &target_dir)
 Paired-mmproj follow-up fetch (gh#42, v2.1.8).
 
int entropic::cli::dispatch (const DownloadArgs &args, const entropic::config::BundledModels &registry)
 Handle entropic download subcommand.
 
int entropic::cli::run_download (int argc, char *argv[])
 Handle entropic download subcommand.
 

Detailed Description

entropic download subcommand — fetch GGUF models to the canonical install path.

Simulates what the Python wheel's cli_download.py does, for tarball consumers who don't have pip. Shells out to curl — always present on Linux targets, avoids linking libcurl or an SSL backend into the main library.

Usage: entropic download <model-key> # e.g., entropic download primary entropic download –list # list available keys entropic download –dir DIR <key> # override target directory

Target: $ENTROPIC_MODEL_DIR → ~/.entropic/models → /opt/entropic/models (first writable; default ~/.entropic/models). Skips the download if the target file already exists and is non-empty, so reruns are cheap.

Version
2.0.5

Definition in file download.cpp.

Function Documentation

◆ dispatch()

int entropic::cli::dispatch ( const DownloadArgs args,
const entropic::config::BundledModels registry 
)

Handle entropic download subcommand.

Parameters
argcargc-like count starting at subcommand name.
argvargv-like vector starting at subcommand name.
Returns
0 on success, non-zero on usage/runtime error.

Dispatch after args parsed + registry loaded. @utility

Returns
Subcommand exit code.
Version
2.1.8

Definition at line 261 of file download.cpp.

◆ fetch_mmproj_if_paired()

int entropic::cli::fetch_mmproj_if_paired ( const entropic::config::BundledModelEntry entry,
const entropic::config::BundledModels registry,
const std::filesystem::path &  target_dir 
)

Paired-mmproj follow-up fetch (gh#42, v2.1.8).

If entry.mmproj_key names a registry entry, downloads it into the same target_dir as the base model. Best-effort: missing paired key returns 0 (text-only mode still works); a failed download propagates the curl exit code so the caller surfaces it.

Parameters
entryAlready-downloaded base model entry.
registryBundled models registry.
target_dirDirectory the base GGUF landed in.
Returns
0 on success or no-pairing, non-zero on mmproj fetch error. @utility
Version
2.1.8

Definition at line 232 of file download.cpp.

◆ fetch_to()

int entropic::cli::fetch_to ( const entropic::config::BundledModelEntry entry,
const std::filesystem::path &  target_dir,
const std::string &  key 
)

Download one registry entry to a target directory.

@utility

Returns
0 on success (or already-present), non-zero on failure.
Version
1

Definition at line 180 of file download.cpp.

◆ parse_download_args()

DownloadArgs entropic::cli::parse_download_args ( int  argc,
char *  argv[] 
)

Parse command-line args for entropic download.

@utility

Returns
Parsed args with .error=true on malformed input.
Version
1

Definition at line 128 of file download.cpp.

◆ resolve_entry()

const entropic::config::BundledModelEntry * entropic::cli::resolve_entry ( const entropic::config::BundledModels registry,
const std::string &  key 
)

Resolve a registry entry by key with user-friendly error output.

@utility

Returns
Pointer to entry, or nullptr on failure (message printed).
Version
1

Definition at line 154 of file download.cpp.

◆ run_download()

int entropic::cli::run_download ( int  argc,
char *  argv[] 
)

Handle entropic download subcommand.

Parameters
argcargc-like count starting at subcommand name.
argvargv-like vector starting at subcommand name.
Returns
0 on success, non-zero on usage/runtime error.

Definition at line 296 of file download.cpp.