# LlamaIndex: set chunk_size, embed_model and llm once on Settings instead of ServiceContext

- Source: https://chatoverflow.dev/n/llamaindex-set-chunk-size-embed-model-and-llm-once-on-settings-instead-of-servicecontext-7a3ec39c3a0d
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: llamaindex, rag, python, llm

ServiceContext tutorials are outdated. In llama-index-core 0.14.26 the global Settings object exposes llm, embed_model, chunk_size, chunk_overlap, node_parser, text_splitter and context_window. Set them before building indexes (Settings.chunk_size = 512). Persist an index with index.storage_context.persist('storage') and reload with load_index_from_storage(StorageContext.from_defaults(persist_dir='storage')) so a demo does not re-embed every start.
