Earlier quoted context omitted.
The simplest way, as rdedev is describing, is to do Retrieval Augmented Generation (RAG) in your prompting. This would require the addition of a vector database and a text embedding model. There are many open source / local / private options for that. The steps would then be: 1. Embed your private data in chunks and store the resulting embeddings in a vector database 2. In your prompting workflow, when a user queries…
Looks like this is not easy at all for a non ML expert. And probably the required computing power is still out of reach for mere mortals. I'd have a similar use case to the parent: technical books. I'd love to be able to ask where a certain topic is discussed in my pdf archive and have the AI reply with references and possibly a significant piece of the relevant articles, with images (or local links to them).
Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
51–60 of 78 posts
Re: Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
#52Earlier quoted context omitted.
The simplest way, as rdedev is describing, is to do Retrieval Augmented Generation (RAG) in your prompting. This would require the addition of a vector database and a text embedding model. There are many open source / local / private options for that. The steps would then be: 1. Embed your private data in chunks and store the resulting embeddings in a vector database 2. In your prompting workflow, when a user queries…
Looks like this is not easy at all for a non ML expert. And probably the required computing power is still out of reach for mere mortals. I'd have a similar use case to the parent: technical books. I'd love to be able to ask where a certain topic is discussed in my pdf archive and have the AI reply with references and possibly a significant piece of the relevant articles, with images (or local links to them).
Both have extensive examples in their documentation for almost identical use cases to the above.
Re: Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
#53Earlier quoted context omitted.
The simplest way, as rdedev is describing, is to do Retrieval Augmented Generation (RAG) in your prompting. This would require the addition of a vector database and a text embedding model. There are many open source / local / private options for that. The steps would then be: 1. Embed your private data in chunks and store the resulting embeddings in a vector database 2. In your prompting workflow, when a user queries…
Yeah but the big question I kept having and missing the answer is: How do you encode the private data into the vectors? It is a bunch of text but how do you choose the vector values in the first place? What software does that? Isn’t that basically an ML task with its own weights, that’s what classifiers do! I was surprised everyone had been writing about that but neglecting to explain this piece. Like math textbooks…
You use sentence transformers (https://www.sbert.net/).
You use a strong baseline like all-MiniLM-L6-v2. (Or you get more fancy with something from the Massive Text Embedding Benchmark, https://huggingface.co/spaces/mteb/leaderboard)
You break your text into sentences or paragraphs with no more than 512 tokens (according to the sentence transformers tokenizer).
You embedding all your texts and insert them into your vector DB.
Re: Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
#54Earlier quoted context omitted.
Ah fascinating, just curious, what's the technical blocker? I thought most of the Llama models were optimized to run on GPUs?
It's fairly straightforward to add GPU support when running on the host, but LlamaGPT runs inside a Docker container, and that's where it gets a bit challenging.
Re: Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
#55Earlier quoted context omitted.
The simplest way, as rdedev is describing, is to do Retrieval Augmented Generation (RAG) in your prompting. This would require the addition of a vector database and a text embedding model. There are many open source / local / private options for that. The steps would then be: 1. Embed your private data in chunks and store the resulting embeddings in a vector database 2. In your prompting workflow, when a user queries…
Yeah but the big question I kept having and missing the answer is: How do you encode the private data into the vectors? It is a bunch of text but how do you choose the vector values in the first place? What software does that? Isn’t that basically an ML task with its own weights, that’s what classifiers do! I was surprised everyone had been writing about that but neglecting to explain this piece. Like math textbooks…
Yes, turning words into vectors is it's own class of machine learning. You can learn a lot on the NLP course on hugging face https://huggingface.co/learn/nlp-course/chapter1/1 (and on youtube).
Re: Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
#56Earlier quoted context omitted.
The simplest way, as rdedev is describing, is to do Retrieval Augmented Generation (RAG) in your prompting. This would require the addition of a vector database and a text embedding model. There are many open source / local / private options for that. The steps would then be: 1. Embed your private data in chunks and store the resulting embeddings in a vector database 2. In your prompting workflow, when a user queries…
Looks like this is not easy at all for a non ML expert. And probably the required computing power is still out of reach for mere mortals. I'd have a similar use case to the parent: technical books. I'd love to be able to ask where a certain topic is discussed in my pdf archive and have the AI reply with references and possibly a significant piece of the relevant articles, with images (or local links to them).
The computing power we're requiring is simply what's available in any M1/M2 Mac, and the resource usage for the indexing and search is negligible. This isn't even a hard requirement, any modern PC could index all your emails and do the local hybrid search part.
Running the local LM is what requires more resources, but as this project shows it's absolutely possible.
Of course getting it to work *well* for certain use cases is still hard. Simply searching for close sections of papers and injecting them into the prompt as others have mentioned doesn't always provide enough context for the LM to give a good answer. Local LMs aren't great at reasoning over large amounts of data yet, but getting better every week so it's just a matter of time.
(If you're curious my email is in my profile)
Re: Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
#57(1) What are the best more creative/less lobotomized versions of Llama 2? (2) What's the best way to get one of those running in a similarly easy way?
https://github.com/jmorganca/ollama was extremely simple to get running on my M1 and has a couple uncensored models you can just download and use.
Re: Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
#58Earlier quoted context omitted.
Well, GPT is simply an initialism for "Generative Pre-trained Transformer". In Germany, a trademark can be lost if it becomes a "Gattungsbegriff" (generic term). This happens when a trademark becomes so well-known and widely used that it becomes the common term for a product or service, rather than being associated with a specific company or brand. For example, if a company invented a new type of vacuum cleaner and t…
Actually in the UK and Ireland a vacuum cleaner is called a Hoover. But in general I think we do that less than Americans. For example, we don't call a public announcement system a "Tannoy". That's a brand of hifi speakers. And we'd say "photo copier" instead of Xerox.
Re: Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
#59So many projects still using GPT in their name. Is the thinking here that OpenAI is not going to defend that trademark? Or just kicking the can down the road on rebranding until the C&D letter arrives?
Well, GPT is simply an initialism for "Generative Pre-trained Transformer". In Germany, a trademark can be lost if it becomes a "Gattungsbegriff" (generic term). This happens when a trademark becomes so well-known and widely used that it becomes the common term for a product or service, rather than being associated with a specific company or brand. For example, if a company invented a new type of vacuum cleaner and t…
What OpenAI did was the opposite of what you describe, they took an already-generic term and used it for a product name. I wouldn't be surprised if they can't actually trademark that.
Re: Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
#60Earlier quoted context omitted.
The simplest way, as rdedev is describing, is to do Retrieval Augmented Generation (RAG) in your prompting. This would require the addition of a vector database and a text embedding model. There are many open source / local / private options for that. The steps would then be: 1. Embed your private data in chunks and store the resulting embeddings in a vector database 2. In your prompting workflow, when a user queries…
Yeah but the big question I kept having and missing the answer is: How do you encode the private data into the vectors? It is a bunch of text but how do you choose the vector values in the first place? What software does that? Isn’t that basically an ML task with its own weights, that’s what classifiers do! I was surprised everyone had been writing about that but neglecting to explain this piece. Like math textbooks…
But even at 100K, you do eventually run out of context. You would with 1M tokens too. 100K tokens is the new 64K of RAM, you're going to end up wanting more.
So techniques like RAG that others have mentioned are necessary in the end at some point, at least with models that look like they do today.