sort_keys=True makes json.dumps emit dictionary keys in sorted order, so two JSON responses with the same data but different key order serialize to identical strings. Sorting happens on the original Python keys before they are converted to JSON strings, so numeric keys sort by value.
python / json / json.dumps / sort_keys / testing / deterministic-serialization / regression-tests
This article explains how to address control characters emitted by language models in JSON output, detailing the default strict mode in Python's json.loads and strategies for graceful degradation when encountering these characters.
JSON / Python / JSONDecodeError / Control Characters / Strict Mode
Python 3.15+ json.loads array_hook intercepts JSON arrays for validation before full object construction, ensuring data integrity.
json / python / deserialization / validation / array_hook / json.loads / data integrity / type safety
Use Python's json module object_hook to convert JSON dicts to typed instances during deserialization, avoiding full tree reprocessing.
Python / JSON / Deserialization / object_hook
patternProperties constrains value types by key-name regex, if/then adds conditional requirements driven by a discriminator, and unevaluatedProperties closes the schema when composition is involved.
json-schema / patternProperties / if-then / unevaluatedProperties / dynamic-keys / validation / jsonschema / python
Python's json module explicitly warns that JSON lacks framing, so calling dump() twice on the same file object writes two adjacent documents that json.load() cannot parse. The fix is to collect objects into a list and dump once, or use newline-delimited JSON with raw_decode for streaming scenarios.
python / json / serialization / llm / json-lines / framing / json-schema / streaming
JSON only allows string keys for objects. Consequently, json.dumps converts numeric Python dictionary keys to strings, meaning loads(dumps(x)) != x for dictionaries with non-string keys. This causes KeyErrors when looking up integer token IDs in dictionaries loaded from JSON.
python / json / serialization / dict-keys / token-id / round-trip
This guide explains how the application validates and authorizes tool requests before execution. Protocol item names such as function_call and function_call_output are specific to the OpenAI Responses API; other providers use their own wire formats.
tool-calling / function-calling / security / validation / permissions / side-effects / execution-boundary / tool-output
Batching can raise throughput while increasing queueing delay and memory use. Compare offline static batches with continuous batching for generation, then measure the trade-off on your model, input lengths, hardware, and latency target.
transformers / batching / throughput / latency / memory / gpu / pipeline / continuous-batching
A chat template fixes the exact token sequence a chat model expects, including role control tokens and special boundary tokens. Treating it as contract data prevents silent quality loss from mismatched formatting and duplicated special tokens.
chat-templates / transformers / tokenization / special-tokens / model-contract / prompt-formatting / llm-ops
Filtered vector search in Azure AI Search combines vector similarity with metadata filtering. Pre-filtering reduces the candidate set before scoring, potentially lowering latency but risking recall loss. Post-filtering preserves recall but may return fewer results. Testing both modes is essential to find the right trade-off for your data.
Azure AI Search / vector search / filtered vector search / hybrid search / pre-filter / post-filter / semantic ranker / metadata filtering
Learn how to effectively evaluate the precision and recall of AI models, especially when working with small question datasets. This guide covers the concepts, calculation methods, and practical considerations using scikit-learn.
ai / precision / recall / evaluation / small dataset / machine learning / scikit-learn / classification
A guide to setting up multimodal search in Azure AI Search using vectorization of text and images. Describes steps for creating an index, selecting models (e.g., CLIP), methods for generating embeddings, and executing hybrid queries to improve relevance.
azure-ai-search / vector-search / multimodal-search / clip / openai / hybrid-search
Explore the principles of semantic search, its reliance on embeddings, and the reasons why text that appears similar might not provide the desired answer. Learn about vector search, hybrid search, and their applications in information retrieval.
semantic search / vector search / embeddings / AI / information retrieval / natural language processing / hybrid search / Azure AI Search
Step-by-step guide to creating an index, generating embeddings, and executing hybrid queries that combine full-text and vector search using Azure AI Search.
azure-ai-search / hybrid-search / vector-search / semantic-reranker / index-schema / embeddings
This article explains how to choose effective chunk boundaries and overlap in retrieval-augmented generation (RAG) systems, comparing fixed-size and document-aware strategies. Using a hypothetical support note example, it demonstrates the risks of splitting across semantic units and shows how metadata and overlap can preserve context. The guidance is based on Microsoft Azure documentation for chunking in vector search and RAG workflows.
RAG / chunking / Azure AI Search / information retrieval / document processing
A citation identifier only proves a source was retrieved, not that it supports the claim. This article shows how to decompose answers, locate supporting passages, and separate retrieval checks from groundedness checks using a hypothetical policy example.
RAG / citation verification / groundedness / retrieval evaluation / prompt engineering / LLM evaluation
Compare three similarity calculations on small vectors and see when normalization changes the ranking.
ai
A technical guide explaining why syntactically correct JSON from Large Language Models (LLMs) is insufficient for production systems and how JSON Schema provides the necessary structural and type guarantees.
LLM / JSON / JSON Schema / Data Validation / Software Engineering / Python
How retrieval connects a language model to documents, and why a citation is not a guarantee.
AI / RAG / Retrieval