llama_index icon indicating copy to clipboard operation
llama_index copied to clipboard

GPT Index and Typescript / Node.js

Open CodeFromAnywhere opened this issue 2 years ago • 3 comments

I work mostly with typescript and node.js, and I think many others do. Any ideas on how to make this thing compatible? Is your api getting stable already? I guess it must be possible then, to create a wrapper package in node.js. I'd like to get in touch with anyone interested in this, I might make it.

UPDATE

What are some of the principles of GPT Index?

It seems to be a library that contains the result of massive amount of work for months. It is certainly the start of "AI search" that helps you answer questions appropriately against large knowledge bases. It is the thing I need.

Can I use GPT Index in node.js easily?

No. We would need to create a typescript wrapper around their python API if we want to use it within node.js. This would a an enourmous task and also we would become dependent on an ever changing library that might make choices that I don't like. For such a crucial part, I think I would be better off creating my own Node.js implementation. Especially looking at long-term, this seems better.

Conclusion

I figured it will be a hassle to make this compatible with Typescript, and since GPT indexation is at the core of my company I decided I will at least try to make my own implementation in Node.js that uses similar principles.

I will try to replicate GPT Index as much as possible and needed in a typescript node.js package. Anyone that wants to help me: please get in touch; https://calendly.com/karsens

I'll regularly update my work in https://github.com/CodeFromAnywhere/gpt-index-js

CodeFromAnywhere avatar Jan 16 '23 10:01 CodeFromAnywhere

Hey Karsten - I'd be interested in this. I'm currently trying to combine a Python server that runs GPT index as a Flask API with a Next.js front-end that consumes it.

stefl avatar Jan 28 '23 09:01 stefl

Building this at Promptable.ai :)

Come join us! https://discord.gg/rNncg23E

cfortuner avatar Feb 03 '23 14:02 cfortuner

After working for +8 years with JavaScript/TypeScript based frameworks I don't see any benefits on porting gpt_index or any other ML python package to JavaScript. That battle was already lost, the community decided to go all in with python and that's not a bad thing. If you still want to continue with the port, just remember that anytime you want to include any other ML library into your project as a replacement or as an integration into your existing codebase, that library will be written in python, so you will have to port it as well or create some sort of bindings.

aitorllj93 avatar Feb 18 '23 10:02 aitorllj93

This isn't on the short-term roadmap atm, going to close issue for now

jerryjliu avatar Feb 20 '23 03:02 jerryjliu

LangchainJS is a thing now, willing to entertain this in the future?

agustif avatar Mar 30 '23 03:03 agustif

I have initiated a Node.js version of this project and welcome pr. https://github.com/swk777/llama_index_node

swk777 avatar May 12 '23 09:05 swk777