diff --git a/docs/aliases.md b/docs/aliases.md new file mode 100644 index 0000000..d7f357d --- /dev/null +++ b/docs/aliases.md @@ -0,0 +1,32 @@ +(aliases)= +# Model aliases + +LLM supports model aliases, which allow you to refer to a model by a short name instead of its full ID. + +To list current aliases, run this: + +```bash +llm aliases +``` +Example output: + + +``` +3.5 : gpt-3.5-turbo +chatgpt : gpt-3.5-turbo +chatgpt-16k : gpt-3.5-turbo-16k +3.5-16k : gpt-3.5-turbo-16k +4 : gpt-4 +gpt4 : gpt-4 +4-32k : gpt-4-32k +orca : orca-openai-compat +0613 : gpt-3.5-turbo-0613 +``` + diff --git a/tests/test_aliases.py b/tests/test_aliases.py new file mode 100644 index 0000000..5e3124f --- /dev/null +++ b/tests/test_aliases.py @@ -0,0 +1,17 @@ +from click.testing import CliRunner +from llm.cli import cli + + +def test_aliases_list(): + runner = CliRunner() + result = runner.invoke(cli, ["aliases", "list"]) + assert result.exit_code == 0 + assert result.output == ( + "3.5 = gpt-3.5-turbo\n" + "chatgpt = gpt-3.5-turbo\n" + "chatgpt-16k = gpt-3.5-turbo-16k\n" + "3.5-16k = gpt-3.5-turbo-16k\n" + "4 = gpt-4\n" + "gpt4 = gpt-4\n" + "4-32k = gpt-4-32k\n" + )