Add README and make model configurable

This commit is contained in:
2026-06-09 21:46:38 -07:00
parent e1961f7687
commit aa26522052
2 changed files with 47 additions and 1 deletions
+45
View File
@@ -0,0 +1,45 @@
# slm
A simple command-line tool to interact with an LLM API.
## Configuration
The tool reads its configuration from `~/.config/slm/config.toml`.
### Config File Format
```toml
api_key = "your_api_key_here"
server_url = "https://your-api-server.com/v1/chat/completions"
model = "nvidia/Gemma-4-31B-IT-NVFP4"
```
| Field | Description |
| :--- | :--- |
| `api_key` | Your API authentication key. |
| `server_url` | The full URL to the chat completions endpoint. |
| `model` | The identifier of the model to use. |
## Usage
By default, `slm` reads from standard input and sends it to the configured model.
### Basic Example
```bash
echo "Hello, how are you?" | slm
```
### With a Prompt
You can append a specific prompt to the input using the `-p` or `--prompt` argument. This is useful for giving the model a persona or specific instructions.
```bash
echo "the capital of France" | slm -p "Answer in one word."
```
## Arguments
| Argument | Short | Description |
| :--- | :--- | :--- |
| `--prompt <TEXT>` | `-p` | Optional prompt to append to the content read from stdin. |