65 ms·
It depends a bit on what you are building. For most LLM apps I wouldn't use a library like that. Just write some code. Some examples; - Prompt templates: You
by codeptualize 3y ago
It depends a bit on what you are building.
For most LLM apps I wouldn't use a library like that. Just write some code. Some examples;
- Prompt templates: You can just use f-strings, ninja, or whatever templating language
- Getting LLM results: openai (or your llm of choice) library, or just simple api calls
- Chains/composability: Just one line of code after another line of code, functions, loops.
- Embeddings: Depends on the database and llm you are using, but generally not that hard. There are many guides available for whatever you are using.
- Measuring token length: For a lot of things you just need to measure token count of text. For OpenAI see tiktoken.
The exception might be agents, but most apps do not need those.
You could also just look at the langchain source, figure out what you need, then just write it yourself without all the abstractions.
Also look beyond llms. LLM apps are generally not much more than text processing, data storage/fetching, and api calls. That's nothing new, all the existing pre-llm solutions for text processing, queues, concurrency, chaining, data fetching, and pretty much everything you can imagine will work just fine.