←back to thread

70 points alexmolas | 1 comments | | HN request time: 0.223s | source
1. senko ◴[] No.43647891[source]
Many libraries with the same approach suffer the same flaw: can't easily use the same function with different LLMs at runtime (ie. after importing the module where it is defined).

I initially used the same approach in my library, but changed it to explicitly pass the llm object around and in actual production code it's easier/more flexible to use.

Examples (2nd one also with docstring-based llm query and structured answer): https://github.com/senko/think?tab=readme-ov-file#examples