{"id":13408237,"url":"https://github.com/juftin/llm-term","last_synced_at":"2025-07-15T02:31:54.814Z","repository":{"id":194703026,"uuid":"691394442","full_name":"juftin/llm-term","owner":"juftin","description":"Chat with LLM models directly from the command line","archived":false,"fork":false,"pushed_at":"2024-07-18T21:57:20.000Z","size":773,"stargazers_count":25,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-19T05:07:10.387Z","etag":null,"topics":["chatgpt","cli","llm","openai-api","python","rich"],"latest_commit_sha":null,"homepage":"https://juftin.com/llm-term","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juftin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-14T05:08:29.000Z","updated_at":"2024-08-10T09:11:30.000Z","dependencies_parsed_at":"2023-09-14T19:43:05.031Z","dependency_job_id":"b66382be-057f-44a5-aa5d-eed2b90d6f03","html_url":"https://github.com/juftin/llm-term","commit_stats":null,"previous_names":["juftin/llm-cli","juftin/llm-term"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juftin%2Fllm-term","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juftin%2Fllm-term/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juftin%2Fllm-term/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juftin%2Fllm-term/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juftin","download_url":"https://codeload.github.com/juftin/llm-term/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226012177,"owners_count":17559630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","cli","llm","openai-api","python","rich"],"created_at":"2024-07-30T20:00:51.609Z","updated_at":"2024-11-23T06:37:09.369Z","avatar_url":"https://github.com/juftin.png","language":"Python","funding_links":[],"categories":["\u003ca name=\"ai\"\u003e\u003c/a\u003eAI / ChatGPT","Python"],"sub_categories":[],"readme":"# llm-term\n\nChat with LLM models directly from the command line.\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"600\" alt=\"image\" src=\"https://i.imgur.com/453xL6I.png\"\u003e\n\u003c/p\u003e\n\n[![PyPI](https://img.shields.io/pypi/v/llm-term?color=blue\u0026label=🤖%20llm-term)](https://github.com/juftin/llm-term)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/llm-term)](https://pypi.python.org/pypi/llm-term/)\n[![GitHub License](https://img.shields.io/github/license/juftin/llm-term?color=blue\u0026label=License)](https://github.com/juftin/llm-term/blob/main/LICENSE)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-lightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg)](https://gitmoji.dev)\n\n\u003cdetails\u003e\n\u003csummary\u003eScreen Recording\u003c/summary\u003e\n\nhttps://github.com/juftin/llm-term/assets/49741340/c305f636-dfcf-4d6f-884f-81d378cf0684\n\n\u003c/details\u003e\n\n\u003ch2\u003e\u003ca href=\"https://juftin.com/llm-term\"\u003eCheck Out the Docs\u003c/a\u003e\u003c/h2\u003e\n\n## Installation\n\n```bash\npipx install llm-term\n```\n\n### Install with Extras\n\nYou can install llm-term with extra dependencies for different providers:\n\n```bash\npipx install \"llm-term[anthropic]\"\n```\n\n```bash\npipx install \"llm-term[mistralai]\"\n```\n\nOr, you can install all the extras:\n\n```bash\npipx install \"llm-term[all]\"\n```\n\n## Usage\n\nThen, you can chat with the model directly from the command line:\n\n```shell\nllm-term\n```\n\n`llm-term` works with multiple LLM providers, but by default it uses OpenAI.\nMost providers require extra packages to be installed, so make sure you\nread the [Providers](#providers) section below. To use a different provider, you\ncan set the `--provider` / `-p` flag:\n\n```shell\nllm-term --provider anthropic\n```\n\nIf needed, make sure you have your LLM's API key set as an environment variable\n(this can also set via the `--api-key` / `-k` flag in the CLI). If your LLM uses\na particular environment variable for its API key, such as `OPENAI_API_KEY`,\nthat will be detected automatically.\n\n```shell\nexport LLM_API_KEY=\"xxxxxxxxxxxxxx\"\n```\n\nOptionally, you can set a custom model. llm-term defaults\nto `gpt-4o` (this can also set via the `--model` / `-m` flag in the CLI):\n\n```shell\nexport LLM_MODEL=\"gpt-4o-mini\"\n```\n\nWant to start the conversion directly from the command line? No problem,\njust pass your prompt to `llm-term`:\n\n```shell\nllm-term show me python code to detect a palindrome\n```\n\nYou can also set a custom system prompt. llm-term defaults to a reasonable\nprompt for chatting with the model, but you can set your own prompt (this\ncan also set via the `--system` / `-s` flag in the CLI):\n\n```shell\nexport LLM_SYSTEM_MESSAGE=\"You are a helpful assistant who talks like a pirate.\"\n```\n\n## Providers\n\n### OpenAI\n\nBy default, llm-term uses OpenAI as your LLM provider. The default model is\n`gpt-4o` and you can also use the `OPENAI_API_KEY` environment variable\nto set your API key.\n\n### Anthropic\n\nYou can request access to Anthropic [here](https://www.anthropic.com/). The\ndefault model is `claude-3-5-sonnet-20240620`, and you can use the `ANTHROPIC_API_KEY` environment\nvariable. To use `anthropic` as your provider you must install the `anthropic`\nextra.\n\n```shell\npipx install \"llm-term[anthropic]\"\n```\n\n```shell\nllm-term --provider anthropic\n```\n\n### MistralAI\n\nYou can request access to the [MistralAI](https://mistral.ai/)\n[here](https://console.mistral.ai/). The default model is\n`mistral-small-latest`, and you can use the `MISTRAL_API_KEY` environment variable.\n\n```shell\npipx install \"llm-term[mistralai]\"\n```\n\n```shell\nllm-term --provider mistralai\n```\n\n### Ollama\n\nOllama is a an open source LLM provider. These models run locally on your\nmachine, so you don't need to worry about API keys or rate limits. The default\nmodel is `llama3`, and you can see what models are available on the [Ollama\nWebsite](https://ollama.com/library). Make sure to\n[download Ollama](https://ollama.com/download) first.\n\n```shell\nollama pull llama3\n```\n\n```shell\nllm-term --provider ollama --model llama3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuftin%2Fllm-term","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuftin%2Fllm-term","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuftin%2Fllm-term/lists"}