tools capa

tools-local-model-import

Finds model files already downloaded to disk, lists them numbered, and imports the chosen one into Ollama as a PRIVATE-ONLY model: recorded in a manifest outside every project directory, so a front-end can offer it in local-model mode and nowhere else. Argument-vector subprocess only, bounded walk, no shell.

Finds model files already downloaded to disk, lists them numbered, and imports the chosen one into Ollama as a PRIVATE-ONLY model: recorded in a manifest outside every project directory, so a front-end can offer it in local-model mode and nowhere else. Argument-vector subprocess only, bounded walk, no shell.

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/local-model-import
Edition2021
Targetstools-local-model-import
Public items0 across 0 modules
Tests10

What it is for

Import a model file the operator already downloaded into Ollama, and mark it private-only.

The shape is deliberate: a big model arrives in ~/Downloads the way everything else does, and the operator should not have to hand-write a Modelfile, guess a name, or remember where it went. scan prints a numbered list; install <N> imports that one and restarts the service.

Private-only is the point, not a label. Every model imported here is recorded in a manifest under ~/.config/imp/, deliberately outside every project directory — the same reasoning as the never-send list, so an agent's own sandboxed file tools cannot read it. A front-end reads that manifest to offer these models in local-model mode and nowhere else.

Gate 1.5.6, stated before the code: 1. Input limits — the scan root is canonicalized and must sit under $HOME; the walk is depth- and entry-capped; every candidate is re-canonicalized and must still be under the root, so a symlink cannot point the import outside it. 2. Subprocessfoundation-bounded-io::exec::BoundedCommand only: binary path plus argument vector, wall-clock timeout, output caps. There is no shell form to misuse. The ollama binary path is allowlisted and must resolve to an existing file. 3. Advisory locks — N/A. This is a single-operator tool against a local daemon; there is no tenant keyspace to collide in. 4. Batch failure — one model per run. If ollama create fails, the manifest is not written: no partial record of an import that did not happen.

The operator's downloaded file is never moved, renamed, or modified. The generated Modelfile points AT it.

Capabilities

No public items.

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

No public items.

No pub use re-exports: every item above is declared in this crate.

Boundary

Reaches into foundation.

Shares tier tools with 84 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (84 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)tools
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/tools/local-model-import
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_tools["tools"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-bounded-io`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways
tokio^1macros, rt-multi-thread, process, time, io-utilnoalways

Development. None.

Build. None.

Depended on by. Nothing in this workspace.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  SELF["tools-local-model-import"]
  SELF -->|runtime| n_foundation_bounded_io["foundation-bounded-io"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
bintools-local-model-import`src/main.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimeyes
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
HOMEsrc/main.rs
OLLAMA_BINsrc/main.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests10
Integration tests0
Examples0
Doctests0

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc00
Public modules with a //! block00

Metrics

MetricValue
Rust source files1
Source lines696
Code lines562
Public API items0
Public modules0
Tests10
Examples0
Cargo features0
Direct runtime dependencies3
Workspace reverse dependencies0
pie showData
    title Rust source composition
    "Code" : 562
    "Blank or comment" : 134

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las tools · Manual