Skip to main content

LLM plugin to save prompt options alongside an alias

Project description

llm-alias-options

LLM plugin to save prompt options alongside an alias.

Built for llm version 0.28.

This plugin allows you to save default prompt options (like temperature, max_tokens, etc.) with an alias, so they are automatically applied when you use that alias.

Installation

Install this plugin in the same environment as LLM:

llm install llm-alias-options

Usage

You can save default prompt options with an alias using the -o or --option flag with llm aliases set:

llm aliases set creative gpt-4o -o temperature 0.9

Now, whenever you use the creative alias, the temperature=0.9 option will be applied automatically:

llm -m creative "Write a story"

The options you specify on the command line will override the saved alias options:

llm -m creative -o temperature 0.5 "Write a story"

Listing aliases with options

To see which aliases have options configured, use the --options flag:

llm aliases list --options

Or just:

llm aliases --options

Output:

creative: gpt-4o
  Options:
    temperature: 0.9

You can also get this information in JSON format:

llm aliases --options --json

How it works

This plugin monkeypatches the core llm alias handling to support a dictionary format in aliases.json. It also wraps the prompt and chat commands to intercept the model ID and inject the saved options before the command executes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_alias_options-0.1.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_alias_options-0.1.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file llm_alias_options-0.1.1.tar.gz.

File metadata

  • Download URL: llm_alias_options-0.1.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for llm_alias_options-0.1.1.tar.gz
Algorithm Hash digest
SHA256 36ba0b23cf097c9bcd92c924fd8378f74c7fe5e0b3fc8677b6f13685276aeabe
MD5 6d0683eaa6d12a3678d3c0e24498398f
BLAKE2b-256 e307a73184eafc0a26b01dcb6206c254335d7ed8e146bf70e21b66fb0d9ac85e

See more details on using hashes here.

File details

Details for the file llm_alias_options-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_alias_options-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa405f15c16749f67a6fcee6f250b9c1cbb39886e63bd33487b5d186b1ae7bb9
MD5 194185f8e4c7fff93ffcf5afb09aca51
BLAKE2b-256 f864fcc7786f5fabcf635a95dab7ac7244a1cf5be4cd8273e29124ee3916e6ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page