spit Program ¶spit [option...]
The spit program
passes its input to a Large Language Model (LLM) instance
and prints the response.
With the --to option,
it translates its input to the specified language
through a Large Language Model (LLM) and prints the translation.
Warning: The output might not be what you expect. It might be of the wrong form, be of poor quality, or reflect some biases.
Specifies the type of Large Language Model execution engine.
The default and only valid value is ollama.
Specifies the URL of the server that runs Large Language Model execution engine.
For ollama, the default is http://localhost:11434.
Specifies the model to use. This option is mandatory; no default exists. The specified model must already be installed in the Large Language Model execution engine.
Specifies the target language.
language may be specified
as an ISO 639 language code (such as fr for French),
as a combination of an ISO 639 language code and an ISO 3166 country code
(such as fr_CA for French in Canada,
or zh_TW for traditional Chinese),
or as the English name of a language (such as French).
The effect of this option is to add a prompt similar to "Translate to language:".
Specifies the prompt to use before the input that comes from standard input. It allows you to specify extra instructions for the LLM.
This option overrides the --to option.
Specifies a command to post-process the output. This should be a Bourne shell command that reads from standard input and writes to standard output.
For instance, the ministral-3:14b model
often emphasizes part of the output with ‘**’ characters.
To eliminate these markers,
you could use the command ‘sed -e 's/[*][*]//g'’.
Machine translation of a single sentence:
$ echo 'Translate into German: "Welcome to the GNU project!"' \
| spit --model=ministral-3:14b \
--postprocess="sed -e 's/[*][*]//g'"
"Willkommen zum GNU-Projekt!"
The perfect translation would be "Willkommen beim GNU-Projekt!".
You can see: some manual adjustment after the machine translation is needed.