Commit graph

73 commits

Author SHA1 Message Date
Simon Willison
99a1adcece Initial llm schemas list implementation, refs #781 2025-02-27 07:35:48 -08:00
Simon Willison
f35ac31c21
llm logs --schema, --data, --data-array and --data-key options (#785)
* llm logs --schema option, refs #782
* --data and --data-array and --data-key options, refs #782
* Tests for llm logs --schema options, refs #785
* Also implemented --schema ID lookup, refs #780
* Using --data-key implies --data
* Docs for llm logs --schema and --data etc
2025-02-26 21:51:08 -08:00
Simon Willison
62c90dd472
llm prompt --schema X option and model.prompt(..., schema=) parameter (#777)
Refs #776

* Implemented new llm prompt --schema and model.prompt(schema=)
* Log schema to responses.schema_id and schemas table
* Include schema in llm logs Markdown output
* Test for schema=pydantic_model
* Initial --schema CLI documentation
* Python docs for schema=
* Advanced plugin docs on schemas
2025-02-26 16:58:28 -08:00
Tomoko Uchida
eda1f4f588
Add note about similarity function in "similar" command's doc (#774)
* note about similarity function in similar command doc
* Link to Wikipedia definition

---------

Co-authored-by: Simon Willison <swillison@gmail.com>
2025-02-26 10:07:10 -08:00
Simon Willison
53d6ecdd59 Documentation for logs --short, refs #756 2025-02-16 15:16:51 -08:00
Simon Willison
31e900e9e1 llm aliases set -q option, refs #749 2025-02-13 15:49:47 -08:00
Simon Willison
20c18a716d -q multiple option for llm models and llm embed-models
Refs #748
2025-02-13 15:35:18 -08:00
Simon Willison
9a1374b447
llm embed-multi --prepend option (#746)
* llm embed-multi --prepend option

Closes #745
2025-02-12 15:19:18 -08:00
Simon Willison
41d64a8f12
llm logs --prompts option (#737)
Closes #736
2025-02-02 12:03:01 -08:00
Simon Willison
656d8fa3c4
--xl/--extract-last flag for prompt and log list commands (#718)
Closes #717
2025-01-24 10:52:46 -08:00
Csaba Henk
88a8cfd9e4
llm logs -x/--extract option (#693)
* llm logs -x/--extract option
* Update docs/help.md for llm logs -x
* Added test for llm logs -x/--extract, refs #693
* llm logs -xr behaves same as llm logs -x
* -x/--extract in llm logging docs

---------

Co-authored-by: Simon Willison <swillison@gmail.com>
2025-01-10 15:53:04 -08:00
Simon Willison
b452effa09 llm models -q/--query option, closes #700 2025-01-09 11:37:33 -08:00
Simon Willison
67d4a99645 llm prompt -x/--extract option, closes #681 2024-12-19 06:40:05 -08:00
Simon Willison
cfb10f4afd
Log input tokens, output tokens and token details (#642)
* Store input_tokens, output_tokens, token_details on Response, closes #610
* llm prompt -u/--usage option
* llm logs -u/--usage option
* Docs on tracking token usage in plugins
* OpenAI default plugin logs usage
2024-11-19 20:21:59 -08:00
Simon Willison
ba75c674cb
llm.get_async_model(), llm.AsyncModel base class and OpenAI async models (#613)
- https://github.com/simonw/llm/issues/507#issuecomment-2458639308

* register_model is now async aware

Refs https://github.com/simonw/llm/issues/507#issuecomment-2458658134

* Refactor Chat and AsyncChat to use _Shared base class

Refs https://github.com/simonw/llm/issues/507#issuecomment-2458692338

* fixed function name

* Fix for infinite loop

* Applied Black

* Ran cog

* Applied Black

* Add Response.from_row() classmethod back again

It does not matter that this is a blocking call, since it is a classmethod

* Made mypy happy with llm/models.py

* mypy fixes for openai_models.py

I am unhappy with this, had to duplicate some code.

* First test for AsyncModel

* Still have not quite got this working

* Fix for not loading plugins during tests, refs #626

* audio/wav not audio/wave, refs #603

* Black and mypy and ruff all happy

* Refactor to avoid generics

* Removed obsolete response() method

* Support text = await async_mock_model.prompt("hello")

* Initial docs for llm.get_async_model() and await model.prompt()

Refs #507

* Initial async model plugin creation docs

* duration_ms ANY to pass test

* llm models --async option

Refs https://github.com/simonw/llm/pull/613#issuecomment-2474724406

* Removed obsolete TypeVars

* Expanded register_models() docs for async

* await model.prompt() now returns AsyncResponse

Refs https://github.com/simonw/llm/pull/613#issuecomment-2475157822

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-13 17:51:00 -08:00
Simon Willison
dff53a9cae Better --help for llm keys get, refs #623 2024-11-11 09:53:24 -08:00
Simon Willison
561784df6e llm keys get command, refs #623 2024-11-11 09:47:13 -08:00
Simon Willison
98d2c19876 Promote alternative model providers in llm --help 2024-11-06 06:38:53 -08:00
Simon Willison
1f822d820b Update docs with cog 2024-10-28 15:41:34 -07:00
Simon Willison
f0ed54abf1 Docs for CLI attachments, refs #587 2024-10-28 15:41:34 -07:00
Simon Willison
fb63c92cd2 llm logs -r/--response option, closes #431 2024-03-04 13:29:07 -08:00
Simon Willison
33dee4762e llm embed-multi --batch-size option, closes #273 2023-09-13 16:33:27 -07:00
Simon Willison
4952a8d119 llm similar --binary, closes #269 2023-09-12 11:23:31 -07:00
Simon Willison
22a59f795e llm collections defaults to llm collections list, close #265 2023-09-11 23:08:11 -07:00
Simon Willison
52cec1304b
Binary embeddings (#254)
* Binary embeddings support, refs #253
* Write binary content to content_blob, with tests - refs #253
* supports_text and supports_binary embedding validation, refs #253
2023-09-11 18:58:44 -07:00
mhalle
f07b291a78
change type of cli "embed -c" to be STR not FILE (#263)
* change type of cli "embed -c" to be STR not FILE

The type of the "content" argument was erroneously set to be FILE with a "type=click.Path(...)" argument, which content is a string.

---------

Co-authored-by: Simon Willison <swillison@gmail.com>
2023-09-11 18:17:34 -07:00
Simon Willison
5ba34dbe36 llm embed-db is now llm collections, refs #229 2023-09-10 14:24:27 -07:00
Simon Willison
6012f31e36 llm plugins --all option, closes #259 2023-09-10 14:18:16 -07:00
Simon Willison
ab05023b30 Ran cog, refs #248 2023-09-10 11:49:32 -07:00
Simon Willison
2fe12d5458 Ran cog, refs #244 2023-09-10 11:16:44 -07:00
Simon Willison
969a5d3364 Initial prototype of llm chat, refs #231 2023-09-04 23:36:25 -07:00
Simon Willison
45b380c3f1 Fix broken internal references in help.md 2023-09-04 17:08:30 -07:00
Simon Willison
78a0e9bd44 llm --files --encoding option and latin-1 fallback, closes #225 2023-09-04 12:28:31 -07:00
Simon Willison
5efb300c42 Release 0.9
Refs #192, #209, #211, #213, #215, #217, #218, #219, #222

Closes #205
2023-09-03 19:35:14 -07:00
Simon Willison
0da1ed7d98 --remove-default for llm embed-models default, refs #222 2023-09-03 16:40:00 -07:00
Simon Willison
c8c0f80441 --prefix for llm embed-multi, refs #215 2023-09-03 16:40:00 -07:00
Simon Willison
2440eb4f48 Help tweak and ran cog 2023-09-03 16:40:00 -07:00
Simon Willison
213e0b0c75 embed-db delete-collection command and .delete() method, closes #219 2023-09-03 12:55:48 -07:00
Simon Willison
26332045dd llm embed --metadata option, closes #209 2023-09-03 07:43:23 -07:00
Simon Willison
6b042a264a Fixed -i and -i - modes for llm embed command 2023-09-01 20:24:58 -07:00
Simon Willison
4be89facb5 Fixed and finished llm similar command, closes #190 2023-09-01 19:01:16 -07:00
Simon Willison
c25e7c4713 Ran cog, refs #190 2023-08-31 23:13:20 -07:00
Simon Willison
77cf56e54a
Initial CLI support and plugin hook for embeddings, refs #185
* Embeddings plugin hook + OpenAI implementation
* llm.get_embedding_model(name) function
* llm embed command, for returning embeddings or saving them to SQLite
* Tests using an EmbedDemo embedding model
* llm embed-models list and emeb-models default commands
* llm embed-db path and llm embed-db collections commands
2023-08-27 22:24:10 -07:00
Simon Willison
e959026051 llm keys command, closes #174 2023-08-20 23:11:47 -07:00
Simon Willison
0cd9333054 llm aliases defaults to llm aliases list, refs #154
Refs #167
2023-08-19 21:48:20 -07:00
Simon Willison
0eeb8393ca llm models and llm templates default to list, closes #167 2023-08-19 20:04:14 -07:00
Simon Willison
a4f55e9987 --cid/--conversation option, docs for search - refs #160 2023-08-17 14:32:43 -07:00
Simon Willison
113df5dd87 llm logs now defaults to text output, use --json for JSON, use -c X for specific conversation
Refs #160
2023-08-17 13:57:18 -07:00
Simon Willison
945ed246da Updated cog help, refs #151 2023-08-12 09:15:46 -07:00
Simon Willison
7303bc3e34 Use cog prolog
Refs https://github.com/simonw/llm/issues/151#issuecomment-1675730608
2023-08-11 23:17:50 -07:00