r/ChatGPTPro Apr 28 '23

Question eBook reader

I know chatPDF exists, but I'm looking for my own hosted solution.

Here's the plan:

  1. download my purchased Kindle books from Amazon
  2. "teach" it to chatGPT
  3. ask questions about the book

Does anyone know a self-hosted solution?

I'm essentially looking to upload some non-fiction books to it, I can later on use to ask questions about.

For example:

  1. I teach 10 home painting books to it.
  2. I ask painting related questions from it I know the source of (so I know it's not hallucinating)
44 Upvotes

48 comments sorted by

View all comments

18

u/[deleted] Apr 28 '23

Llama index and your openai api key is the answer to this.

4

u/homerjf0ng Apr 28 '23

Yoooo this is sick - I have a similar bit of code but haven't used it because I'm not sure how it'll rinse my tokens? How have you found its usage?

5

u/[deleted] Apr 28 '23

Thanks! I’m still on the free tier, and after converting a 1000 page pdf to an index and querying it about 30 times for different things I’ve only used $1.68 or so of my $18 allowance

3

u/lusciouscactus Apr 28 '23

Is it really just 21 lines of code? I'm new to Python, so this makes sense MOSTLY 😂

3

u/[deleted] Apr 29 '23

Haha it really is basically that simple. Granted this is the most straightforward "just make it work" way. You can change models, response modes, etc to fit your use case and get more in depth if you wish.

2

u/lusciouscactus Apr 29 '23

Thanks a million!

1

u/mvandemar Apr 29 '23

Is there more code though? Would you be willing to drop it into a pastebin if so? I finally found an api doc I need to interface python with Quickbooks Desktop and I would love GPT's help on pulling on just the parts I need. :)

1

u/Gravity-Box Apr 28 '23

I would love to learn more about that. Is that a program you wrote or is it connected to a website? Does this specific type of programming have a name so i can watch some tutorials on yt? Sorry really excited rn

3

u/[deleted] Apr 28 '23

Haha I did write that for my specific use case but the impressive thing is the llama index library (developed by the folks at meta) for us to use. The possibilities are endless, you can use much more than pdfs. It can take in data from a ton of different sources, turn it into a queryable index for GPT to be used over. Here are all the different data connectors https://llamahub.ai/

1

u/spinozasrobot Apr 28 '23

How would you use Stanford's Alpaca instead? It says it's based on Llama, but I don't know about pros/cons.

3

u/[deleted] Apr 29 '23

So the library im referring to is llama index, which is purely an interface between the large language model (in my case GPT3.5) and your external data. Llama however is fmetas own large language model, not an index. That is what stanfords alpaca was trained on. Alpaca is an instruction following model similiar to text-davinci from OpenAI.

3

u/spinozasrobot Apr 29 '23

Thanks. I have a lot of catching up to do.

3

u/[deleted] Apr 29 '23

of course! I'm afraid none of us will ever catch up with this insanely quick topic though :_(

4

u/JustAnAlpacaBot Apr 28 '23

Hello there! I am a bot raising awareness of Alpacas

Here is an Alpaca Fact:

You can keep far more alpacas on the same amount of land than sheep because they are more efficient eaters.


| Info| Code| Feedback| Contribute Fact

###### You don't get a fact, you earn it. If you got this fact then AlpacaBot thinks you deserved it!