the service context carried a lot of tech debt, and forced the initialization of stuff that wasn't even used. It was also never clear what components where using what models/settings. Tbh this has been like this for several months now.
# summary index uses neither embeddings nor llm to construct
# transformations optional
index = SummaryIndex.from_documents(documents, transformations=[SentenceSplitter()])
# query engine for a summary index uses an llm
query_engine = index.as_query_engine(llm=llm)
# a vector index uses embeddings at construction time
# again, transformations optional
index = VectorStoreIndex.from_documents(documents, embed_model=embed_model, transformations=[...])
# query engine for a vector index uses llm and embeddings
query_engine = index.as_query_engine(llm=llm, embed_model=embed_model)
Whenever a model is not supplied, it pulls from whatever is set on the global
Settings
object