Model aliases#

LLM supports model aliases, which allow you to refer to a model by a short name instead of its full ID.

Listing aliases#

To list current aliases, run this:

llm aliases

Example output:

4o           : gpt-4o
4o-mini      : gpt-4o-mini
4.1          : gpt-4.1
4.1-mini     : gpt-4.1-mini
ada          : text-embedding-ada-002 (embedding)
ada-002      : text-embedding-ada-002 (embedding)
3-small      : text-embedding-3-small (embedding)
3-large      : text-embedding-3-large (embedding)
3-small-512  : text-embedding-3-small-512 (embedding)
3-large-256  : text-embedding-3-large-256 (embedding)
3-large-1024 : text-embedding-3-large-1024 (embedding)

Add --json to get that list back as JSON:

llm aliases list --json

Example output:

{
    "4o": "gpt-4o",
    "4o-mini": "gpt-4o-mini",
    "ada": "ada-002"
}

Adding a new alias#

The llm aliases set <alias> <model-id> command can be used to add a new alias:

llm aliases set luna gpt-6-luna

You can also pass one or more -q search options to set an alias on the first model matching those search terms:

llm aliases set luna -q gpt-6 -q luna

Now you can run the gpt-6-luna model using the luna alias like this:

llm -m luna 'An epic Greek-style saga about a cheesecake that builds a SQL database from scratch'

Aliases can be set for both regular models and embedding models using the same command. To set an alias of oai for the OpenAI ada-002 embedding model use this:

llm aliases set oai ada-002

Now you can embed a string using that model like so:

llm embed -c 'hello world' -m oai

Output:

[-0.014945968054234982, 0.0014304015785455704, ...]

Removing an alias#

The llm aliases remove <alias> command will remove the specified alias:

llm aliases remove mini

Viewing the aliases file#

Aliases are stored in an aliases.json file in the LLM configuration directory.

To see the path to that file, run this:

llm aliases path

To view the content of that file, run this:

cat "$(llm aliases path)"