Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ python -m logpilot.cli analyze <path> [OPTIONS]
- `--recursive` : Recurse into subdirectories (directory mode)
- `--include <glob>` : Glob pattern(s) to include (repeatable)
- `--exclude <glob>` : Glob pattern(s) to exclude (repeatable)
- `--model <model>` : LLM model to use (default: gpt-4)

### Example

Expand Down Expand Up @@ -62,6 +63,12 @@ Summarize a log file and write to a file:
python -m logpilot.cli analyze mylog.txt --out-file summary.txt
```

Analyze logs with a different model:

```sh
python -m logpilot.cli analyze mylog.txt --model gpt-3.5-turbo
```

## Project Structure

- `logpilot/` - Core modules
Expand Down
3 changes: 2 additions & 1 deletion logpilot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def analyze(
"--exclude",
help="Glob pattern(s) to exclude (repeatable).",
),
model: str = typer.Option("gpt-4", help="LLM model to use (default: gpt-4)"),
):
"""Analyze logs using Copilot SDK."""
import os
Expand Down Expand Up @@ -124,7 +125,7 @@ def analyze(
if os.environ.get("LOGPILOT_MOCK_LLM") == "1":
responses = ["Mocked summary: Something failed" for _ in prompts]
else:
llm = LLMClient()
llm = LLMClient(model=model)
responses = [llm.analyze(prompt) for prompt in prompts]

# 6. Aggregate responses
Expand Down