pub struct ModelRef {
pub provider: String,
pub target: String,
}Expand description
Where a job’s model comes from.
Deliberately not an enum of known providers. Inference can come from a local Ollama, an OpenAI-compatible HTTP endpoint, an embedded llama.cpp, or something not thought of yet, and this crate has no business knowing which of those exist — it parses job descriptions.
So a model reference is a provider name and a target, and resolving one into something that can actually generate is the host’s job, via its backend registry. Adding a provider therefore touches neither this type nor the parser: an unknown provider is a resolution error naming what is available, not a syntax error.
In a spec this is written model = Provider "target":
model = Ollama "llama3.2:1b"; // a local Ollama
model = OpenAi "http://host/v1#gpt-4"; // an OpenAI-compatible endpoint
model = Path "./models/qwen.gguf"; // a local file, for embedded runtimesFields§
§provider: StringWhich backend should serve this, lowercased — ollama, path, stub.
Lowercased at parse time so that Ollama and OLLAMA name the same
provider; a spec should not fail over capitalisation.
target: StringWhat to ask that backend for. Its meaning belongs entirely to the provider: a model tag for Ollama, a filesystem path for an embedded runtime, a URL for an HTTP endpoint.