LLM integration patterns including API usage, streaming, function calling, RAG pipelines, and cost optimization