AI / LlamaIndex Interview Questions
What is Settings in LlamaIndex?
Settings is LlamaIndex's global configuration object, used to set defaults such as the LLM (Settings.llm), the embedding model (Settings.embed_model), the chunk size, and the node parser used across an application.
It replaced the older ServiceContext object, which had to be explicitly created and passed into almost every function call. Settings instead behaves like a global singleton, so you configure it once near the start of your program and every index, retriever, or query engine you create afterward picks up those defaults automatically.
You can still override individual settings per component when needed, for example passing a different LLM directly into as_query_engine(llm=...), which takes precedence over the global Settings value for that call.
More Related questions...