Find answers from the community

Updated 4 months ago

Palm

At a glance

The community member has followed a tutorial on using GPT-Index and would like to use PaLM instead of OpenAI since they have credits for PaLM. They are unsure of what needs to be changed in their code to use PaLM. Another community member responds with the solution, which is to set up the LLM and use the service context from the llama_index library.

Useful resources
Hi all, I have followed this tutorial -> https://gpt-index.readthedocs.io/en/latest/end_to_end_tutorials/structured_data/sql_guide.html. All works pretty well. I would like to use PaLM and not OpenAI since I got credits there. I can see that it is possible, https://gpt-index.readthedocs.io/en/latest/examples/llm/palm.html but I have no idea what needs to be changed in my code:
L
s
2 comments
To use palm, just set up the llm and use the service context

Plain Text
from llama_index import ServiceContext, set_global_service_context 

ctx = ServiceContext.from_defaults(llm=llm)

set_global_service_context(ctx)
Add a reply
Sign up and join the conversation on Discord