Skip to content
Back to skills

Customization And Structured Outputs

ASecurity

"Customize LlamaIndex Settings, prompts, callbacks,

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
ai-agentsreactnodeapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill customization-and-structured-outputs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Customization And Structured Outputs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Customization And Structured Outputs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-customization-and-structured-outputs/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-customization-and-structured-outputs)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: customization-and-structured-outputs
description: "Customize LlamaIndex Settings, prompts, callbacks,
  instrumentation, evaluation signals, and Pydantic structured outputs without
  relying on external APIs during local checks."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Customization and Structured Outputs

## Use This Sub-Skill When

- You need to configure `Settings.llm`, `Settings.embed_model`, `Settings.node_parser`, `Settings.transformations`, `Settings.callback_manager`, tokenizer, chunk sizes, or prompt helpers.
- You need custom `PromptTemplate` or `ChatPromptTemplate` behavior, prompt inspection, prompt updates, or output-parser formatting instructions.
- You need Pydantic structured output through `PydanticOutputParser`, `LLMTextCompletionProgram`, `llm.as_structured_llm(...)`, or `get_response_synthesizer(output_cls=...)`.
- You need callbacks, instrumentation, token counting, or evaluator result shapes to debug query behavior.
- You need deterministic tests using `MockLLM` and `MockEmbedding` while avoiding external provider calls.

## Route Elsewhere

- Use `../indexing-and-querying/` for index construction, retrievers, query engines, node parsing as part of ingestion, and response modes in normal RAG flows.
- Use `../integrations-and-storage/` for provider packages, credentials, vector stores, readers, and external backend setup.
- Use `../agents-and-workflows/` for `AgentWorkflow`, `FunctionAgent`, `ReActAgent`, handoffs, tools, and agent orchestration; return here for schemas, parsers, prompts, and structured-output validation.

## Core Workflow

1. Decide scope: prefer per-object constructor arguments (`llm=`, `embed_model=`, `callback_manager=`, prompt templates) when isolation matters; use global `Settings` only for app-wide defaults.
2. For tests, set `Settings.llm = MockLLM(...)` and `Settings.embed_model = MockEmbedding(embed_dim=...)`, then restore prior `Settings` fields after the test.
3. Customize prompts with `PromptTemplate`, `ChatPromptTemplate`, `partial_format`, `template_var_mappings`, `function_mappings`, or component prompt APIs such as `get_prompts()` / `update_prompts()`.
4. Add structured outputs with a Pydantic model, then choose the surface: parser-attached prompt, `LLMTextCompletionProgram.from_defaults`, structured LLM wrapper, or response synthesizer `output_cls`.
5. Add callbacks or instrumentation before constructing the component that should emit events, then verify events with a local query or explicit callback-manager context.
6. Evaluate with evaluator classes that return `EvaluationResult` fields (`query`, `contexts`, `response`, `passing`, `score`, `feedback`, invalid metadata), making sure input shapes match the evaluator.

## Bundled References

- `references/customization-recipes.md` contains copy-adapt recipes for Settings isolation, prompts, structured outputs, callbacks, instrumentation, and evaluation.
- `references/api-reference.md` summarizes verified import paths, signatures, and object responsibilities for this sub-skill.
- `references/troubleshooting.md` maps common customization and structured-output failures to targeted fixes.
- `scripts/inspect_settings_and_prompts.py` prints Settings, prompt, parser, callback, evaluator, and mock-model checks without requiring external APIs.

## Safety Notes

- Avoid deprecated `ServiceContext`; current code uses `Settings` and explicit constructor arguments.
- Never let global `Settings` mutations leak between tests; snapshot and restore modified attributes.
- Do not hard-code provider API keys in skill examples; provider installation and credentials are integration concerns.
- Treat Pydantic validation errors as schema/prompt/model-contract feedback, not as retriever failures.

Files in this skill

  • SKILL.md3.7 KB
  • references/api-reference.md7.6 KB
  • references/customization-recipes.md8.6 KB
  • references/troubleshooting.md6.4 KB
  • scripts/inspect_settings_and_prompts.py5.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.