<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3496259157130184660</id><updated>2026-05-25T06:51:58.947-07:00</updated><category term="AWS"/><category term="oracle"/><category term="Exadata"/><category term="Kubernetes"/><category term="ollama"/><category term="GCP"/><category term="OCI"/><category term="EKS"/><category term="Oracle Cloud"/><category term="rag"/><category term="database"/><category term="DevOps"/><category term="Azure"/><category term="llamaindex"/><category term="AWS EKS"/><category term="Cloud"/><category term="AI"/><category term="AWS RDS"/><category term="Amazon Bedrock"/><category term="12c"/><category term="Cloud Engineer"/><category term="Generative AI"/><category term="Oracle 12c"/><category term="agentic"/><category term="graphrag"/><category term="huggingface"/><category term="GKE"/><category term="GenerativeAI"/><category term="OKE"/><category term="Oracle 19c"/><category term="Oracle Performance Tuning"/><category term="cloudvanity"/><category term="ibmcloud"/><category term="oraclecloud"/><category term="Finops"/><category term="SQL"/><category term="blogging"/><category term="newsletter"/><category term="oracle 23ai"/><category term="ASM"/><category term="AUSOUG"/><category term="Gitops"/><category term="GoldenGate"/><category term="K8s"/><category term="Linux"/><category term="OpenAI"/><category term="Oracle 11g"/><category term="Oracle 11gR2"/><category term="Oracle 26ai"/><category term="Oracle ACE"/><category term="Oracle AI Database"/><category term="Oracle Fusion Middleware 11g"/><category term="Oracle GoldenGate"/><category term="Oracle Pakistan"/><category term="Terraform"/><category term="chatgpt"/><category term="dba"/><category term="docker"/><category term="server"/><category term="11g"/><category term="ADR 11g"/><category term="AI RAG"/><category term="AI Vector Search"/><category term="ARGO CD"/><category term="AWS Bedrock"/><category term="AWS CLI"/><category term="AWS Finops"/><category term="AWS SSM"/><category term="Agentic AI"/><category term="CBO"/><category term="CloudFormation"/><category term="CyberSecurity"/><category term="Dynamodb"/><category term="GenAI"/><category term="Git"/><category term="JSON"/><category term="LLM"/><category term="LangChain"/><category term="Log Buffer"/><category term="Oracle Application Server 10g"/><category term="Oracle DBA"/><category term="Oracle Exadata"/><category term="Oracle select ai"/><category term="PMON"/><category term="Private Agent Factory"/><category term="Prompt Engineering"/><category term="Pythian"/><category term="ai agents"/><category term="cohere"/><category term="fine-tuning"/><category term="haystack"/><category term="llama 3.1"/><category term="llama2"/><category term="mistral7b"/><category term="qwen"/><category term="10g"/><category term="12c installation problem"/><category term="12c pluggable database"/><category term="AGI"/><category term="AI Transcription"/><category term="AKS"/><category term="AWS Aurora"/><category term="Apache Iceberg"/><category term="Cloud Security"/><category term="Codefresh"/><category term="Conference"/><category term="DORA"/><category term="ECS"/><category term="Exadata Jobs"/><category term="Exadata Pakistan"/><category term="F5TTS"/><category term="Flux"/><category term="Gen AI"/><category term="GoldenGate 23ai"/><category term="HunyuanVideo"/><category term="MCP Server"/><category term="NoSQL"/><category term="OLTP"/><category term="OOW12"/><category term="Oracle AI"/><category term="Oracle Certification Karachi"/><category term="Oracle Cloud Database"/><category term="Oracle Cloud Infrastructure"/><category term="Oracle blockchain"/><category term="Oracle blockchain table"/><category term="Perth"/><category term="PostgreSQL"/><category term="Python"/><category term="RDS"/><category term="S3"/><category term="Smart Scan"/><category term="ai agent"/><category term="ai voice cloning"/><category term="bedrock"/><category term="blog"/><category term="cellcli"/><category term="code llama"/><category term="comfyui"/><category term="crewai"/><category term="crossplane"/><category term="crowdstrike"/><category term="data"/><category term="deep live cam"/><category term="deepseek"/><category term="deepseek r1"/><category term="ecoute"/><category term="exadata patching"/><category term="facefusion"/><category term="finetune llm"/><category term="function calling"/><category term="gemma"/><category term="gemma 7b"/><category term="gpt4omini"/><category term="gradient"/><category term="groq"/><category term="hunyuan"/><category term="idefics2"/><category term="lightrag"/><category term="live face swap"/><category term="llama-cpp-python"/><category term="llama3.1"/><category term="llm finetuning"/><category term="memory leak"/><category term="mistral"/><category term="mistral nemo"/><category term="mixtral"/><category term="nvidia"/><category term="ora-00600"/><category term="phi3"/><category term="quantization"/><category term="quanto"/><category term="real application cluster"/><category term="record"/><category term="rope pearl"/><category term="select ai"/><category term="semantic kernel"/><category term="speaking"/><category term="sql server"/><category term="stable diffusion"/><category term="tom kyte"/><category term="tool use"/><category term="triplex"/><category term="tts"/><category term="unsloth"/><category term="vertex ai"/><category term="yum"/><category term="00600"/><category term="11g RAC"/><category term="12C RAC"/><category term="12G documentation"/><category term="12c enqueus"/><category term="12c listener problem"/><category term="12g DBA"/><category term="12g books"/><category term="12g download"/><category term="401 Authorization Required"/><category term="ADB-ExaC@C"/><category term="ADR"/><category term="AI Budgeting"/><category term="AI Comics"/><category term="AI Cost Management"/><category term="AI Enrichment"/><category term="AI Game"/><category term="AI Job interview"/><category term="AI-Ready Database"/><category term="AMD MI300X"/><category term="AMM"/><category term="ANZ"/><category term="ASM 12c"/><category term="ASM 18c"/><category term="AWR"/><category term="AWS Application Composer"/><category term="AWS Application Security"/><category term="AWS Athena"/><category term="AWS Athena tutorial"/><category term="AWS Blogs"/><category term="AWS Calculator"/><category term="AWS Cloud Architect Associate Exam"/><category term="AWS Cloud Architect Associate Exam preparation"/><category term="AWS EMR"/><category term="AWS Karpenter"/><category term="AWS Lambda"/><category term="AWS Lattice"/><category term="AWS Linter"/><category term="AWS Networking"/><category term="AWS Redshift"/><category term="AWS Resilience Hub"/><category term="AWS TNB"/><category term="AWS Telco Network Builder"/><category term="AWS Urdu"/><category term="AWS VPC"/><category term="AWS courses"/><category term="Accelerate book"/><category term="Accelerate book pdf"/><category term="Active Data Guard"/><category term="Agentic RAG"/><category term="Alibaba"/><category term="Amazon Athena"/><category term="Amazon Aurora"/><category term="Amazon Aurora Serverless"/><category term="Amazon Linux 2"/><category term="Amazon Linux 2023"/><category term="Amazon Linux 3"/><category term="Amazon Linux 4"/><category term="Amazon Web Service"/><category term="Anthos"/><category term="Application Security"/><category term="ArtificialIntelligence"/><category term="Aurora"/><category term="Aurora PostgreSQL"/><category term="Autonomous AI Database"/><category term="Azure Blogs"/><category term="BAAG"/><category term="BEA"/><category term="BP12"/><category term="BP13"/><category term="BP16"/><category term="Big Query"/><category term="BigQuery"/><category term="Bind Variable Peeking"/><category term="Bind Variables"/><category term="BuildKite"/><category term="CDC"/><category term="CICD"/><category term="CIDR"/><category term="CIDR Formula. AWS"/><category term="CLOUDFRONT"/><category term="CORBA"/><category term="CRSCTL"/><category term="CVU 11g"/><category term="Cell Node ADR"/><category term="CfCT"/><category term="ChatGLM"/><category term="Cline"/><category term="Cloud Blog Aggregator"/><category term="Cloud Carnival"/><category term="Cloud Cost Optimization"/><category term="Cloud DBA"/><category term="Cloud Engineer Interview"/><category term="Cloud Engineer Job"/><category term="Cloud Functions"/><category term="Cloud Interviews"/><category term="Cloud Jobs"/><category term="Cloud Vanity"/><category term="Cloudtrail"/><category term="Cluster Time Service"/><category term="Clustering Factor"/><category term="Cody"/><category term="Converged Database"/><category term="Cost Optimization"/><category term="DBA Certification Pakistan"/><category term="DBA Pakistan"/><category term="DBRM"/><category term="DBaas"/><category term="Data Replication"/><category term="Data Science"/><category term="Database Automation"/><category term="De-Duplication"/><category term="Deepmind"/><category term="Developer Productivity"/><category term="Developer Tips"/><category term="Disaggregated Inference"/><category term="Document AI"/><category term="Dolly"/><category term="DragGan"/><category term="E2TTS"/><category term="E5-TTS"/><category term="E5TTS"/><category term="EBS Snapshot"/><category term="EFS"/><category term="EKS Karpenter"/><category term="Exadata 12c"/><category term="Exadata BP14"/><category term="Exadata Developers"/><category term="Exadata Storage Server"/><category term="Exadata certification"/><category term="Exadata certification Australia"/><category term="Exadata certification sydney"/><category term="Exadata jobs Australia"/><category term="Exadata melbourne"/><category term="Exadata sydney"/><category term="Exalogic"/><category term="Exdata Perth"/><category term="External Vector Tables"/><category term="F5-TTS"/><category term="FAILURE"/><category term="FAST NU"/><category term="FRA"/><category term="Falcon"/><category term="Flan-T5"/><category term="Flashback"/><category term="Flex CD"/><category term="Fluxcd"/><category term="Forms 6i"/><category term="Free Development License"/><category term="Fusion Insights"/><category term="GCP  Blogs"/><category term="GDPR"/><category term="GPT-4o Mini"/><category term="GPU Offload"/><category term="GPnP Get Item"/><category term="GenApps"/><category term="Generative AI Agents"/><category term="Glacier"/><category term="GoldenGate 19c"/><category term="GoldenGate Error"/><category term="GoldenGate Installation"/><category term="Google Cloud Platform"/><category term="Google Service Weaver"/><category term="HA"/><category term="HCC"/><category term="Hadoop"/><category term="Helm"/><category term="High Water Mark"/><category term="Histograms"/><category term="Hybrid Activations"/><category term="ILM"/><category term="IORM"/><category term="IPMI"/><category term="Insync"/><category term="Insync12"/><category term="JMESPATH"/><category term="JRockit"/><category term="JSON Document Store"/><category term="Jonathan Lewis"/><category term="K9s"/><category term="KCNA"/><category term="Karpenter"/><category term="Kubernetes Urdu"/><category term="LLM Serving"/><category term="LOB 11g"/><category term="LUN"/><category term="Lightsail"/><category term="Lightsail for Research"/><category term="Linode Cloud"/><category term="Linode Kubernetes"/><category term="Lit-Parrot"/><category term="Local RAG"/><category term="ML"/><category term="MOS"/><category term="Mapped Collections"/><category term="Metalink"/><category term="Metalink SR"/><category term="Microservices Architecture"/><category term="Mistral Large 2"/><category term="Mixtral 8x7B"/><category term="Mixtral8X7B"/><category term="MongoDB"/><category term="My Oracle Support"/><category term="MySQL"/><category term="NV-INGEST"/><category term="NZOUG"/><category term="NZOUG14"/><category term="OC4J"/><category term="OCA Pakistan"/><category term="OCDBA"/><category term="OCP Pakistan"/><category term="ODA"/><category term="OEL6"/><category term="OHS"/><category term="OID"/><category term="OOW"/><category term="OOW2011"/><category term="ORA-00240"/><category term="ORA-00494"/><category term="ORA-00700"/><category term="ORA-04031"/><category term="ORA-07445"/><category term="ORA-4031"/><category term="ORA-700"/><category term="OTN"/><category term="OTN Lounge"/><category term="OU"/><category term="OpSec"/><category term="Ora Tech"/><category term="Oracle 11g OCP"/><category term="Oracle 11g RAC"/><category term="Oracle 18c"/><category term="Oracle 21c"/><category term="Oracle 23c"/><category term="Oracle 6i"/><category term="Oracle AI Database 26ai"/><category term="Oracle ASM"/><category term="Oracle Apps R12"/><category term="Oracle Big Data"/><category term="Oracle Certification Lahore"/><category term="Oracle Certification Pakistan"/><category term="Oracle Cloud Blog"/><category term="Oracle Coherence"/><category term="Oracle DBA Pakistan"/><category term="Oracle Database"/><category term="Oracle Database 11g Release 2  Tips"/><category term="Oracle Database 11g Release 2 Installation"/><category term="Oracle Database 23ai"/><category term="Oracle Datawarehousing"/><category term="Oracle Development"/><category term="Oracle GDPR"/><category term="Oracle GI"/><category term="Oracle Kubernetes"/><category term="Oracle Kubernetes pricing"/><category term="Oracle Loader"/><category term="Oracle MIX"/><category term="Oracle ML"/><category term="Oracle Mobile Authenticator"/><category term="Oracle Open World 2009"/><category term="Oracle PSU"/><category term="Oracle Partitioning"/><category term="Oracle Perth"/><category term="Oracle RAC"/><category term="Oracle RAC 11g"/><category term="Oracle RAG"/><category term="Oracle Report Server"/><category term="Oracle Reports"/><category term="Oracle SQL Developer"/><category term="Oracle Temp"/><category term="Oracle Vector Index"/><category term="Oracle WebLogic Server"/><category term="Oracle WebLogic Server 11g"/><category term="Oracle with 20:20 Foresight"/><category term="PACKET"/><category term="PITR"/><category term="PMON Latch"/><category term="PROW"/><category term="PSU"/><category term="Pakistan Oracle"/><category term="Paul Vallee"/><category term="Performance Insights"/><category term="Phi 3.5 Vision"/><category term="PostgreSQL 15"/><category term="PostgreSQL on AWS"/><category term="Private AI Services"/><category term="Prompt"/><category term="Prompt Engineer"/><category term="PromptOps"/><category term="Prow Job"/><category term="RAPTOR"/><category term="RBAL Hang"/><category term="RMAN"/><category term="RMAN Tips"/><category term="RPO"/><category term="RTO"/><category term="Real Application Clusters"/><category term="Reinvent"/><category term="Reinvent 2023"/><category term="Remote Diagnostic Agent"/><category term="Resource Map"/><category term="Runtime Controls"/><category term="SCT"/><category term="SD3"/><category term="SNS"/><category term="SODA Collections"/><category term="SQL Tuning"/><category term="SQLcl MCP"/><category term="SQLcl MCP Server"/><category term="SSIS"/><category term="Schema Annotations"/><category term="Schema Automation"/><category term="Secure AI Agents"/><category term="Semantic Search"/><category term="Serverless"/><category term="Shell Scripts"/><category term="ShortGPT"/><category term="Sohaib Abbasi"/><category term="Solaris"/><category term="Solaris 11 Help"/><category term="Solaris 11 books"/><category term="Solaris 11 certification"/><category term="Solaris 11 faq"/><category term="Solaris 11 introduction"/><category term="Solaris 11 tutorial"/><category term="Sourcegraph"/><category term="StableLM"/><category term="StarCoder"/><category term="Stress"/><category term="Sydney Oracle Meetup"/><category term="Systems Manager"/><category term="TNB"/><category term="TNS-12518"/><category term="TNS-12571"/><category term="Tagging"/><category term="Terraform 2023"/><category term="Terraform Destroy"/><category term="Terraform Locals"/><category term="Terraform variables"/><category term="Transformer"/><category term="UUID"/><category term="VPC Lattice"/><category term="VS Code"/><category term="Vector Search"/><category term="Vicuna"/><category term="WRITER"/><category term="Wget"/><category term="WizardLM"/><category term="Zsh"/><category term="acfs"/><category term="adalflow"/><category term="administration"/><category term="administrationphysical"/><category term="agenticdb"/><category term="agentless"/><category term="agentops"/><category term="ai database"/><category term="ai dubbing"/><category term="ai eval"/><category term="ai evals"/><category term="ai hub"/><category term="ai lip sync"/><category term="ai song cloning"/><category term="ai webscraping"/><category term="aiagents"/><category term="aichatbot"/><category term="aichatbots"/><category term="aider"/><category term="aievals"/><category term="airllm"/><category term="aitrain"/><category term="alert"/><category term="alibaba llm"/><category term="alphex"/><category term="amazon partyrock"/><category term="amazon titan"/><category term="amazon transcribe"/><category term="ansible"/><category term="anthropic"/><category term="anything llm"/><category term="anythingllm"/><category term="aphex 118b"/><category term="atrain"/><category term="audiocraft"/><category term="audiogen"/><category term="audioldm"/><category term="audioldm2"/><category term="auraflow"/><category term="autocoder"/><category term="autocoder installation"/><category term="autogen"/><category term="autonomous database"/><category term="autotrain"/><category term="autotrain advanced"/><category term="aws cloud pakistan"/><category term="aws pakistan"/><category term="aws partyrock"/><category term="aws sagemaker"/><category term="bedrock-runtime"/><category term="beyondllm"/><category term="blockchain"/><category term="blockchain table"/><category term="bloom filtering"/><category term="brainsurface"/><category term="call stack trace"/><category term="candle"/><category term="cargo"/><category term="celldisk"/><category term="cfn-lint"/><category term="chat gpt"/><category term="chat gtp"/><category term="chatgtp"/><category term="chattts"/><category term="checkpoint"/><category term="claude 3"/><category term="claude 4"/><category term="cloudwatch"/><category term="codd"/><category term="codellama"/><category term="codestral"/><category term="codestral mamba"/><category term="cogvideo"/><category term="cogvideox"/><category term="command r+"/><category term="command rplus"/><category term="compute nodes"/><category term="concurrency"/><category term="confusion"/><category term="connectivity"/><category term="corpuscreator"/><category term="crawl4ai"/><category term="ctags"/><category term="customllm"/><category term="dan"/><category term="dataset"/><category term="dataset creator"/><category term="datasets"/><category term="db_developer_role"/><category term="dbms"/><category term="dbms_cloud"/><category term="deepfake"/><category term="deeplivecam"/><category term="dept"/><category term="developer"/><category term="devin"/><category term="devopsgpt"/><category term="diagram"/><category term="dml"/><category term="dspy"/><category term="duckdb"/><category term="duckdb nsql"/><category term="ecout"/><category term="elevanlabs"/><category term="elevenlabs"/><category term="embedchain"/><category term="emc"/><category term="emp"/><category term="error"/><category term="event"/><category term="exadata cell patch"/><category term="exadata patch download"/><category term="exadata perth"/><category term="exadata v3"/><category term="exdata"/><category term="exl2"/><category term="exl3"/><category term="exllamav2"/><category term="exllamav3"/><category term="falcon180b"/><category term="fastrag"/><category term="ffmpeg"/><category term="finetune vlm"/><category term="finetuning"/><category term="firebase"/><category term="firewall"/><category term="fivetran"/><category term="flux1 dev"/><category term="flux1 pro"/><category term="flux1 schnell"/><category term="form"/><category term="fortify"/><category term="freewilly"/><category term="freewilly1"/><category term="freewilly2"/><category term="function"/><category term="gemma 2b"/><category term="gemma2b"/><category term="genkit"/><category term="gke-gcloud-auth-login"/><category term="goldengate 18c"/><category term="google cloud platform. google cloud pakistan"/><category term="google colab"/><category term="gpt4"/><category term="gpt4o"/><category term="gradientai"/><category term="gradio"/><category term="graphql"/><category term="griddisk"/><category term="groq8b"/><category term="hardware"/><category term="hindi llm"/><category term="history"/><category term="hqq"/><category term="html"/><category term="hugging face"/><category term="huggingace"/><category term="hunyuan3d"/><category term="i2v"/><category term="iAS"/><category term="iLOM"/><category term="idefics"/><category term="indic parler-tts"/><category term="install oracle 12c"/><category term="installation"/><category term="instance"/><category term="internal"/><category term="intersect"/><category term="islamabad"/><category term="isnan"/><category term="javascript"/><category term="kaggle"/><category term="karachi"/><category term="kathy sierra"/><category term="kdtalker"/><category term="keras"/><category term="kokoro"/><category term="kv cache"/><category term="langgraph"/><category term="latentsync"/><category term="librechat"/><category term="link"/><category term="lip sync video"/><category term="lip sync with ai"/><category term="listener"/><category term="live face swapping"/><category term="llama 3 groq"/><category term="llama 3.1 405b"/><category term="llama 3.1 70b"/><category term="llama cpp python"/><category term="llama-cpp-agent"/><category term="llama2 finetuning"/><category term="llama3"/><category term="llama3.2"/><category term="llamacpp"/><category term="llamagpt"/><category term="llamaindex workflows"/><category term="llm compiler"/><category term="llm function calling"/><category term="llm on mobile"/><category term="llm router"/><category term="llm tool calling"/><category term="llm-d"/><category term="llvm"/><category term="llvm ir"/><category term="local"/><category term="log"/><category term="logical"/><category term="long context"/><category term="lora"/><category term="lucid"/><category term="ludwig."/><category term="machine learning"/><category term="magic fixup"/><category term="magicquil"/><category term="magicquill"/><category term="management"/><category term="mark"/><category term="massedcompute"/><category term="mcp"/><category term="melanie caffrey"/><category term="mem0"/><category term="merge"/><category term="meta"/><category term="meta llama"/><category term="microsoft"/><category term="mineru"/><category term="minig"/><category term="minus"/><category term="mistraltiny"/><category term="model context protocol"/><category term="money"/><category term="mosaicml"/><category term="mpt-30b"/><category term="mpt30b"/><category term="mpt7b"/><category term="musicgen"/><category term="myllm"/><category term="native function"/><category term="nemo"/><category term="nemoclaw"/><category term="network"/><category term="nginx"/><category term="ngnix"/><category term="numeric"/><category term="nv ingest"/><category term="nvidia sana"/><category term="o&#39;reilly"/><category term="oca"/><category term="ocp"/><category term="online dpo"/><category term="onsubmit"/><category term="opatch"/><category term="openai . filesearch"/><category term="openclaw"/><category term="opendevin"/><category term="openlit"/><category term="openllm"/><category term="openorca"/><category term="openorcaplatypus"/><category term="openshell"/><category term="openvoice"/><category term="operator"/><category term="oplan"/><category term="orachk"/><category term="oracle cloud pakistan"/><category term="oracle data warehouse"/><category term="oracle digital assistant"/><category term="oracle enqueue"/><category term="oracle enterprise linux 6"/><category term="oracle functions"/><category term="oracle pluggable database"/><category term="oracle scheduler"/><category term="oracle university"/><category term="oracle vm"/><category term="oracle webinar"/><category term="oracle23ai"/><category term="orcaplatypus"/><category term="orphan sessions"/><category term="parler tts"/><category term="partyrock"/><category term="passion"/><category term="passionate"/><category term="patching"/><category term="patels"/><category term="pdf extraction toolkit"/><category term="perfoormance"/><category term="performance"/><category term="perplexica"/><category term="perth oracle"/><category term="petals"/><category term="pga"/><category term="phi"/><category term="php"/><category term="physicaldisk"/><category term="platypus2"/><category term="pman"/><category term="polars"/><category term="portability"/><category term="privatelink"/><category term="program"/><category term="prow job example"/><category term="pydantic"/><category term="pythia"/><category term="python polars"/><category term="qualcomm"/><category term="qualcomm ai hub"/><category term="query"/><category term="qwen 7b"/><category term="qwen 7b chat"/><category term="qwen omni"/><category term="qwen-agent"/><category term="qwen2"/><category term="qwen3"/><category term="qwenagent"/><category term="r2r"/><category term="rac"/><category term="rag me up"/><category term="ragtoriches"/><category term="read consistency"/><category term="read only ai"/><category term="research"/><category term="resource manager"/><category term="rittman"/><category term="rope pearl live"/><category term="routellm"/><category term="rust"/><category term="sagemaker"/><category term="sana"/><category term="sciphi"/><category term="scrapegraphiai"/><category term="searxng"/><category term="selectai"/><category term="self management"/><category term="semantic function"/><category term="service"/><category term="sga"/><category term="shared"/><category term="shared pool"/><category term="simpletuner"/><category term="singing"/><category term="slack face swap"/><category term="smash"/><category term="soap"/><category term="soap summary"/><category term="space shooter game"/><category term="stabilityai"/><category term="stable code 3b"/><category term="stable video 4d"/><category term="stablecode"/><category term="stablediffusion"/><category term="storage servers"/><category term="sum small"/><category term="sundiag"/><category term="sv4d"/><category term="swappiness"/><category term="synk"/><category term="system"/><category term="teams face swap"/><category term="techno-ed"/><category term="tencent"/><category term="text to sql"/><category term="text to sql model"/><category term="textbase"/><category term="textbox"/><category term="tinyllama"/><category term="tinyllama 1.1b"/><category term="tinyllm"/><category term="tokenizer"/><category term="tool calling"/><category term="tow"/><category term="transcribe"/><category term="trl"/><category term="tuning"/><category term="ubuntu"/><category term="unicode"/><category term="union"/><category term="union all"/><category term="urdu llm"/><category term="us"/><category term="validating"/><category term="validation"/><category term="venerable"/><category term="virtual column"/><category term="virtualization"/><category term="virtues"/><category term="vlm"/><category term="vmware"/><category term="voicecraft"/><category term="vpc endpoints"/><category term="wan2.2. wan2.2 comfyui workflow"/><category term="webinar"/><category term="werf"/><category term="whisper"/><category term="whisper turbo"/><category term="workflows llamaindex"/><category term="xtts"/><category term="xtuner"/><category term="yaml"/><category term="zone alarm"/><category term="zoom face swap"/><title type='text'>Fahd Mirza on AI, Cloud, DevOps and Databases</title><subtitle type='html'>Blog By Fahd Mirza Chughtai</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>698</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-3588365335722407116</id><published>2026-05-24T00:29:31.201-07:00</published><updated>2026-05-24T00:29:31.201-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AI"/><title type='text'>Weekly AI Recap - Qwen3.7, MTP in llama.cpp, SANA and More | May 2026</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;395&quot; src=&quot;https://www.youtube.com/embed/vIR7LGp9oHA&quot; width=&quot;475&quot; youtube-src-id=&quot;vIR7LGp9oHA&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/3588365335722407116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/3588365335722407116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/3588365335722407116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/3588365335722407116'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/05/weekly-ai-recap-qwen37-mtp-in-llamacpp.html' title='Weekly AI Recap - Qwen3.7, MTP in llama.cpp, SANA and More | May 2026'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/vIR7LGp9oHA/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-6298887812285184337</id><published>2026-05-24T00:26:50.963-07:00</published><updated>2026-05-24T00:26:50.963-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AI Enrichment"/><category scheme="http://www.blogger.com/atom/ns#" term="AI-Ready Database"/><category scheme="http://www.blogger.com/atom/ns#" term="MCP Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle SQL Developer"/><category scheme="http://www.blogger.com/atom/ns#" term="Schema Annotations"/><category scheme="http://www.blogger.com/atom/ns#" term="select ai"/><category scheme="http://www.blogger.com/atom/ns#" term="VS Code"/><title type='text'>AI Enrichment in Oracle SQL Developer for VS Code: Make Your Database AI-Ready</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Want your AI tools and LLMs to generate accurate SQL queries and truly understand your database? &lt;strong&gt;AI Enrichment&lt;/strong&gt; lets you add business context, descriptions, and metadata to your schema — without changing any data or structure.&lt;/p&gt;

&lt;p&gt;This powerful feature turns opaque database schemas into clear, AI-friendly assets.&lt;/p&gt;

&lt;h3&gt;What is AI Enrichment?&lt;/h3&gt;
&lt;p&gt;AI Enrichment is the process of adding human-readable descriptions, synonyms, business context, and logical groupings to your database objects (schemas, tables, and columns).&lt;/p&gt;

&lt;p&gt;It helps LLMs and AI agents understand the real meaning and relationships in your data, dramatically improving the quality of generated SQL and natural language responses.&lt;/p&gt;

&lt;h3&gt;Why AI Enrichment Matters&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Raw table/column names (like T1, C123, EMP_ID) are ambiguous to LLMs&lt;/li&gt;
    &lt;li&gt;Enrichment provides the missing business context&lt;/li&gt;
    &lt;li&gt;Leads to more accurate, efficient, and trustworthy AI-generated queries&lt;/li&gt;
    &lt;li&gt;Makes your database truly AI-ready for tools like Select AI, MCP Server, and Agent Factory&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;How It Works with LLMs&lt;/h3&gt;
&lt;p&gt;When you ask an AI tool a question, it automatically pulls your enrichment metadata and injects it into the prompt sent to the LLM. This gives the model rich context such as:&lt;/p&gt;
&lt;blockquote&gt;“The table EMPLOYEE contains current and former staff. EMP_ID is also known as employee number or worker id...”&lt;/blockquote&gt;

&lt;h3&gt;Getting Started&lt;/h3&gt;

&lt;h4&gt;Prerequisites&lt;/h4&gt;
&lt;ul&gt;
    &lt;li&gt;VS Code 1.101.0 or higher&lt;/li&gt;
    &lt;li&gt;Oracle SQL Developer for VS Code 25.3.0 or higher&lt;/li&gt;
    &lt;li&gt;Active connection to your Oracle Database&lt;/li&gt;
    &lt;li&gt;User with &lt;code&gt;CREATE VIEW&lt;/code&gt;, &lt;code&gt;CREATE TABLE&lt;/code&gt;, &lt;code&gt;CREATE SEQUENCE&lt;/code&gt;, &lt;code&gt;CREATE PROCEDURE&lt;/code&gt; privileges&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Step 1: Enable AI Enrichment&lt;/h4&gt;
&lt;ol&gt;
    &lt;li&gt;Open your database connection in SQL Developer for VS Code&lt;/li&gt;
    &lt;li&gt;Expand the connection → Click the &lt;strong&gt;AI Enrichment&lt;/strong&gt; folder&lt;/li&gt;
    &lt;li&gt;Click &lt;strong&gt;Yes&lt;/strong&gt; to create the required metadata objects&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Step 2: Use the AI Enrichment Dashboard&lt;/h4&gt;
&lt;p&gt;The dashboard is your central command center. It shows:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Schema-level description&lt;/li&gt;
    &lt;li&gt;Table groups and enrichment percentage&lt;/li&gt;
    &lt;li&gt;Intelligent suggestions for missing context&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Enrich Your Schema Step-by-Step&lt;/h3&gt;

&lt;h4&gt;1. Define Schema Business Context&lt;/h4&gt;
&lt;p&gt;In the dashboard, add a high-level description under “About this schema”, for example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;This schema manages core HR processes including employees, departments, payroll, and benefits.&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;2. Create Table Groups&lt;/h4&gt;
&lt;p&gt;Group related tables by business domain (e.g., “Employee Management”, “Payroll”, “Recruitment”). This helps LLMs understand logical relationships even without foreign keys.&lt;/p&gt;

&lt;h4&gt;3. Enrich Tables &amp;amp; Columns&lt;/h4&gt;
&lt;ul&gt;
    &lt;li&gt;Add clear natural language descriptions&lt;/li&gt;
    &lt;li&gt;Create key-value annotations (synonyms, business rules, valid values, etc.)&lt;/li&gt;
    &lt;li&gt;Mark tables as “Enrichment Complete” when done&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Best Practices&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Start with the most important / frequently queried tables&lt;/li&gt;
    &lt;li&gt;Use consistent, concise language in descriptions&lt;/li&gt;
    &lt;li&gt;Add synonyms and common business terms as annotations&lt;/li&gt;
    &lt;li&gt;Keep enrichment up-to-date as your schema evolves&lt;/li&gt;
    &lt;li&gt;Use Table Groups to reflect real business domains&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;AI Enrichment is one of the highest-ROI steps you can take to make your Oracle Database truly intelligent and AI-ready. By investing a little time in adding context today, you unlock much more accurate and useful AI interactions tomorrow.&lt;/p&gt;

&lt;p&gt;Whether you&#39;re using Select AI, MCP Server, Private Agent Factory, or any LLM-powered tool — enriched schemas deliver dramatically better results.&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/6298887812285184337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/6298887812285184337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6298887812285184337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6298887812285184337'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/05/ai-enrichment-in-oracle-sql-developer.html' title='AI Enrichment in Oracle SQL Developer for VS Code: Make Your Database AI-Ready'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-7724013260552679385</id><published>2026-05-09T23:47:00.000-07:00</published><updated>2026-05-20T23:48:47.530-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AI Vector Search"/><category scheme="http://www.blogger.com/atom/ns#" term="Apache Iceberg"/><category scheme="http://www.blogger.com/atom/ns#" term="Autonomous AI Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Exadata"/><category scheme="http://www.blogger.com/atom/ns#" term="MCP Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle AI Database 26ai"/><category scheme="http://www.blogger.com/atom/ns#" term="Private Agent Factory"/><title type='text'>Oracle AI Database 26ai: The Complete Guide to Key Features</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Oracle AI Database 26ai is a converged, AI-native platform that brings together transactional, analytical, and AI workloads in one secure, high-performance engine. It eliminates data movement, reduces complexity, and delivers enterprise-grade capabilities for modern AI-powered applications.&lt;/p&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h3&gt;AI Designed for Data&lt;/h3&gt;

&lt;h4&gt;Foundational AI Technologies&lt;/h4&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Unified Hybrid Vector Search&lt;/strong&gt; — Combine semantic vector search with relational, JSON, graph, spatial, and text search in a single query.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Model Context Protocol (MCP) Server&lt;/strong&gt; — Enables AI agents and LLMs to interact directly with the database for iterative reasoning and accurate results.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Built-in Data Privacy Protection&lt;/strong&gt; — Row, column, and cell-level security with dynamic masking so agents only see authorized data.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Oracle Unified Memory Core&lt;/strong&gt; — Low-latency reasoning across all data types (vector, JSON, graph, relational, etc.) in one engine.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Oracle Exadata for AI&lt;/strong&gt; — Hardware + software co-engineered for massive acceleration of vector queries via AI Smart Scan and offload.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;NVIDIA Integration&lt;/strong&gt; — Support for NVIDIA NIM containers and future GPU acceleration via Private AI Services Container.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;AI for Application Development&lt;/h4&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Private Agent Factory&lt;/strong&gt; — No-code visual builder to create, deploy, and manage secure data-centric AI agents (Knowledge Agent, Data Analysis Agent, etc.).&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Select AI Agent&lt;/strong&gt; — In-database framework for building and orchestrating agentic workflows.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;AI Semantic Modeling&lt;/strong&gt; — Helps AI understand data context for better code generation and answers.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Unified Data Model&lt;/strong&gt; — Access the same data as relational, JSON document, or graph using SQL.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;End Data Chaos – Converged Data Architecture&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Native support for relational, vector, JSON, graph, spatial, and more — all in one database&lt;/li&gt;
    &lt;li&gt;Unified support for OLTP, analytics, AI Vector Search, Agentic AI, IoT, and streaming&lt;/li&gt;
    &lt;li&gt;Single management plane via Oracle Enterprise Manager and OCI Database Management&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;End Data Lock-in – Open &amp;amp; Multicloud&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Autonomous AI Lakehouse&lt;/strong&gt; with full Apache Iceberg support&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Oracle Vectors on Ice&lt;/strong&gt; — Run AI Vector Search directly on Iceberg tables in your data lake&lt;/li&gt;
    &lt;li&gt;Available on OCI, AWS, Azure, Google Cloud, and on-premises (Exadata, etc.)&lt;/li&gt;
    &lt;li&gt;Oracle APEX for rapid low-code development&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;End Data Risk – Mission-Critical Security &amp;amp; Availability&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Oracle Database Vault, Label Security, SQL Firewall, Deep Data Security&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Flashback Technologies&lt;/strong&gt; and Zero Data Loss Cloud Protect&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Real Application Clusters (RAC), Active Data Guard, Globally Distributed Database&lt;/strong&gt; with RAFT replication&lt;/li&gt;
    &lt;li&gt;Post-quantum cryptography support&lt;/li&gt;
    &lt;li&gt;True Cache for consistent mid-tier caching&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Oracle AI Database 26ai is more than just a database — it’s a complete AI-powered data platform that brings together vectors, agents, analytics, and mission-critical OLTP in one secure, high-performance engine.&lt;/p&gt;

&lt;p&gt;Whether you’re building RAG applications, agentic workflows, or modern data lakehouses, Oracle AI Database gives you the convergence, security, and performance enterprises demand — without data movement or lock-in.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/7724013260552679385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/7724013260552679385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/7724013260552679385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/7724013260552679385'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/05/oracle-ai-database-26ai-complete-guide.html' title='Oracle AI Database 26ai: The Complete Guide to Key Features'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-193612230222633294</id><published>2026-05-08T23:46:00.000-07:00</published><updated>2026-05-20T23:47:26.443-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Active Data Guard"/><category scheme="http://www.blogger.com/atom/ns#" term="Converged Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Exadata"/><category scheme="http://www.blogger.com/atom/ns#" term="Flashback"/><category scheme="http://www.blogger.com/atom/ns#" term="OLTP"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle AI Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Real Application Clusters"/><title type='text'>Why Oracle AI Database is the Best Choice for Modern OLTP Workloads</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Modern OLTP systems power the heartbeat of business — processing orders, payments, bookings, and customer interactions with strict demands for low latency, high concurrency, and unbreakable reliability. Oracle AI Database delivers exactly what mission-critical OLTP needs, combining decades of proven engineering with the latest AI and converged database innovations.&lt;/p&gt;

&lt;h3&gt;Enterprise-Grade High Availability&lt;/h3&gt;
&lt;p&gt;Oracle AI Database is built for continuous operations using Maximum Availability Architecture (MAA):&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Real Application Clusters (RAC)&lt;/strong&gt; — Active-active clustering with instant failover and Transparent Application Continuity that masks outages from applications.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Active Data Guard&lt;/strong&gt; — Zero-data-loss protection, automatic failover, and offload reporting to standby databases.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Globally Distributed Database&lt;/strong&gt; — Sharded active-active architectures for massive scale across regions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Predictable Low Latency &amp;amp; High Performance&lt;/h3&gt;
&lt;p&gt;Especially powerful on Exadata, Oracle AI Database delivers consistently low tail latency:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Sub-millisecond reads and commits even under heavy load&lt;/li&gt;
    &lt;li&gt;AI Smart Scan and storage offload for faster processing&lt;/li&gt;
    &lt;li&gt;RDMA networking and XRMEM for ultra-low latency communication&lt;/li&gt;
    &lt;li&gt;Partner Cache Reads to maintain performance during maintenance or failures&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Rock-Solid Concurrency &amp;amp; Scalability&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Advanced multi-version concurrency control (MVCC) for consistent reads without blocking writers&lt;/li&gt;
    &lt;li&gt;Optimized redo logging for predictable commit behavior&lt;/li&gt;
    &lt;li&gt;RAC Cache Fusion for efficient block sharing across cluster nodes&lt;/li&gt;
    &lt;li&gt;Proven ability to handle thousands of concurrent sessions and mixed OLTP + analytics workloads&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Superior Data Protection &amp;amp; Recoverability&lt;/h3&gt;
&lt;p&gt;Oracle provides unmatched protection against both technical and human errors:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Flashback Technologies&lt;/strong&gt; — Query or rewind the database, tables, or individual transactions to any point in time while staying online.&lt;/li&gt;
    &lt;li&gt;Online schema changes and Edition-Based Redefinition for zero-downtime application upgrades.&lt;/li&gt;
    &lt;li&gt;Comprehensive RMAN backup and recovery with fast incremental backups and block-level recovery.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Enterprise Security Built into the Database&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Database Vault, Label Security, and Virtual Private Database for fine-grained access control&lt;/li&gt;
    &lt;li&gt;Transparent Data Encryption and Key Vault for data at rest&lt;/li&gt;
    &lt;li&gt;SQL Firewall to block injection attacks and unauthorized SQL&lt;/li&gt;
    &lt;li&gt;Unified Auditing and Deep Data Security for agentic AI workloads&lt;/li&gt;
    &lt;li&gt;Post-quantum cryptography support (ML-KEM, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Operational Maturity &amp;amp; Ease of Management&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Automatic Workload Repository (AWR), Active Session History (ASH), and SQL Monitor for deep diagnostics&lt;/li&gt;
    &lt;li&gt;Multitenant architecture for efficient consolidation and fleet management&lt;/li&gt;
    &lt;li&gt;Powerful automation with Fleet Patching &amp;amp; Provisioning and Enterprise Manager&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Converged Capabilities for Modern Applications&lt;/h3&gt;
&lt;p&gt;Oracle AI Database is not just an OLTP engine — it’s a converged platform that supports:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;JSON document store (SODA)&lt;/li&gt;
    &lt;li&gt;AI Vector Search for semantic capabilities&lt;/li&gt;
    &lt;li&gt;Graph, spatial, and machine learning — all in the same database&lt;/li&gt;
    &lt;li&gt;Apache Iceberg support for lakehouse integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;For organizations that require predictable performance, continuous availability, strong security, and operational excellence in their transactional systems, Oracle AI Database remains the most mature and capable platform available today.&lt;/p&gt;

&lt;p&gt;Whether running on Exadata, Cloud, or on-premises, it delivers the reliability enterprises have trusted for decades — now enhanced with powerful AI and converged data capabilities for the next generation of intelligent applications.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/193612230222633294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/193612230222633294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/193612230222633294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/193612230222633294'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/05/why-oracle-ai-database-is-best-choice.html' title='Why Oracle AI Database is the Best Choice for Modern OLTP Workloads'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-2874068299613912572</id><published>2026-05-01T23:27:00.000-07:00</published><updated>2026-05-20T23:28:22.533-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GPU Offload"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle 23ai"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 26ai"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Vector Index"/><category scheme="http://www.blogger.com/atom/ns#" term="Private AI Services"/><category scheme="http://www.blogger.com/atom/ns#" term="Vector Search"/><title type='text'>Speed Up Vector Search in Oracle AI Database: GPU Offload Made Simple</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Creating and maintaining vector indexes on millions of embeddings can be painfully slow on CPU alone. Oracle AI Database (23ai/26ai) now lets you offload this heavy lifting to a GPU — delivering massive performance gains while keeping your database CPU free for queries and transactions.&lt;/p&gt;

&lt;p&gt;In this practical guide, you’ll learn how to set up GPU-powered vector index creation using the Private AI Services Container — perfect for developers and DBAs who want faster indexing without complex infrastructure.&lt;/p&gt;

&lt;h3&gt;Why GPU Offload Matters for Vector Workloads&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;CPU-based HNSW index creation is slow on large datasets&lt;/li&gt;
    &lt;li&gt;GPU can build indexes significantly faster (often 5x–10x depending on data size)&lt;/li&gt;
    &lt;li&gt;Frees up database CPU for real-time similarity searches&lt;/li&gt;
    &lt;li&gt;Easy to run on separate machines (on-prem or cloud)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;High-Level Architecture&lt;/h3&gt;
&lt;p&gt;Your Oracle AI Database sends embedding vectors to a remote GPU container over a secure HTTPS connection. The GPU builds the index and sends it back. The whole process is transparent to your SQL queries.&lt;/p&gt;

&lt;h3&gt;Prerequisites (Keep It Minimal)&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Oracle AI Database 23ai or 26ai (Free or Enterprise)&lt;/li&gt;
    &lt;li&gt;One NVIDIA GPU with compute capability 7.5+ (RTX 3060, A10, A100, etc.)&lt;/li&gt;
    &lt;li&gt;Oracle Linux 8 or 9 on the GPU machine&lt;/li&gt;
    &lt;li&gt;At least 24GB VRAM recommended for good performance&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Step-by-Step Setup Overview&lt;/h3&gt;

&lt;h4&gt;1. Prepare the GPU Server&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;# Update system and install GPU drivers (OCI GPU images come pre-installed)
sudo dnf update -y

# Install NVIDIA Container Toolkit
curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
sudo dnf install -y nvidia-container-toolkit

# Verify GPU
nvidia-smi&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;2. Install Podman and Pull the Container&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;sudo dnf install -y container-tools

# Login to Oracle Container Registry
podman login container-registry.oracle.com

# Pull the GPU Index Service image
podman pull container-registry.oracle.com/database/private-ai:gpu-index-26.1.0.0.0&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;3. Run the Easy Setup Scripts&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;# Extract setup scripts from container
IMAGEID=`podman create container-registry.oracle.com/database/private-ai:gpu-index-26.1.0.0.0`
podman cp $IMAGEID:/privateai/scripts/privateai-setup-gpu-index-26.1.0.0.0.zip .
unzip privateai-setup-gpu-index-26.1.0.0.0.zip

# Run configuration
mkdir -p ~/privateai ~/secrets
cd setup
./secretsSetup.sh -s ~/secrets
./configSetup.sh -d ~/privateai -s ~/secrets
./containerSetup.sh -d ~/privateai&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;4. Start and Verify the Service&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;podman ps
curl --http2-prior-knowledge --cacert ~/secrets/cert.pem https://$(hostname -f):8443/health&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Connect from Oracle AI Database&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- In your database session
BEGIN
  DBMS_VECTOR_INDEX.SET_OFFLOAD(
    offload_url =&amp;gt; &#39;https://your-gpu-host:8443/v1/index&#39;,
    api_key     =&amp;gt; &#39;your-api-key-from-secrets&#39;,
    cert_path   =&amp;gt; &#39;/path/to/cert.pem&#39;
  );
END;
/&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Best Practices &amp;amp; Tips&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Run the GPU container on a separate machine from the database for best results&lt;/li&gt;
    &lt;li&gt;Start with smaller datasets to test performance gains&lt;/li&gt;
    &lt;li&gt;Monitor GPU utilization with &lt;code&gt;nvidia-smi&lt;/code&gt; during index creation&lt;/li&gt;
    &lt;li&gt;Use TLS 1.3 (automatically configured by the setup scripts)&lt;/li&gt;
    &lt;li&gt;Scale vertically with bigger GPUs or horizontally with multiple GPU nodes later&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Expected Results&lt;/h3&gt;
&lt;p&gt;Users typically see **dramatic reductions** in index creation time — especially on datasets with millions of vectors. Your database remains responsive while the heavy compute happens on the GPU.&lt;/p&gt;

&lt;h3&gt;Next Steps&lt;/h3&gt;
&lt;p&gt;Once set up, you can create vector indexes normally using &lt;code&gt;DBMS_VECTOR_INDEX.CREATE_INDEX&lt;/code&gt; — the offload happens automatically in the background.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/2874068299613912572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/2874068299613912572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2874068299613912572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2874068299613912572'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/05/speed-up-vector-search-in-oracle-ai.html' title='Speed Up Vector Search in Oracle AI Database: GPU Offload Made Simple'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-6728585576534976567</id><published>2026-04-29T23:44:00.000-07:00</published><updated>2026-05-20T23:45:15.699-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Agentic AI"/><category scheme="http://www.blogger.com/atom/ns#" term="AI Vector Search"/><category scheme="http://www.blogger.com/atom/ns#" term="Exadata Developers"/><category scheme="http://www.blogger.com/atom/ns#" term="Free Development License"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle AI Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Private Agent Factory"/><category scheme="http://www.blogger.com/atom/ns#" term="rag"/><title type='text'>Build Enterprise AI Agents on Real Exadata - Zero Database License Cost for Development</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Most AI agents fail in the real world because they don’t have secure, real-time access to enterprise data. Oracle solves this by bringing AI directly to your data — and now you can do it on production-grade Exadata infrastructure completely free during development and testing.&lt;/p&gt;

&lt;h3&gt;Why This Matters for Developers&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;No more moving or duplicating sensitive data to build RAG or agentic apps&lt;/li&gt;
    &lt;li&gt;Work with real Exadata performance (AI Smart Scan, RDMA, Smart Flash)&lt;/li&gt;
    &lt;li&gt;Full access to Oracle AI Vector Search, JSON, Graph, and converged database features&lt;/li&gt;
    &lt;li&gt;Zero Oracle Database licensing cost for dev/test environments&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Oracle AI Database Private Agent Factory&lt;/h3&gt;
&lt;p&gt;A no-code / low-code platform to build powerful, secure AI agents that work directly with your enterprise data:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Knowledge Agent&lt;/strong&gt; — Ready-to-use RAG over your documents and internal systems&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Data Analysis Agent&lt;/strong&gt; — Natural language analytics directly on structured data&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Visual Agent Builder&lt;/strong&gt; — Drag-and-drop workflow designer with tools, data sources, and LLMs&lt;/li&gt;
    &lt;li&gt;Built-in security, auditing, row-level access controls, and human-in-the-loop&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;In-Database AI Vector Search on Exadata&lt;/h3&gt;
&lt;p&gt;Store vectors alongside relational, JSON, and unstructured data in the same database. Run hybrid semantic + SQL queries at lightning speed thanks to Exadata’s AI Smart Scan and storage offload.&lt;/p&gt;

&lt;p&gt;No separate vector database. No data synchronization headaches.&lt;/p&gt;

&lt;h3&gt;Exadata Database Service for Developers — Free Tier&lt;/h3&gt;
&lt;p&gt;Oracle now offers a dedicated developer environment on full Exadata infrastructure with:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Real Exadata hardware and software (same as production)&lt;/li&gt;
    &lt;li&gt;Oracle AI Database 26ai features included&lt;/li&gt;
    &lt;li&gt;Zero license cost for development and testing&lt;/li&gt;
    &lt;li&gt;Resource limits appropriate for dev workloads&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Quick Start Steps&lt;/h3&gt;
&lt;ol&gt;
    &lt;li&gt;Provision a free &lt;strong&gt;Exadata Database Service for Developers&lt;/strong&gt; instance&lt;/li&gt;
    &lt;li&gt;Deploy Oracle AI Database Private Agent Factory from Oracle Cloud Marketplace&lt;/li&gt;
    &lt;li&gt;Use the Visual Agent Builder to connect agents to your data&lt;/li&gt;
    &lt;li&gt;Build RAG agents, analysis agents, or custom multi-agent workflows&lt;/li&gt;
    &lt;li&gt;Test with real Exadata performance before moving to production&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Best Practices for Success&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Keep data movement to absolute minimum — let agents query data where it lives&lt;/li&gt;
    &lt;li&gt;Use in-database vector indexes for fast similarity search&lt;/li&gt;
    &lt;li&gt;Start with pre-built agents and customize them&lt;/li&gt;
    &lt;li&gt;Implement strict governance and approval workflows for production agents&lt;/li&gt;
    &lt;li&gt;Leverage Exadata’s hardware acceleration for large-scale vector workloads&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Oracle AI Database Private Agent Factory combined with the free Exadata Database Service for Developers gives you everything you need to build secure, high-performance AI agents on real enterprise data — at zero license cost during development.&lt;/p&gt;

&lt;p&gt;Stop moving data to AI. Bring AI to your data — on the world’s best database platform for it.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/6728585576534976567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/6728585576534976567' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6728585576534976567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6728585576534976567'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/04/build-enterprise-ai-agents-on-real.html' title='Build Enterprise AI Agents on Real Exadata - Zero Database License Cost for Development'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-963057727041280835</id><published>2026-04-24T23:25:00.000-07:00</published><updated>2026-05-20T23:26:08.005-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Agentic AI"/><category scheme="http://www.blogger.com/atom/ns#" term="AI Budgeting"/><category scheme="http://www.blogger.com/atom/ns#" term="AI Cost Management"/><category scheme="http://www.blogger.com/atom/ns#" term="Developer Tips"/><category scheme="http://www.blogger.com/atom/ns#" term="Runtime Controls"/><title type='text'>Building Cost-Safe AI Agents: Practical Runtime Spending Limits That Actually Work</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Agentic AI systems are incredibly powerful — but they can quietly burn through your API budget in minutes if left unchecked. A single agent that gets stuck in a retry loop, over-delegates, or keeps calling expensive models can turn a $2 task into a $200 surprise.&lt;/p&gt;

&lt;p&gt;Here’s a practical, developer-friendly approach to add smart runtime budget controls that prevent runaway costs without killing useful work.&lt;/p&gt;

&lt;h3&gt;Why Most Budget Controls Fail in Agentic AI&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Post-run dashboards only tell you what already happened.&lt;/li&gt;
    &lt;li&gt;Hard token caps feel too restrictive and stop good runs prematurely.&lt;/li&gt;
    &lt;li&gt;Developers need controls that understand context — not just raw numbers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The solution? Lightweight runtime spending limits that watch behavior in real time and take smart action before costs explode.&lt;/p&gt;

&lt;h3&gt;Core Idea: Context-Aware Budget Tracking&lt;/h3&gt;
&lt;p&gt;Instead of a simple dollar counter, track three things at every step:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Actual spend so far&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Estimated remaining cost&lt;/strong&gt; for the current plan&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Progress score&lt;/strong&gt; — is the agent actually getting closer to the goal?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Implementation in 5 Minutes (Python Example)&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;class BudgetGuard:
    def __init__(self, max_budget=5.0, warning_threshold=0.7):
        self.max_budget = max_budget          # e.g. $5.00
        self.spent = 0.0
        self.warning_threshold = warning_threshold
    
    def check(self, step_cost_estimate: float, progress_score: float) -&amp;gt; str:
        self.spent += step_cost_estimate
        
        if self.spent &amp;gt; self.max_budget:
            return &quot;TERMINATE&quot;
        
        remaining = self.max_budget - self.spent
        burn_rate_ok = progress_score &amp;gt; 0.3 or remaining &amp;gt; 2.0
        
        if self.spent / self.max_budget &amp;gt; self.warning_threshold and not burn_rate_ok:
            return &quot;DEGRADE&quot;      # switch to cheaper model, limit tools
        
        if self.spent / self.max_budget &amp;gt; 0.9:
            return &quot;APPROVAL&quot;     # pause and ask human
        
        return &quot;CONTINUE&quot;

# Usage in your agent loop
guard = BudgetGuard(max_budget=8.0)

for step in agent_steps:
    estimated_cost = calculate_step_cost(step)   # e.g. model price × tokens
    progress = evaluate_progress(current_state)  # 0.0 to 1.0
    
    decision = guard.check(estimated_cost, progress)
    
    if decision == &quot;TERMINATE&quot;:
        print(&quot;Budget limit reached - stopping safely&quot;)
        break
    elif decision == &quot;DEGRADE&quot;:
        agent.switch_to_cheap_model()
        agent.limit_tool_usage()
    # ... continue execution
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Smart Actions When Limits Are Hit&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;DEGRADE&lt;/strong&gt;: Switch to faster/cheaper model, disable expensive tools, reduce retry attempts&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;APPROVAL&lt;/strong&gt;: Pause and send a summary to Slack/Teams for human review&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;TERMINATE&lt;/strong&gt;: Gracefully stop with full trace and cost breakdown&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Real-World Example: Research Agent Gone Wrong&lt;/h3&gt;
&lt;p&gt;An agent researching market trends starts calling premium models 40+ times with almost no new insights. Without controls, it easily exceeds $50. With the guard in place:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;After 8 expensive calls with low progress → automatically degrades to a lighter model&lt;/li&gt;
    &lt;li&gt;After 12 calls → requests human approval with a one-click summary&lt;/li&gt;
    &lt;li&gt;Never reaches the $50 mark&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Best Practices for Developers&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Estimate cost before every model call or tool invocation&lt;/li&gt;
    &lt;li&gt;Calculate a simple progress score (new information gained, task completeness)&lt;/li&gt;
    &lt;li&gt;Log every decision with trace ID for later debugging&lt;/li&gt;
    &lt;li&gt;Start with generous limits in dev, tighten them in production&lt;/li&gt;
    &lt;li&gt;Combine with token limits and time limits for layered protection&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Runtime budget controls turn expensive surprises into predictable, manageable behavior. By checking spend against real progress at every step, you keep your agentic AI systems both powerful and cost-efficient.&lt;/p&gt;

&lt;p&gt;No more “I ran one agent and got a $400 bill” stories. Just reliable, governed AI that stays within budget while still delivering results.&lt;/p&gt;

&lt;p&gt;:&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/963057727041280835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/963057727041280835' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/963057727041280835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/963057727041280835'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/04/building-cost-safe-ai-agents-practical.html' title='Building Cost-Safe AI Agents: Practical Runtime Spending Limits That Actually Work'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-2950380635437692046</id><published>2026-04-22T23:40:00.000-07:00</published><updated>2026-05-20T23:41:27.498-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ai agents"/><category scheme="http://www.blogger.com/atom/ns#" term="Database Automation"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle AI Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Development"/><category scheme="http://www.blogger.com/atom/ns#" term="Prompt Engineering"/><category scheme="http://www.blogger.com/atom/ns#" term="SQLcl MCP Server"/><title type='text'>Oracle SQLcl + MCP Server: Chat with Your Database Using AI</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Oracle SQLcl just got supercharged. With the built-in **MCP Server**, you can now talk to your Oracle Database using natural language through any AI agent or LLM. It’s one of the most powerful developer productivity tools released for Oracle AI Database professionals.&lt;/p&gt;

&lt;h3&gt;What is SQLcl MCP Server?&lt;/h3&gt;
&lt;p&gt;MCP (Model Context Protocol) Server turns SQLcl into a bridge between your Oracle Database and modern AI models. It allows LLMs (like Claude, GPT, Gemini, or local models) to:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Execute SQL queries interactively&lt;/li&gt;
    &lt;li&gt;Generate schema objects and sample data&lt;/li&gt;
    &lt;li&gt;Perform data loading and transformation&lt;/li&gt;
    &lt;li&gt;Create reports and analytics views&lt;/li&gt;
    &lt;li&gt;Build complete applications from prompts&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Key Benefits&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Works Everywhere&lt;/strong&gt; — Oracle 19c, 23ai, 26ai, on-premises, cloud (OCI, AWS, Azure, Google), or even your laptop&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Free &amp;amp; Lightweight&lt;/strong&gt; — SQLcl is completely free&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Secure&lt;/strong&gt; — Runs with your existing database credentials and security model&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Highly Extensible&lt;/strong&gt; — Works with Cline, Cursor, VS Code agents, LangChain, and more&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Quick Start: Enable MCP Server&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;# 1. Start SQLcl
sql /nolog

# 2. Enable MCP Server
MCP START;

# 3. Note the port (usually 8080 or 5050)
MCP STATUS;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once running, connect your favorite AI coding agent to the MCP endpoint and start chatting with your database.&lt;/p&gt;

&lt;h3&gt;Real-World Use Cases&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Generate entire schemas with realistic data using a single prompt&lt;/li&gt;
    &lt;li&gt;Ask “Show me sales by region last quarter” and get formatted results&lt;/li&gt;
    &lt;li&gt;Build RAG applications that query live database data&lt;/li&gt;
    &lt;li&gt;Automate data transformation and ETL tasks&lt;/li&gt;
    &lt;li&gt;Prototype new features in minutes instead of hours&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Best Practices&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Always use a dedicated low-privilege test user when experimenting&lt;/li&gt;
    &lt;li&gt;Review AI-generated SQL before executing in production&lt;/li&gt;
    &lt;li&gt;Combine with SQLcl Projects (Liquibase + Git) for version control&lt;/li&gt;
    &lt;li&gt;Use detailed, structured prompts for best results&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Oracle SQLcl with MCP Server is a game-changer for modern Oracle developers and DBAs. It brings the power of AI directly into your database workflow, dramatically increasing productivity while maintaining full control and security.&lt;/p&gt;

&lt;p&gt;Whether you’re building new applications, exploring data, or automating routine tasks — SQLcl MCP Server makes your Oracle AI Database truly conversational.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/2950380635437692046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/2950380635437692046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2950380635437692046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2950380635437692046'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/04/oracle-sqlcl-mcp-server-chat-with-your.html' title='Oracle SQLcl + MCP Server: Chat with Your Database Using AI'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-2760331427920691306</id><published>2026-04-10T23:29:00.000-07:00</published><updated>2026-05-20T23:30:13.663-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AMD MI300X"/><category scheme="http://www.blogger.com/atom/ns#" term="Disaggregated Inference"/><category scheme="http://www.blogger.com/atom/ns#" term="Generative AI"/><category scheme="http://www.blogger.com/atom/ns#" term="LLM Serving"/><category scheme="http://www.blogger.com/atom/ns#" term="llm-d"/><category scheme="http://www.blogger.com/atom/ns#" term="OKE"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Cloud Infrastructure"/><title type='text'>Run Production LLMs Faster &amp; Cheaper on OCI: Practical Guide to llm-d with Disaggregated Inference</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Moving Large Language Models from quick demos to real production is tough. Traffic is unpredictable, context windows grow, and costs can explode if your serving setup isn’t optimized.&lt;/p&gt;

&lt;p&gt;Here’s a better way: Use **llm-d** (a Kubernetes-native open-source framework) on Oracle Cloud Infrastructure (OCI) to separate prompt processing from token generation. This “disaggregated” approach delivers more consistent latency, higher GPU efficiency, and lower overall cost — without throwing more hardware at the problem.&lt;/p&gt;

&lt;h3&gt;Why Traditional LLM Serving Falls Short in Production&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Prompt ingestion (prefill) is compute-heavy&lt;/li&gt;
    &lt;li&gt;Token generation (decode) is memory-bandwidth sensitive&lt;/li&gt;
    &lt;li&gt;Running both on the same GPU replicas leads to poor utilization and inconsistent latency&lt;/li&gt;
    &lt;li&gt;Scaling out identical replicas wastes resources under real user loads&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;llm-d solves this by letting you run specialized workers for prefill and decode phases independently — giving each phase exactly what it needs.&lt;/p&gt;

&lt;h3&gt;Key Benefits You’ll See in Production&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;10–30% better GPU efficiency&lt;/li&gt;
    &lt;li&gt;Much more stable latency even as user count grows&lt;/li&gt;
    &lt;li&gt;Lower infrastructure cost for the same performance&lt;/li&gt;
    &lt;li&gt;Easy scaling using familiar Kubernetes tools&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Architecture Overview&lt;/h3&gt;
&lt;p&gt;llm-d on OCI uses Oracle Kubernetes Engine (OKE) + Bare Metal AMD MI300X GPUs. Prefill workers handle heavy prompt processing, while decode workers focus on fast token streaming. RDMA networking keeps communication between nodes extremely fast.&lt;/p&gt;

&lt;h3&gt;Quick Start: Deploy llm-d on OKE&lt;/h3&gt;

&lt;h4&gt;1. Prepare Your OKE Cluster&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;# Create OKE cluster with AMD MI300X bare metal nodes
# Use shapes like BM.GPU.MI300X.8 for high-memory GPUs

# Install kubectl and configure access
oci ce cluster create-kubeconfig --cluster-id &amp;lt;your-cluster-id&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;2. Deploy llm-d with Disaggregated Mode&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;# Clone the llm-d repo with OCI/AMD examples
git clone https://github.com/llm-d/llm-d.git
cd llm-d

# Apply the disaggregated deployment (prefill + decode)
kubectl apply -f examples/oci-amd/disaggregated/

# Check pods
kubectl get pods -n llm-serving
kubectl get services -n llm-serving&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;3. Configure Your Model&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;# Example values for Llama-3.1-70B or similar
model:
  name: meta-llama/Llama-3.3-70B-Instruct
  tensor-parallel: 8
  pipeline-parallel: 2

serving:
  prefill:
    replicas: 4
    gpu-memory-utilization: 0.85
  decode:
    replicas: 8
    gpu-memory-utilization: 0.75&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Real-World Performance Gains&lt;/h3&gt;
&lt;p&gt;Teams running disaggregated inference on OCI typically see:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Flatter, more predictable latency curves under load&lt;/li&gt;
    &lt;li&gt;Better throughput per GPU compared to traditional serving&lt;/li&gt;
    &lt;li&gt;Ability to serve more concurrent users on the same hardware&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Best Practices for Production&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Start with 2–4 node clusters and scale horizontally&lt;/li&gt;
    &lt;li&gt;Monitor GPU utilization separately for prefill and decode pods&lt;/li&gt;
    &lt;li&gt;Use OCI Monitoring + Prometheus for custom dashboards&lt;/li&gt;
    &lt;li&gt;Implement request routing based on prompt length when possible&lt;/li&gt;
    &lt;li&gt;Enable auto-scaling based on queue depth and latency SLAs&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;llm-d on OCI gives you a modern, production-ready way to serve large language models efficiently. By separating prefill and decode phases on powerful AMD MI300X GPUs with OKE, you get better performance, lower costs, and much more predictable behavior under real traffic.&lt;/p&gt;

&lt;p&gt;Whether you’re building copilots, RAG systems, or agentic workflows — this approach helps you move from “it works in the demo” to “it works reliably at scale.”&lt;/p&gt;

&lt;p&gt;Ready to try it? Start with the official llm-d OCI examples and scale from there.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/2760331427920691306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/2760331427920691306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2760331427920691306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2760331427920691306'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/04/run-production-llms-faster-cheaper-on.html' title='Run Production LLMs Faster &amp; Cheaper on OCI: Practical Guide to llm-d with Disaggregated Inference'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-3447485300889112995</id><published>2026-03-18T21:42:00.000-07:00</published><updated>2026-03-18T21:42:08.021-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="nemoclaw"/><category scheme="http://www.blogger.com/atom/ns#" term="openclaw"/><category scheme="http://www.blogger.com/atom/ns#" term="openshell"/><title type='text'>NemoClaw Tutorial: Run Locally with Free Local Models: Easy Guide</title><content type='html'>&lt;p&gt;&amp;nbsp;This video locally installs NemoClaw with OpenShell and vllm Qwen3.5 9B.&lt;/p&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;343&quot; src=&quot;https://www.youtube.com/embed/k1kl6xPb_HU&quot; width=&quot;476&quot; youtube-src-id=&quot;k1kl6xPb_HU&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/3447485300889112995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/3447485300889112995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/3447485300889112995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/3447485300889112995'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/03/nemoclaw-tutorial-run-locally-with-free.html' title='NemoClaw Tutorial: Run Locally with Free Local Models: Easy Guide'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/k1kl6xPb_HU/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-6998596184554257751</id><published>2026-03-07T21:35:00.000-08:00</published><updated>2026-05-20T23:37:47.610-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AI Vector Search"/><category scheme="http://www.blogger.com/atom/ns#" term="Apache Iceberg"/><category scheme="http://www.blogger.com/atom/ns#" term="External Vector Tables"/><category scheme="http://www.blogger.com/atom/ns#" term="graphrag"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 26ai"/><category scheme="http://www.blogger.com/atom/ns#" term="Semantic Search"/><title type='text'>Run Semantic Search Directly on Apache Iceberg Tables with Oracle AI Database 26ai</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Tired of duplicating massive datasets just to add vector search capabilities? With Oracle AI Database 26ai, you can now run high-performance similarity search directly on your existing Apache Iceberg tables stored in object storage — no data copying, no extra ETL pipelines, and no governance headaches.&lt;/p&gt;

&lt;p&gt;This feature is a game-changer for data lakes built on Iceberg, Parquet, and cloud storage (OCI Object Storage, S3, etc.).&lt;/p&gt;

&lt;h3&gt;Why This Matters&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Avoid massive data duplication and sync issues&lt;/li&gt;
    &lt;li&gt;Keep data in its original governed location&lt;/li&gt;
    &lt;li&gt;Query Iceberg + Oracle tables together in the same SQL&lt;/li&gt;
    &lt;li&gt;Create fast vector indexes without moving the source data&lt;/li&gt;
    &lt;li&gt;Works great for RAG, semantic search, and recommendation systems&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Step-by-Step: Query Iceberg Vectors in Minutes&lt;/h3&gt;

&lt;h4&gt;1. Create External Table over Iceberg&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;CREATE TABLE ext_iceberg_vectors (
    id           VARCHAR2(100),
    content      CLOB,
    embedding    VECTOR(1024, FLOAT32)   -- match your embedding dimension
)
ORGANIZATION EXTERNAL
(
    TYPE ORACLE_BIGDATA
    DEFAULT DIRECTORY DATA_PUMP_DIR
    ACCESS PARAMETERS
    (
        com.oracle.bigdata.credential.name = &#39;OCI_CRED&#39;,
        com.oracle.bigdata.fileformat = &#39;parquet&#39;,
        com.oracle.bigdata.access_protocol = &#39;iceberg&#39;
    )
    LOCATION (&#39;iceberg:https://objectstorage.&amp;lt;region&amp;gt;.oraclecloud.com/.../metadata/v1.metadata.json&#39;)
)
REJECT LIMIT UNLIMITED;&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;2. Run Similarity Search (with on-the-fly embedding)&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;SELECT id,
       content,
       VECTOR_DISTANCE(embedding, 
                       VECTOR_EMBEDDING(embedding_model USING :search_query AS data)) AS score
FROM   ext_iceberg_vectors
ORDER  BY score
FETCH FIRST 10 ROWS ONLY;&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;3. Speed It Up with Vector Index&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;CREATE VECTOR INDEX iceberg_vec_idx 
ON ext_iceberg_vectors(embedding)
ORGANIZATION NEIGHBOR PARTITIONS
WITH TARGET ACCURACY 95;&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Best Practices for Production&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Use credential objects for secure access to object storage&lt;/li&gt;
    &lt;li&gt;Match vector dimension and type exactly with your embedding model&lt;/li&gt;
    &lt;li&gt;Create IVF or HNSW indexes for large Iceberg tables&lt;/li&gt;
    &lt;li&gt;Combine with Oracle tables in the same query for hybrid search&lt;/li&gt;
    &lt;li&gt;Great for air-gapped environments (embeddings run in-database via ONNX)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Real-World Use Cases&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Semantic search over data lake documents&lt;/li&gt;
    &lt;li&gt;RAG applications using Iceberg as the knowledge base&lt;/li&gt;
    &lt;li&gt;Real-time recommendations without data movement&lt;/li&gt;
    &lt;li&gt;Unified analytics across structured + unstructured data&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Oracle AI Database 26ai + Apache Iceberg gives you the best of both worlds: the governance and scale of a modern data lake with the powerful, familiar vector search capabilities of Oracle.&lt;/p&gt;

&lt;p&gt;No more unnecessary data copies. Just point, index, and query — delivering fast semantic search on your existing Iceberg tables today.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/6998596184554257751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/6998596184554257751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6998596184554257751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6998596184554257751'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/03/build-secure-enterprise-ai-agents-in_01086061917.html' title='Run Semantic Search Directly on Apache Iceberg Tables with Oracle AI Database 26ai'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-4632309930400370802</id><published>2026-03-06T21:31:00.000-08:00</published><updated>2026-05-20T23:32:40.096-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Agentic AI"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 26ai"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle AI Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Private Agent Factory"/><category scheme="http://www.blogger.com/atom/ns#" term="rag"/><category scheme="http://www.blogger.com/atom/ns#" term="Secure AI Agents"/><title type='text'>Build Secure Enterprise AI Agents in Minutes: Oracle Private Agent Factory</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Enterprise AI agents often fail in production due to data security concerns, complex coding, and integration nightmares. Oracle AI Database 26ai’s **Private Agent Factory** changes that — giving developers and DBAs a no-code platform to build, test, and deploy powerful, secure agents that work directly with your private enterprise data.&lt;/p&gt;

&lt;p&gt;Whether you need a Knowledge Agent for RAG, a Data Analysis Agent, or custom multi-agent workflows, Agent Factory makes it fast, safe, and production-ready.&lt;/p&gt;

&lt;h3&gt;Why Enterprises Love Private Agent Factory&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Fully Private &amp;amp; Air-Gapped&lt;/strong&gt; — Run everything on-premises or in isolated environments&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;No-Code Canvas&lt;/strong&gt; — Drag-and-drop agent builder with visual workflow design&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Native Oracle Integration&lt;/strong&gt; — Direct access to your database, vector search, and hybrid data&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Secure by Default&lt;/strong&gt; — Row-level security, data masking, auditing, and SQL Firewall&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Portable Agents&lt;/strong&gt; — Export using Open Agent Specification to LangGraph, CrewAI, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Key Capabilities&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Pre-built agents for Knowledge (RAG), Data Analysis, Finance, HR, and more&lt;/li&gt;
    &lt;li&gt;Connect to documents, databases, SharePoint, Object Storage, and REST APIs&lt;/li&gt;
    &lt;li&gt;Choose private LLMs, OCI GenAI, OpenAI, Gemini, or others&lt;/li&gt;
    &lt;li&gt;Multi-agent orchestration with human-in-the-loop approval&lt;/li&gt;
    &lt;li&gt;REST API + Chat interface for easy application integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Quick Start: Deploy Your First Agent&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;# 1. Download from Oracle Cloud Marketplace or Downloads
# 2. Deploy the Agent Factory Container (Docker/Podman)

podman run -d --name agent-factory \
  -p 8080:8080 \
  -v /path/to/data:/app/data \
  oracle/agent-factory:latest

# 3. Access the No-Code Builder
# Open browser → http://your-server:8080&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Building an Agent in the Canvas (Typical Flow)&lt;/h3&gt;
&lt;ol&gt;
    &lt;li&gt;Choose a template (e.g., Knowledge Agent)&lt;/li&gt;
    &lt;li&gt;Connect data sources (Oracle Database + Vector Store)&lt;/li&gt;
    &lt;li&gt;Select embedding model and LLM (private or cloud)&lt;/li&gt;
    &lt;li&gt;Define tools and workflows visually&lt;/li&gt;
    &lt;li&gt;Test with sample queries&lt;/li&gt;
    &lt;li&gt;Publish → Get secure REST endpoint&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Enterprise-Grade Security Highlights&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;In-database row/column/cell level security&lt;/li&gt;
    &lt;li&gt;Dynamic data masking for agents&lt;/li&gt;
    &lt;li&gt;Full audit trail of agent actions&lt;/li&gt;
    &lt;li&gt;SQL Firewall to block injection attacks&lt;/li&gt;
    &lt;li&gt;Zero Data Loss Recovery protection&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Best Practices for Production Agents&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Start with pre-built templates and customize&lt;/li&gt;
    &lt;li&gt;Always use private embeddings and vector indexes&lt;/li&gt;
    &lt;li&gt;Implement human approval gates for sensitive actions&lt;/li&gt;
    &lt;li&gt;Monitor agent performance and cost via Oracle AI Database tools&lt;/li&gt;
    &lt;li&gt;Export agents for version control and cross-team reuse&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Oracle Private Agent Factory removes the biggest barriers to enterprise Agentic AI — security, complexity, and integration. You can now build trustworthy agents that combine your private data with powerful LLMs, all while staying in full control.&lt;/p&gt;

&lt;p&gt;Perfect for developers who want speed and DBAs who demand governance. Available at no extra cost with Oracle AI Database 26ai — on cloud, on-premises, or hybrid.&lt;/p&gt;

&lt;p&gt;Ready to build your first production agent? Check out the hands-on labs and get started today.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/4632309930400370802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/4632309930400370802' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/4632309930400370802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/4632309930400370802'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/03/build-secure-enterprise-ai-agents-in.html' title='Build Secure Enterprise AI Agents in Minutes: Oracle Private Agent Factory'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-7527284998696575610</id><published>2026-02-13T21:39:00.000-08:00</published><updated>2026-05-20T23:39:54.690-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ai agent"/><category scheme="http://www.blogger.com/atom/ns#" term="Cline"/><category scheme="http://www.blogger.com/atom/ns#" term="Developer Productivity"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Prompt Engineering"/><category scheme="http://www.blogger.com/atom/ns#" term="Schema Automation"/><category scheme="http://www.blogger.com/atom/ns#" term="SQLcl MCP"/><title type='text'>Prompt Engineering Magic: Build Complete Oracle Schemas in Minutes with SQLcl MCP Server + AI Agent</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Starting a new project with an empty database schema? Stop writing DDL scripts manually. With **SQLcl MCP Server** and any good AI agent (Cline, Cursor, Claude, etc.), you can generate realistic tables, relationships, sample data, and useful views — all from a single well-crafted prompt.&lt;/p&gt;

&lt;p&gt;This powerful combination turns natural language into production-ready database objects in under 5 minutes.&lt;/p&gt;

&lt;h3&gt;Why This Approach Rocks&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Zero manual DDL writing&lt;/li&gt;
    &lt;li&gt;Consistent, realistic sample data with proper constraints&lt;/li&gt;
    &lt;li&gt;Foreign keys, indexes, comments — all handled automatically&lt;/li&gt;
    &lt;li&gt;Ready-to-use views for dashboards&lt;/li&gt;
    &lt;li&gt;Works with any Oracle database (19c, 23ai, 26ai, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;SQLcl with MCP Server enabled&lt;/li&gt;
    &lt;li&gt;VS Code + SQL Developer for VS Code extension&lt;/li&gt;
    &lt;li&gt;An AI coding agent (Cline recommended)&lt;/li&gt;
    &lt;li&gt;A test database user with &lt;code&gt;CONNECT&lt;/code&gt;, &lt;code&gt;RESOURCE&lt;/code&gt;, and &lt;code&gt;DB_DEVELOPER_ROLE&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;The Ultimate Starter Prompt&lt;/h3&gt;
&lt;p&gt;Copy and paste this prompt into your AI agent (replace &lt;code&gt;&amp;lt;USERNAME&amp;gt;&lt;/code&gt; with your schema name):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Create realistic vehicle schema with sample data and views

## Task
1. Connect as user &amp;lt;USERNAME&amp;gt;. If unsure, list available connections and ask me to choose.

2. Create these tables with proper constraints:
   - car, truck, motorcycle (with make, model, year, engine_displacement, wheelbase, etc.)
   - manufacturer (dba_name, hq_city, hq_country, founded_year, ownership_type)

   Add: Primary keys, Foreign keys, Indexes, Comments, and any useful extra columns.

3. Insert realistic sample data:
   - 50 rows each for car/truck/motorcycle
   - 25 rows for manufacturer
   Use bulk INSERT statements and COMMIT after each.

4. Show first 5 rows of every table to verify.

5. Create these 4 views + recommend 2 more useful ones with comments:
   - Vehicle Count by Manufacturer
   - Average Engine Displacement by Vehicle Type
   - Vehicles by Year of Manufacture
   - Manufacturer Details with Vehicle Counts

6. Once done, disconnect from the database.&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;How to Execute&lt;/h3&gt;
&lt;ol&gt;
    &lt;li&gt;Start SQLcl MCP Server&lt;/li&gt;
    &lt;li&gt;In your AI agent (e.g. Cline), create a new task and attach the prompt&lt;/li&gt;
    &lt;li&gt;Switch to **Plan** mode first → Review the plan&lt;/li&gt;
    &lt;li&gt;Switch to **Act** mode and let the agent execute&lt;/li&gt;
    &lt;li&gt;Approve steps as they appear&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;What You’ll Get Automatically&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;4 fully normalized tables with proper relationships&lt;/li&gt;
    &lt;li&gt;Realistic sample data (no duplicates, valid FKs)&lt;/li&gt;
    &lt;li&gt;Indexes and comments for maintainability&lt;/li&gt;
    &lt;li&gt;4+ useful analytical views ready for dashboards&lt;/li&gt;
    &lt;li&gt;Clean, commented SQL you can version-control&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Best Practices &amp;amp; Tips&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Always review the plan before switching to Act mode&lt;/li&gt;
    &lt;li&gt;Use a dedicated test schema&lt;/li&gt;
    &lt;li&gt;Be extremely specific in your prompt — the more details, the better the result&lt;/li&gt;
    &lt;li&gt;Save successful prompts in a library for reuse&lt;/li&gt;
    &lt;li&gt;Combine with SQLcl Projects (Liquibase + Git) for version control&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;SQLcl MCP Server + a smart AI agent is one of the fastest ways to bootstrap Oracle schemas in 2025–2026. What used to take hours of tedious scripting now takes minutes of thoughtful prompting.&lt;/p&gt;

&lt;p&gt;Try it today — you’ll never want to create sample schemas manually again.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/7527284998696575610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/7527284998696575610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/7527284998696575610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/7527284998696575610'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/02/prompt-engineering-magic-build-complete.html' title='Prompt Engineering Magic: Build Complete Oracle Schemas in Minutes with SQLcl MCP Server + AI Agent'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-8549786977516277506</id><published>2026-02-06T21:42:00.000-08:00</published><updated>2026-05-20T23:43:14.979-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JSON Document Store"/><category scheme="http://www.blogger.com/atom/ns#" term="Mapped Collections"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle 23ai"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 26ai"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Partitioning"/><category scheme="http://www.blogger.com/atom/ns#" term="SODA Collections"/><title type='text'>SODA Collections with Partitioning in Oracle Database: The Practical Guide</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Need to store large volumes of JSON documents in SODA collections while keeping query performance high? You can now combine the simplicity of SODA with the power of Oracle table partitioning using **Mapped Collections**.&lt;/p&gt;

&lt;p&gt;This approach lets you scale SODA collections efficiently without sacrificing flexibility.&lt;/p&gt;

&lt;h3&gt;Why Partition SODA Collections?&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Improve query performance on time-based or range-based data&lt;/li&gt;
    &lt;li&gt;Enable easy data archiving and purging (drop old partitions)&lt;/li&gt;
    &lt;li&gt;Better manage storage and maintenance for large document stores&lt;/li&gt;
    &lt;li&gt;Support massive document workloads while keeping SODA APIs simple&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Two Easy Ways to Add Partitioning&lt;/h3&gt;

&lt;h4&gt;Option 1: Using a Trigger (Most Flexible)&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;CREATE TABLE MYCOL (
    &quot;ID&quot;           VARCHAR2(255) NOT NULL,
    &quot;CREATED_ON&quot;   TIMESTAMP DEFAULT SYS_EXTRACT_UTC(SYSTIMESTAMP) NOT NULL,
    &quot;LAST_MODIFIED&quot; TIMESTAMP DEFAULT SYS_EXTRACT_UTC(SYSTIMESTAMP) NOT NULL,
    &quot;VERSION&quot;      VARCHAR2(255) NOT NULL,
    &quot;JSON_DOCUMENT&quot; BLOB,
    &quot;ORDER_TIMESTAMP&quot; TIMESTAMP NOT NULL,
    PRIMARY KEY (&quot;ID&quot;),
    CHECK (&quot;JSON_DOCUMENT&quot; IS JSON FORMAT JSON STRICT)
)
LOB(&quot;JSON_DOCUMENT&quot;) STORE AS (CACHE)
PARTITION BY RANGE (ORDER_TIMESTAMP) 
(
    PARTITION p2019 VALUES LESS THAN (TIMESTAMP &#39;2020-01-01 00:00:00&#39;),
    PARTITION p2020 VALUES LESS THAN (TIMESTAMP &#39;2021-01-01 00:00:00&#39;),
    PARTITION p2021 VALUES LESS THAN (TIMESTAMP &#39;2022-01-01 00:00:00&#39;)
);

-- Trigger to populate partition key from JSON
CREATE OR REPLACE TRIGGER MYCOL_PART_TRG
BEFORE INSERT OR UPDATE ON MYCOL
FOR EACH ROW
BEGIN
    :NEW.ORDER_TIMESTAMP := JSON_OBJECT_T.PARSE(:NEW.JSON_DOCUMENT).GET(&#39;timestamp&#39;).TO_TIMESTAMP;
END;
/&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Option 2: Using a Virtual Column (Simpler, No Trigger)&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;CREATE TABLE MYCOL (
    &quot;ID&quot;            VARCHAR2(255) NOT NULL,
    &quot;CREATED_ON&quot;    TIMESTAMP DEFAULT SYS_EXTRACT_UTC(SYSTIMESTAMP) NOT NULL,
    &quot;LAST_MODIFIED&quot; TIMESTAMP DEFAULT SYS_EXTRACT_UTC(SYSTIMESTAMP) NOT NULL,
    &quot;VERSION&quot;       VARCHAR2(255) NOT NULL,
    &quot;JSON_DOCUMENT&quot; BLOB,
    &quot;ORDER_TIMESTAMP&quot; TIMESTAMP GENERATED ALWAYS AS 
        (JSON_VALUE(&quot;JSON_DOCUMENT&quot;, &#39;$.timestamp&#39; RETURNING TIMESTAMP)) NOT NULL,
    PRIMARY KEY (&quot;ID&quot;),
    CHECK (&quot;JSON_DOCUMENT&quot; IS JSON FORMAT JSON STRICT)
)
LOB(&quot;JSON_DOCUMENT&quot;) STORE AS (CACHE)
PARTITION BY RANGE (ORDER_TIMESTAMP) 
(
    PARTITION p2019 VALUES LESS THAN (TIMESTAMP &#39;2020-01-01 00:00:00&#39;),
    PARTITION p2020 VALUES LESS THAN (TIMESTAMP &#39;2021-01-01 00:00:00&#39;)
);&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Create a Mapped SODA Collection&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;DECLARE
    metadata CLOB;
    col      SODA_COLLECTION_T;
BEGIN
    metadata := &#39;{
        &quot;tableName&quot;: &quot;MYCOL&quot;,
        &quot;keyColumn&quot;: {&quot;name&quot;:&quot;ID&quot;, &quot;sqlType&quot;:&quot;VARCHAR2&quot;, &quot;maxLength&quot;:255, &quot;assignmentMethod&quot;:&quot;UUID&quot;},
        &quot;contentColumn&quot;: {&quot;name&quot;:&quot;JSON_DOCUMENT&quot;, &quot;sqlType&quot;:&quot;BLOB&quot;, &quot;compress&quot;:&quot;NONE&quot;, &quot;cache&quot;:true},
        &quot;versionColumn&quot;: {&quot;name&quot;:&quot;VERSION&quot;, &quot;method&quot;:&quot;SHA256&quot;},
        &quot;lastModifiedColumn&quot;: {&quot;name&quot;:&quot;LAST_MODIFIED&quot;},
        &quot;creationTimeColumn&quot;: {&quot;name&quot;:&quot;CREATED_ON&quot;}
    }&#39;;

    col := DBMS_SODA.CREATE_COLLECTION(&#39;MYCOL&#39;, metadata, DBMS_SODA.CREATE_MODE_MAP);
END;
/&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Best Practices &amp;amp; Tips&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Use ISO 8601 format for timestamp fields in your JSON documents&lt;/li&gt;
    &lt;li&gt;Enable row movement if documents may change partitions: &lt;code&gt;ALTER TABLE MYCOL ENABLE ROW MOVEMENT;&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;Partition pruning works perfectly with regular SQL queries&lt;/li&gt;
    &lt;li&gt;You can still use all SODA operations (insert, find, replace, etc.) normally&lt;/li&gt;
    &lt;li&gt;Remember: Drop mapped collections via SODA API first, then drop the table manually if needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;With Mapped Collections, you can bring the full power of Oracle partitioning to your SODA document stores. Whether you prefer triggers or virtual columns, the setup is straightforward and gives you excellent performance and manageability for large-scale JSON workloads.&lt;/p&gt;

&lt;p&gt;This pattern is perfect for time-series data, audit logs, event stores, and any high-volume document use case.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/8549786977516277506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/8549786977516277506' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/8549786977516277506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/8549786977516277506'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/02/soda-collections-with-partitioning-in.html' title='SODA Collections with Partitioning in Oracle Database: The Practical Guide'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-4457270732587168556</id><published>2026-01-23T21:16:00.000-08:00</published><updated>2026-05-20T23:17:55.913-07:00</updated><title type='text'>Oracle 19c Developer: Super Fast JSON Handling with New Features</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Oracle Database 19c brings major improvements in JSON handling, making it production-ready for modern applications. Developers can now store, query, and index JSON documents with near-relational performance.&lt;/p&gt;

&lt;h3&gt;Why JSON in Oracle 19c is a Game Changer&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Native JSON data type with automatic validation&lt;/li&gt;
    &lt;li&gt;High-performance JSON search indexes&lt;/li&gt;
    &lt;li&gt;Powerful SQL/JSON functions with better optimization&lt;/li&gt;
    &lt;li&gt;Seamless integration with existing relational data&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;1. Creating JSON Columns &amp;amp; Tables&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;CREATE TABLE api_logs (
    log_id        NUMBER GENERATED ALWAYS AS IDENTITY,
    log_date      DATE DEFAULT SYSDATE,
    payload       JSON,                    -- Native JSON type
    CONSTRAINT json_check CHECK (payload IS JSON)
);&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;2. Inserting JSON Data&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;INSERT INTO api_logs (payload) VALUES (
    JSON_OBJECT(
        &#39;user_id&#39; VALUE 12345,
        &#39;action&#39; VALUE &#39;login&#39;,
        &#39;status&#39; VALUE &#39;success&#39;,
        &#39;items&#39; VALUE JSON_ARRAY(10, 20, 30),
        &#39;metadata&#39; VALUE JSON_OBJECT(&#39;ip&#39; VALUE &#39;192.168.1.1&#39;, &#39;browser&#39; VALUE &#39;Chrome&#39;)
    )
);&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;3. Super Fast Querying&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Simple queries
SELECT 
    payload.user_id,
    payload.status,
    JSON_VALUE(payload, &#39;$.metadata.ip&#39;) AS client_ip
FROM api_logs 
WHERE JSON_EXISTS(payload, &#39;$.action&#39;);

-- Complex filtering (very fast with index)
SELECT * FROM api_logs 
WHERE JSON_VALUE(payload, &#39;$.status&#39;) = &#39;success&#39;
  AND JSON_EXISTS(payload, &#39;$.items[*]?(@ &amp;gt; 15)&#39;); &lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;4. JSON Search Index (The Real Performance Booster)&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Create a search index (highly recommended for production)
CREATE SEARCH INDEX api_logs_idx ON api_logs(payload) 
FOR JSON 
PARAMETERS(&#39;SYNC EVERY 5 MINUTES&#39;);

-- Oracle automatically maintains this index
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Performance Tip:&lt;/strong&gt; JSON search indexes can improve query speed by 10x–100x on large datasets.&lt;/p&gt;

&lt;h3&gt;5. Updating &amp;amp; Merging JSON&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Update specific fields
UPDATE api_logs 
SET payload = JSON_MERGEPATCH(payload, 
    JSON_OBJECT(&#39;status&#39; VALUE &#39;failed&#39;, &#39;error_code&#39; VALUE 401))
WHERE log_id = 100;&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Best Practices for Developers&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Always create a &lt;strong&gt;JSON Search Index&lt;/strong&gt; on frequently queried columns.&lt;/li&gt;
    &lt;li&gt;Use &lt;code&gt;JSON_SERIALIZE&lt;/code&gt; when returning large JSON to clients.&lt;/li&gt;
    &lt;li&gt;Combine JSON with relational columns for hybrid models.&lt;/li&gt;
    &lt;li&gt;Monitor index usage with &lt;code&gt;DBA_INDEX_USAGE&lt;/code&gt;.&lt;/li&gt;
    &lt;li&gt;Avoid storing extremely large JSON documents (&amp;gt; 32KB) in one column.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;With Oracle 19c’s enhanced JSON capabilities, developers can build modern APIs and microservices without needing a separate NoSQL database. The combination of native JSON type + search indexes gives you the best of both relational power and document flexibility.&lt;/p&gt;

&lt;p&gt;Start using JSON today — your queries will thank you!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Oracle 19c | JSON | Developer Tips | Performance&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tags&lt;/strong&gt;: Oracle 19c, JSON, SQL/JSON, JSON Search Index, Developer Features&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/4457270732587168556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/4457270732587168556' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/4457270732587168556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/4457270732587168556'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/01/oracle-19c-developer-super-fast-json.html' title='Oracle 19c Developer: Super Fast JSON Handling with New Features'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-7363501171886613935</id><published>2026-01-17T20:42:00.000-08:00</published><updated>2026-05-20T22:42:59.842-07:00</updated><title type='text'>Oracle 19c DBA: Fast PDB Clone &amp; Refresh in Multitenant Environment</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Need to refresh a development PDB from production quickly in Oracle 19c? Here’s the fastest method.&lt;/p&gt;

&lt;h3&gt;Commands&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- On Source CDB
CREATE PLUGGABLE DATABASE dev_pdb FROM prod_pdb 
  FILE_NAME_CONVERT=(&#39;/u01/data/prod_pdb/&#39;,&#39;/u01/data/dev_pdb/&#39;) 
  SNAPSHOT COPY;

-- Open it
ALTER PLUGGABLE DATABASE dev_pdb OPEN;

-- Refresh (if using snapshot copy)
ALTER PLUGGABLE DATABASE dev_pdb CLOSE;
ALTER PLUGGABLE DATABASE dev_pdb OPEN UPGRADE;
-- Apply changes and reopen READ WRITE&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Advantage in 19c:&lt;/strong&gt; Snapshot Copy is extremely fast and uses almost zero additional storage.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Oracle 19c | Multitenant | PDB Clone | DBA&lt;/em&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/7363501171886613935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/7363501171886613935' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/7363501171886613935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/7363501171886613935'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/01/oracle-19c-dba-fast-pdb-clone-refresh.html' title='Oracle 19c DBA: Fast PDB Clone &amp; Refresh in Multitenant Environment'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-6305193780581344485</id><published>2026-01-16T20:41:00.000-08:00</published><updated>2026-05-20T22:42:13.548-07:00</updated><title type='text'>Oracle 19c Developer Feature: Automatic Indexing – Let Oracle Do the Work</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Oracle 19c introduced **Automatic Indexing** – a game changer for developers and DBAs dealing with slow queries.&lt;/p&gt;

&lt;h3&gt;How to Enable &amp;amp; Monitor&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Enable Automatic Indexing
EXEC DBMS_AUTO_INDEX.CONFIGURE(&#39;AUTO_INDEX_MODE&#39;,&#39;IMPLEMENT&#39;);

-- Check status
SELECT * FROM DBA_AUTO_INDEX_CONFIG;

-- Monitor auto indexes created
SELECT owner, table_name, index_name, status 
FROM dba_indexes 
WHERE index_type = &#39;FUNCTION-BASED NORMAL&#39; 
AND index_name LIKE &#39;SYS_AI%&#39;;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Developer Benefit:&lt;/strong&gt; No more manual index creation for ad-hoc queries. Oracle automatically creates, monitors, and drops unused indexes.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Oracle 19c | Automatic Indexing | Performance&lt;/em&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/6305193780581344485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/6305193780581344485' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6305193780581344485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6305193780581344485'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/01/oracle-19c-developer-feature-automatic.html' title='Oracle 19c Developer Feature: Automatic Indexing – Let Oracle Do the Work'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-6208305838655816818</id><published>2026-01-10T20:40:00.000-08:00</published><updated>2026-05-20T22:41:34.473-07:00</updated><title type='text'>Oracle 19c DBA Tip: Fix ORA-01555 Snapshot Too Old Error Quickly</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;One of the most frustrating errors DBAs face in Oracle 19c is &lt;strong&gt;ORA-01555: snapshot too old&lt;/strong&gt;. Here’s a practical fix.&lt;/p&gt;

&lt;h3&gt;Cause&lt;/h3&gt;
&lt;p&gt;Undo retention is too low or undo tablespace is undersized for long-running queries.&lt;/p&gt;

&lt;h3&gt;Solution&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Check current settings
SHOW PARAMETER undo_retention;
SELECT tablespace_name, size_in_gb FROM (
  SELECT tablespace_name, ROUND(SUM(bytes)/1024/1024/1024,2) size_in_gb 
  FROM dba_data_files GROUP BY tablespace_name);

-- Fix
ALTER SYSTEM SET undo_retention=7200 SCOPE=BOTH;   -- 2 hours

-- Resize undo tablespace
ALTER TABLESPACE UNDOTBS1 RESIZE 10G;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip (Developer):&lt;/strong&gt; Use &lt;code&gt;/*+ RESULT_CACHE */ &lt;/code&gt; or smaller batch processing in long queries.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/6208305838655816818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/6208305838655816818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6208305838655816818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/6208305838655816818'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/01/oracle-19c-dba-tip-fix-ora-01555.html' title='Oracle 19c DBA Tip: Fix ORA-01555 Snapshot Too Old Error Quickly'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-2787391390079402541</id><published>2026-01-09T20:38:00.000-08:00</published><updated>2026-05-20T22:39:05.912-07:00</updated><title type='text'>Oracle Database 19c Best Practices: Essential Tips for Performance, Security &amp; High Availability</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Oracle Database 19c is the final long-term support release of the 19c family. Following proven best practices ensures better performance, security, stability, and easier maintenance.&lt;/p&gt;

&lt;h3&gt;1. Architecture &amp;amp; Installation Best Practices&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Always use Multitenant Architecture (CDB + PDB) for new deployments.&lt;/li&gt;
    &lt;li&gt;Separate Oracle Home from data files and FRA (Fast Recovery Area).&lt;/li&gt;
    &lt;li&gt;Enable Automatic Memory Management (AMM) or use appropriate SGA/PGA settings.&lt;/li&gt;
    &lt;li&gt;Install latest RU (Release Update) / RUR patches regularly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;2. Database Configuration Best Practices&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Enable key parameters
ALTER SYSTEM SET db_flashback_retention_target=1440 SCOPE=BOTH;  -- 1 day
ALTER SYSTEM SET undo_retention=3600 SCOPE=BOTH;
ALTER SYSTEM SET enable_ddl_logging=TRUE SCOPE=BOTH;
ALTER SYSTEM SET diagnostic_dest=&#39;/u01/app/oracle/diag&#39; SCOPE=BOTH;&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
    &lt;li&gt;Use Automatic Undo Management and set proper undo tablespace size.&lt;/li&gt;
    &lt;li&gt;Enable Force Logging for GoldenGate / Data Guard setups.&lt;/li&gt;
    &lt;li&gt;Configure proper REDO log size (minimum 1GB per group) and multiple groups.&lt;/li&gt;
    &lt;li&gt;Turn on Automatic Statistics Gathering (default in 19c).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;3. Security Best Practices&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Use Oracle Unified Auditing (recommended over traditional auditing).&lt;/li&gt;
    &lt;li&gt;Implement Database Vault and Label Security where required.&lt;/li&gt;
    &lt;li&gt;Enforce strong password policies and profile limits.&lt;/li&gt;
    &lt;li&gt;Regularly rotate passwords and use Oracle Wallet for TDE (Transparent Data Encryption).&lt;/li&gt;
    &lt;li&gt;Apply least privilege principle – avoid granting DBA role unnecessarily.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;4. Performance Tuning Best Practices&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Regularly gather system statistics and fixed object statistics.&lt;/li&gt;
    &lt;li&gt;Use AWR, ADDM, and ASH reports for performance analysis.&lt;/li&gt;
    &lt;li&gt;Implement Index usage monitoring and rebuild indexes when needed.&lt;/li&gt;
    &lt;li&gt;Use Real Application Testing (RAT) before major changes.&lt;/li&gt;
    &lt;li&gt;Enable In-Memory Column Store for analytical workloads.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;5. High Availability &amp;amp; GoldenGate Best Practices&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Use Data Guard for disaster recovery (Maximum Performance mode for most cases).&lt;/li&gt;
    &lt;li&gt;For GoldenGate:
        &lt;ul&gt;
            &lt;li&gt;Always enable supplemental logging at database and table level.&lt;/li&gt;
            &lt;li&gt;Use dedicated GoldenGate tablespaces.&lt;/li&gt;
            &lt;li&gt;Implement Checkpoint Table.&lt;/li&gt;
            &lt;li&gt;Monitor lag using &lt;code&gt;LAG EXTRACT *&lt;/code&gt; and set alerts.&lt;/li&gt;
            &lt;li&gt;Use Parallel Extract/Replicat for high volume environments.&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;6. Backup &amp;amp; Recovery Best Practices&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Configure RMAN
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
    &lt;li&gt;Take consistent RMAN full + incremental backups.&lt;/li&gt;
    &lt;li&gt;Test your recovery regularly (validate backups).&lt;/li&gt;
    &lt;li&gt;Use FRA for archived logs and control file autobackups.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;7. Monitoring &amp;amp; Maintenance&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Configure Enterprise Manager 13c or use Oracle Autonomous Health Framework.&lt;/li&gt;
    &lt;li&gt;Set up alert notifications for ORA- errors, tablespace full, etc.&lt;/li&gt;
    &lt;li&gt;Schedule regular purging of audit trails and trace files.&lt;/li&gt;
    &lt;li&gt;Review alert log daily using ADRCI tool.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Implementing these Oracle 19c best practices will significantly improve your database reliability, performance, and security. Always test changes in a non-production environment first and refer to the latest Oracle documentation for your specific environment.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post is for educational purposes. Best practices may vary based on workload and business requirements.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tags&lt;/strong&gt;: Oracle 19c, Oracle Database Best Practices, Oracle Performance, Oracle Security, GoldenGate, Data Guard, Multitenant&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/2787391390079402541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/2787391390079402541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2787391390079402541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2787391390079402541'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/01/oracle-database-19c-best-practices.html' title='Oracle Database 19c Best Practices: Essential Tips for Performance, Security &amp; High Availability'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-1375504602109775821</id><published>2026-01-04T20:37:00.000-08:00</published><updated>2026-05-20T22:37:40.786-07:00</updated><title type='text'>GoldenGate 19c Error: Replicat Abended - ORA-00942 or Mapping Error</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Common Replicat error in GoldenGate 19c: &lt;strong&gt;ORA-00942: table or view does not exist&lt;/strong&gt; or mapping failures.&lt;/p&gt;

&lt;h3&gt;Cause&lt;/h3&gt;
&lt;p&gt;Target table does not exist, wrong schema mapping, or missing privileges.&lt;/p&gt;

&lt;h3&gt;Fix&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Login to GGSCI on Target
./ggsci

-- Check replicat status
INFO REPLICAT rep1, DETAIL

-- View error report
VIEW REPORT rep1&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Solution Steps:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;1. Create missing table on target (or use DDL replication)
2. Fix mapping in replicat parameter file:

EDIT PARAMS rep1

-- Add correct mapping
MAP schema_name.*, TARGET target_schema.*;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then restart Replicat:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;STOP REPLICAT rep1
START REPLICAT rep1&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Quick Tip:&lt;/strong&gt; Use &lt;code&gt;ASSUMETARGETDEFS&lt;/code&gt; if source and target structures are identical.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;GoldenGate 19c | Replicat Error | Fix&lt;/em&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/1375504602109775821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/1375504602109775821' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/1375504602109775821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/1375504602109775821'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/01/goldengate-19c-error-replicat-abended.html' title='GoldenGate 19c Error: Replicat Abended - ORA-00942 or Mapping Error'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-3625777346304176256</id><published>2026-01-04T00:30:00.000-08:00</published><updated>2026-05-20T22:36:45.252-07:00</updated><title type='text'>GoldenGate 19c Error: ORA-12899 or Supplemental Logging Issues</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; Replicat is abending with &lt;code&gt;ORA-12899: value too large for column&lt;/code&gt; or Extract is not capturing changes.&lt;/p&gt;

&lt;h3&gt;Cause&lt;/h3&gt;
&lt;p&gt;Supplemental logging is not enabled properly at schema or table level.&lt;/p&gt;

&lt;h3&gt;Fix Commands&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- On Source Database (as SYSDBA)
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER DATABASE FORCE LOGGING;

-- Enable schema level supplemental logging
ADD SCHEMATRANDATA schema_name ALLCOLS

-- OR for specific table
ADD TRANDATA schema_name.table_name ALLCOLS&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After enabling logging, restart the Extract process:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;STOP EXTRACT ext1
START EXTRACT ext1&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Check status:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;INFO EXTRACT ext1
SEND EXTRACT ext1, STATUS&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;GoldenGate 19c | Supplemental Logging | CDC&lt;/em&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/3625777346304176256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/3625777346304176256' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/3625777346304176256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/3625777346304176256'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/01/goldengate-19c-error-ora-12899-or.html' title='GoldenGate 19c Error: ORA-12899 or Supplemental Logging Issues'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-2661199257641611898</id><published>2026-01-03T20:35:00.000-08:00</published><updated>2026-05-20T22:35:55.624-07:00</updated><title type='text'>GoldenGate 19c Error: Extract Not Starting - &quot;No Valid Checkpoint Found&quot;</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;One of the most common issues when setting up Oracle GoldenGate 19c is the Extract process failing to start with the error &lt;strong&gt;&quot;No valid checkpoint found&quot;&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Cause&lt;/h3&gt;
&lt;p&gt;This usually happens when the Extract is added with &lt;code&gt;BEGIN NOW&lt;/code&gt; but the checkpoint was not properly registered or the process was deleted without cleanup.&lt;/p&gt;

&lt;h3&gt;Fix&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Stop and delete the existing extract
STOP EXTRACT ext1
DELETE EXTRACT ext1

-- Add extract again with proper checkpoint
ADD EXTRACT ext1, TRANLOG, BEGIN NOW, THREADS 2   -- Use THREADS if using RAC

ADD EXTTRAIL /u01/app/oracle/gg19c/dirdat/lt, EXTRACT ext1

-- Start the extract
START EXTRACT ext1

-- Verify
INFO EXTRACT ext1, DETAIL&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Always use &lt;code&gt;ADD EXTRACT ... ETROLLOVER&lt;/code&gt; if you want to start fresh with new trail files.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;GoldenGate 19c | Error Fix&lt;/em&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/2661199257641611898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/2661199257641611898' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2661199257641611898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/2661199257641611898'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/01/goldengate-19c-error-extract-not.html' title='GoldenGate 19c Error: Extract Not Starting - &quot;No Valid Checkpoint Found&quot;'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-3436752131028795521</id><published>2026-01-02T20:30:00.000-08:00</published><updated>2026-05-20T22:34:21.152-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CDC"/><category scheme="http://www.blogger.com/atom/ns#" term="Data Replication"/><category scheme="http://www.blogger.com/atom/ns#" term="GoldenGate 19c"/><category scheme="http://www.blogger.com/atom/ns#" term="Microservices Architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle 19c"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle GoldenGate"/><title type='text'>Oracle GoldenGate 19c: A Comprehensive Guide to Real-Time Data Replication</title><content type='html'>&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;

&lt;p&gt;Oracle GoldenGate 19c (19.1.0) is a powerful, high-performance software solution for real-time transactional change data capture (CDC), transformation, and delivery across heterogeneous databases and platforms. It enables zero-downtime migrations, high availability, data integration, and real-time analytics by replicating committed transactions with low latency while maintaining data integrity.&lt;/p&gt;

&lt;p&gt;Whether you&#39;re synchronizing data between on-premises Oracle databases, moving to the cloud, or feeding data lakes, GoldenGate 19c excels in bidirectional replication, active-active configurations, and support for diverse targets like MySQL, SQL Server, Big Data platforms, and more.&lt;/p&gt;

&lt;h3&gt;Key Features and Enhancements in GoldenGate 19c&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Microservices Architecture (MA)&lt;/strong&gt;: Modern REST API-driven design with web-based management, improved security, and easier scalability (Classic Architecture is still available in 19c but Microservices is recommended for new deployments).&lt;/li&gt;
    &lt;li&gt;Oracle Database 19c Support and broader heterogeneous capabilities (MySQL 8.0, cross-endian support, etc.).&lt;/li&gt;
    &lt;li&gt;Enhanced Security: Centralized key management, SSL, encryption, and target-initiated distribution paths.&lt;/li&gt;
    &lt;li&gt;Performance &amp;amp; Reliability: Parallel processing, schema change tracking, long-running transaction monitoring, and low-impact capture.&lt;/li&gt;
    &lt;li&gt;Use Cases: Real-time data warehousing, disaster recovery, data synchronization, ETL/ELT, and event-driven architectures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Source and target databases in &lt;strong&gt;ARCHIVELOG&lt;/strong&gt; mode.&lt;/li&gt;
    &lt;li&gt;Supplemental logging and forced logging enabled.&lt;/li&gt;
    &lt;li&gt;Adequate CPU, memory, and disk space.&lt;/li&gt;
    &lt;li&gt;Oracle GoldenGate software downloaded from Oracle Software Delivery Cloud.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Installation Steps (Silent Mode Example on Linux)&lt;/h3&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;strong&gt;Unzip the software&lt;/strong&gt;:&lt;br /&gt;
    &lt;pre&gt;&lt;code&gt;unzip fbo_ggs_Linux_x64_shiphome.zip -d /u01/app/oracle/gg19c&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Create a response file&lt;/strong&gt; (&lt;code&gt;oggcore.rsp&lt;/code&gt;):&lt;br /&gt;
    &lt;pre&gt;&lt;code&gt;INSTALL_OPTION=ORA19c
SOFTWARE_LOCATION=/u01/app/oracle/product/gg19c
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Run silent installation&lt;/strong&gt;:&lt;br /&gt;
    &lt;pre&gt;&lt;code&gt;cd /u01/app/oracle/gg19c/Disk1
./runInstaller -silent -responseFile /path/to/oggcore.rsp -waitforcompletion&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Initial Configuration (Source Database)&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;-- Enable archive log and supplemental logging
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION=TRUE SCOPE=BOTH;

-- Create GoldenGate user
CREATE USER c##ggadmin IDENTIFIED BY password CONTAINER=ALL;
GRANT DBA, CONNECT, RESOURCE TO c##ggadmin CONTAINER=ALL;
GRANT UNLIMITED TABLESPACE TO c##ggadmin;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Enable schema-level supplemental logging:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ADD SCHEMATRANDATA schema_name ALLCOLS&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;GGSCI Commands&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;cd $GG_HOME
./ggsci&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Common GGSCI Commands:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;INFO MANAGER
START MANAGER
STOP MANAGER

-- Create Extract
ADD EXTRACT ext1, TRANLOG, BEGIN NOW
ADD EXTTRAIL /u01/app/oracle/gg19c/dirdat/lt, EXTRACT ext1

-- Create Data Pump (optional)
ADD EXTRACT pump1, EXTTRAILSOURCE /u01/app/oracle/gg19c/dirdat/lt
ADD RMTTRAIL /u01/app/oracle/gg19c/dirdat/rt, EXTRACT pump1

-- Create Replicat
ADD REPLICAT rep1, EXTTRAIL /u01/app/oracle/gg19c/dirdat/rt&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Example Extract Parameter File (ext1.prm):&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;EXTRACT ext1
USERID c##ggadmin@source, PASSWORD password
EXTTRAIL /u01/app/oracle/gg19c/dirdat/lt
TABLE schema_name.*;&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Monitoring Commands&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;INFO ALL
STATUS EXTRACT ext1
STATS REPLICAT rep1
LAG EXTRACT *&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Best Practices&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Use dedicated tablespaces and users for GoldenGate.&lt;/li&gt;
    &lt;li&gt;Add checkpoint table: &lt;code&gt;ADD CHECKPOINTTABLE&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;Monitor lag and trail files regularly.&lt;/li&gt;
    &lt;li&gt;Enable parallelism for high volume.&lt;/li&gt;
    &lt;li&gt;Test failover and conflict resolution.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Troubleshooting Tips&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Check report files in &lt;code&gt;dirrpt/&lt;/code&gt; folder.&lt;/li&gt;
    &lt;li&gt;Use &lt;code&gt;SEND EXTRACT ext1, STATUS&lt;/code&gt; or &lt;code&gt;VIEW REPORT&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;Common issues: Missing supplemental logging, wrong credentials, network blocks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Oracle GoldenGate 19c remains one of the best solutions for real-time, low-latency data replication. Start with a simple unidirectional setup and then scale up according to your needs.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/3436752131028795521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/3436752131028795521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/3436752131028795521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/3436752131028795521'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2026/01/oracle-goldengate-19c-comprehensive.html' title='Oracle GoldenGate 19c: A Comprehensive Guide to Real-Time Data Replication'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-4549918380980526105</id><published>2025-09-04T14:25:00.000-07:00</published><updated>2025-09-04T14:25:05.947-07:00</updated><title type='text'>Run Microsoft VibeVoice TTS Locally on CPU</title><content type='html'>&lt;p&gt;&amp;nbsp;In this tutorial, I install the Microsoft VibeVoice model locally and test.&lt;/p&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;399&quot; src=&quot;https://www.youtube.com/embed/woZK76EJ47k&quot; width=&quot;479&quot; youtube-src-id=&quot;woZK76EJ47k&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;app.py:&lt;/p&gt;&lt;p&gt;&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;VibeVoice with Fahd Mirza&lt;/p&gt;&lt;p&gt;&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;import argparse&lt;/p&gt;&lt;p&gt;import os&lt;/p&gt;&lt;p&gt;import tempfile&lt;/p&gt;&lt;p&gt;import time&lt;/p&gt;&lt;p&gt;import threading&lt;/p&gt;&lt;p&gt;import subprocess&lt;/p&gt;&lt;p&gt;import numpy as np&lt;/p&gt;&lt;p&gt;import gradio as gr&lt;/p&gt;&lt;p&gt;import librosa&lt;/p&gt;&lt;p&gt;import soundfile as sf&lt;/p&gt;&lt;p&gt;import torch&lt;/p&gt;&lt;p&gt;from pathlib import Path&lt;/p&gt;&lt;p&gt;from typing import Iterator, Dict, Any&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Clone and setup VibeVoice if not already present&lt;/p&gt;&lt;p&gt;vibevoice_dir = Path(&#39;./VibeVoice&#39;)&lt;/p&gt;&lt;p&gt;if not vibevoice_dir.exists():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(&quot;Cloning VibeVoice repository...&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; subprocess.run([&#39;git&#39;, &#39;clone&#39;, &#39;https://github.com/vibevoice-community/VibeVoice&#39;], check=True)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(&quot;Installing VibeVoice...&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; subprocess.run([&#39;pip&#39;, &#39;install&#39;, &#39;-e&#39;, &#39;./VibeVoice&#39;], check=True)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(&quot;Installing wheel (required for flash-attn)...&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; subprocess.run([&#39;pip&#39;, &#39;install&#39;, &#39;wheel&#39;], check=True)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(&quot;Installing flash-attn...&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; try:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subprocess.run([&#39;pip&#39;, &#39;install&#39;, &#39;flash-attn&#39;, &#39;--no-build-isolation&#39;], check=True)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; except subprocess.CalledProcessError:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;Warning: flash-attn installation failed. Continuing without it...&quot;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Add the VibeVoice directory to path&lt;/p&gt;&lt;p&gt;import sys&lt;/p&gt;&lt;p&gt;sys.path.insert(0, str(vibevoice_dir))&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Import VibeVoice modules&lt;/p&gt;&lt;p&gt;try:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; from vibevoice.modular.configuration_vibevoice import VibeVoiceConfig&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; from vibevoice.modular.modeling_vibevoice_inference import VibeVoiceForConditionalGenerationInference&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; from vibevoice.processor.vibevoice_processor import VibeVoiceProcessor&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; from vibevoice.modular.streamer import AudioStreamer&lt;/p&gt;&lt;p&gt;except ImportError:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; try:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import importlib.util&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; def load_module(module_name, file_path):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; spec = importlib.util.spec_from_file_location(module_name, file_path)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; module = importlib.util.module_from_spec(spec)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys.modules[module_name] = module&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; spec.loader.exec_module(module)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return module&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; config_module = load_module(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;vibevoice_config&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vibevoice_dir / &quot;modular&quot; / &quot;configuration_vibevoice.py&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VibeVoiceConfig = config_module.VibeVoiceConfig&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; model_module = load_module(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;vibevoice_model&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vibevoice_dir / &quot;modular&quot; / &quot;modeling_vibevoice_inference.py&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VibeVoiceForConditionalGenerationInference = model_module.VibeVoiceForConditionalGenerationInference&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processor_module = load_module(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;vibevoice_processor&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vibevoice_dir / &quot;processor&quot; / &quot;vibevoice_processor.py&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VibeVoiceProcessor = processor_module.VibeVoiceProcessor&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; streamer_module = load_module(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;vibevoice_streamer&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vibevoice_dir / &quot;modular&quot; / &quot;streamer.py&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AudioStreamer = streamer_module.AudioStreamer&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; except Exception as e:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; raise ImportError(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; f&quot;VibeVoice module not found. Error: {e}\n&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Please ensure VibeVoice is properly installed:\n&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;git clone https://github.com/vibevoice-community/VibeVoice\n&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;cd VibeVoice/\n&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;pip install -e .\n&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;from transformers.utils import logging&lt;/p&gt;&lt;p&gt;from transformers import set_seed&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;logging.set_verbosity_info()&lt;/p&gt;&lt;p&gt;logger = logging.get_logger(__name__)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;class VibeVoiceChat:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def __init__(self, model_path: str, device: str = &quot;cuda&quot;, inference_steps: int = 5):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Initialize the VibeVoice chat model.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model_path = model_path&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.device = device if torch.cuda.is_available() else &quot;cpu&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.inference_steps = inference_steps&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.is_generating = False&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.stop_generation = False&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.current_streamer = None&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Check GPU availability and CUDA version&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if torch.cuda.is_available():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;✓ GPU detected: {torch.cuda.get_device_name(0)}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;&amp;nbsp; Memory: {torch.cuda.get_device_properties(0).total_memory / 1e9:.2f} GB&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;&amp;nbsp; CUDA Version: {torch.version.cuda}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;&amp;nbsp; PyTorch CUDA: {torch.cuda.is_available()}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Set memory fraction to avoid OOM&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; torch.cuda.set_per_process_memory_fraction(0.95)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Enable TF32 for faster computation on Ampere GPUs&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; torch.backends.cuda.matmul.allow_tf32 = True&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; torch.backends.cudnn.allow_tf32 = True&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;✗ No GPU detected, using CPU (generation will be VERY slow)&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;&amp;nbsp; For faster generation, ensure CUDA is properly installed&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.load_model()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.setup_voice_presets()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def load_model(self):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Load the VibeVoice model and processor.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Loading model from {self.model_path}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; start_time = time.time()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.processor = VibeVoiceProcessor.from_pretrained(self.model_path)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if torch.cuda.is_available():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;Loading model with GPU acceleration...&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model = VibeVoiceForConditionalGenerationInference.from_pretrained(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model_path,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; torch_dtype=torch.bfloat16,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; device_map=&#39;cuda:0&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; attn_implementation=&quot;flash_attention_2&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; low_cpu_mem_usage=True,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;✓ Flash Attention 2 enabled for faster generation&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; except Exception as e:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Warning: Could not load with flash_attention_2: {e}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;Falling back to standard attention...&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model = VibeVoiceForConditionalGenerationInference.from_pretrained(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model_path,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; torch_dtype=torch.bfloat16,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; device_map=&#39;cuda:0&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; low_cpu_mem_usage=True,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;Loading model on CPU (this will be slow)...&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model = VibeVoiceForConditionalGenerationInference.from_pretrained(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model_path,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; torch_dtype=torch.float32,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; device_map=&#39;cpu&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; low_cpu_mem_usage=True,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model.eval()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Configure noise scheduler for faster inference&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model.model.noise_scheduler = self.model.model.noise_scheduler.from_config(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model.model.noise_scheduler.config,&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; algorithm_type=&#39;sde-dpmsolver++&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; beta_schedule=&#39;squaredcos_cap_v2&#39;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.model.set_ddpm_inference_steps(num_steps=self.inference_steps)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; load_time = time.time() - start_time&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;✓ Model loaded in {load_time:.2f} seconds&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Print model device&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if hasattr(self.model, &#39;device&#39;):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Model device: {self.model.device}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def setup_voice_presets(self):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Setup voice presets from the voices directory.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voices_dir = os.path.join(os.path.dirname(__file__), &quot;voices&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Create voices directory if it doesn&#39;t exist&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not os.path.exists(voices_dir):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; os.makedirs(voices_dir)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Created voices directory at {voices_dir}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;Please add voice sample files (.wav, .mp3, etc.) to this directory&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.available_voices = {}&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_extensions = (&#39;.wav&#39;, &#39;.mp3&#39;, &#39;.flac&#39;, &#39;.ogg&#39;, &#39;.m4a&#39;, &#39;.aac&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Scan for audio files&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for file in os.listdir(voices_dir):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if file.lower().endswith(audio_extensions):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; name = os.path.splitext(file)[0]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.available_voices[name] = os.path.join(voices_dir, file)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Sort voices alphabetically&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.available_voices = dict(sorted(self.available_voices.items()))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not self.available_voices:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Warning: No voice files found in {voices_dir}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;Using default (zero) voice samples. Add audio files to the voices directory for better results.&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Add a default &quot;None&quot; option&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.available_voices = {&quot;Default&quot;: None}&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Found {len(self.available_voices)} voice presets: {&#39;, &#39;.join(self.available_voices.keys())}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def read_audio(self, audio_path: str, target_sr: int = 24000) -&amp;gt; np.ndarray:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Read and preprocess audio file.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wav, sr = sf.read(audio_path)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if len(wav.shape) &amp;gt; 1:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wav = np.mean(wav, axis=1)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if sr != target_sr:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wav = librosa.resample(wav, orig_sr=sr, target_sr=target_sr)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return wav&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; except Exception as e:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Error reading audio {audio_path}: {e}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return np.zeros(24000)&amp;nbsp; # Return 1 second of silence as fallback&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def format_script(self, message: str, num_speakers: int = 2) -&amp;gt; str:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Format input message into a script with speaker assignments.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lines = message.strip().split(&#39;\n&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; formatted_lines = []&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for i, line in enumerate(lines):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; line = line.strip()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not line:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Check if already formatted&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if line.startswith(&#39;Speaker &#39;) and &#39;:&#39; in line:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; formatted_lines.append(line)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Auto-assign speakers in rotation&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speaker_id = i % num_speakers&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; formatted_lines.append(f&quot;Speaker {speaker_id}: {line}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &#39;\n&#39;.join(formatted_lines)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def generate_audio_stream(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self,&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; message: str,&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; history: list,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voice_1: str,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voice_2: str,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; num_speakers: int,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cfg_scale: float&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; ) -&amp;gt; Iterator[tuple]:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Generate audio stream from text input.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.stop_generation = False&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.is_generating = True&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Validate inputs&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not message.strip():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yield None&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Format the script&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; formatted_script = self.format_script(message, num_speakers)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Formatted script:\n{formatted_script}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Using device: {self.device}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Start timing&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; start_time = time.time()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Select voices based on number of speakers&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; selected_voices = []&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if voice_1 and voice_1 != &quot;Default&quot;:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; selected_voices.append(voice_1)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if num_speakers &amp;gt; 1 and voice_2 and voice_2 != &quot;Default&quot;:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; selected_voices.append(voice_2)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Load voice samples&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voice_samples = []&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for i in range(num_speakers):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Use the appropriate voice for each speaker&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if i &amp;lt; len(selected_voices):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voice_name = selected_voices[i]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if voice_name in self.available_voices and self.available_voices[voice_name]:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_data = self.read_audio(self.available_voices[voice_name])&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_data = np.zeros(24000)&amp;nbsp; # Default silence&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Use first voice or default if not enough voices selected&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if selected_voices and selected_voices[0] in self.available_voices and self.available_voices[selected_voices[0]]:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_data = self.read_audio(self.available_voices[selected_voices[0]])&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_data = np.zeros(24000)&amp;nbsp; # Default silence&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voice_samples.append(audio_data)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Loaded {len(voice_samples)} voice samples&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Process inputs&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inputs = self.processor(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text=[formatted_script],&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voice_samples=[voice_samples],&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; padding=True,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return_tensors=&quot;pt&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return_attention_mask=True,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Move to device and ensure correct dtype&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if self.device == &quot;cuda&quot;:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inputs = {k: v.to(self.device) if torch.is_tensor(v) else v for k, v in inputs.items()}&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;✓ Inputs moved to GPU&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Check GPU memory&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if torch.cuda.is_available():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;GPU memory allocated: {torch.cuda.memory_allocated() / 1e9:.2f} GB&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Create audio streamer&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_streamer = AudioStreamer(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; batch_size=1,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stop_signal=None,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; timeout=None&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.current_streamer = audio_streamer&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Start generation in separate thread&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; generation_thread = threading.Thread(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; target=self._generate_with_streamer,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; args=(inputs, cfg_scale, audio_streamer)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; generation_thread.start()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Wait briefly for generation to start&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; time.sleep(1)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Stream audio chunks&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sample_rate = 24000&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_stream = audio_streamer.get_stream(0)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; all_audio_chunks = []&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; chunk_count = 0&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for audio_chunk in audio_stream:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if self.stop_generation:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_streamer.end()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; chunk_count += 1&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Convert to numpy&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if torch.is_tensor(audio_chunk):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if audio_chunk.dtype == torch.bfloat16:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_chunk = audio_chunk.float()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_np = audio_chunk.cpu().numpy().astype(np.float32)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_np = np.array(audio_chunk, dtype=np.float32)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Ensure 1D&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if len(audio_np.shape) &amp;gt; 1:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_np = audio_np.squeeze()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Convert to 16-bit&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_16bit = self.convert_to_16_bit_wav(audio_np)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; all_audio_chunks.append(audio_16bit)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Yield accumulated audio&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if all_audio_chunks:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; complete_audio = np.concatenate(all_audio_chunks)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yield (sample_rate, complete_audio)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Wait for generation to complete&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; generation_thread.join(timeout=5.0)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Final yield with complete audio&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if all_audio_chunks:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; complete_audio = np.concatenate(all_audio_chunks)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; generation_time = time.time() - start_time&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_duration = len(complete_audio) / sample_rate&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;✓ Generation complete:&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;&amp;nbsp; Time taken: {generation_time:.2f} seconds&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;&amp;nbsp; Audio duration: {audio_duration:.2f} seconds&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;&amp;nbsp; Real-time factor: {audio_duration/generation_time:.2f}x&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yield (sample_rate, complete_audio)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.current_streamer = None&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.is_generating = False&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; except Exception as e:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Error in generation: {e}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import traceback&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; traceback.print_exc()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.is_generating = False&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.current_streamer = None&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yield None&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def _generate_with_streamer(self, inputs, cfg_scale, audio_streamer):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Helper method to run generation with streamer.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; def check_stop():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return self.stop_generation&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Use torch.cuda.amp for mixed precision if available&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if self.device == &quot;cuda&quot; and torch.cuda.is_available():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; with torch.cuda.amp.autocast(dtype=torch.bfloat16):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outputs = self.model.generate(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; **inputs,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; max_new_tokens=None,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cfg_scale=cfg_scale,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tokenizer=self.processor.tokenizer,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; generation_config={&#39;do_sample&#39;: False},&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_streamer=audio_streamer,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stop_check_fn=check_stop,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; verbose=False,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refresh_negative=True,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outputs = self.model.generate(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; **inputs,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; max_new_tokens=None,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cfg_scale=cfg_scale,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tokenizer=self.processor.tokenizer,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; generation_config={&#39;do_sample&#39;: False},&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_streamer=audio_streamer,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stop_check_fn=check_stop,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; verbose=False,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refresh_negative=True,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; except Exception as e:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Error in generation thread: {e}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import traceback&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; traceback.print_exc()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_streamer.end()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def convert_to_16_bit_wav(self, data):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Convert audio data to 16-bit WAV format.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if torch.is_tensor(data):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data = data.detach().cpu().numpy()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data = np.array(data)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if np.max(np.abs(data)) &amp;gt; 1.0:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data = data / np.max(np.abs(data))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data = (data * 32767).astype(np.int16)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return data&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def stop_audio_generation(self):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Stop the current audio generation.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.stop_generation = True&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if self.current_streamer:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.current_streamer.end()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; except:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pass&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;def create_chat_interface(chat_instance: VibeVoiceChat):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Create a simplified Gradio ChatInterface for VibeVoice.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Get available voices&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; voice_options = list(chat_instance.available_voices.keys())&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if not voice_options:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voice_options = [&quot;Default&quot;]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; default_voice_1 = voice_options[0] if len(voice_options) &amp;gt; 0 else &quot;Default&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; default_voice_2 = voice_options[1] if len(voice_options) &amp;gt; 1 else voice_options[0]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Define the chat function that returns audio&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def chat_fn(message: str, history: list, voice_1: str, voice_2: str, num_speakers: int, cfg_scale: float):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Process chat message and generate audio response.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Extract text from message&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if isinstance(message, dict):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text = message.get(&quot;text&quot;, &quot;&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text = message&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not text.strip():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Generate audio stream&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_generator = chat_instance.generate_audio_stream(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text, history, voice_1, voice_2, num_speakers, cfg_scale&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Collect all audio data&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_data = None&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for audio_chunk in audio_generator:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if audio_chunk is not None:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_data = audio_chunk&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Return audio file path or error message&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if audio_data:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Save audio to temporary file&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; with tempfile.NamedTemporaryFile(suffix=&quot;.wav&quot;, delete=False) as tmp_file:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sample_rate, audio_array = audio_data&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sf.write(tmp_file.name, audio_array, sample_rate)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Return the file path directly&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return tmp_file.name&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;Failed to generate audio&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; except Exception as e:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&quot;Error in chat_fn: {e}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import traceback&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; traceback.print_exc()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return f&quot;Error: {str(e)}&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Create the interface using Blocks for more control&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; with gr.Blocks(theme=gr.themes.Soft(primary_hue=&quot;blue&quot;, secondary_hue=&quot;purple&quot;), fill_height=True) as interface:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gr.Markdown(&quot;# 🎙️ VibeVoice Chat\nGenerate natural dialogue audio with AI voices&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; with gr.Row():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; with gr.Column(scale=1):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gr.Markdown(&quot;### Voice &amp;amp; Generation Settings&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voice_1 = gr.Dropdown(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; choices=voice_options,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value=default_voice_1,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=&quot;Voice 1&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; info=&quot;Select voice for Speaker 0&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; voice_2 = gr.Dropdown(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; choices=voice_options,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value=default_voice_2,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=&quot;Voice 2&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; info=&quot;Select voice for Speaker 1 (if using multiple speakers)&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; num_speakers = gr.Slider(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; minimum=1,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; maximum=2,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value=2,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; step=1,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=&quot;Number of Speakers&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; info=&quot;Number of speakers in the dialogue&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cfg_scale = gr.Slider(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; minimum=1.0,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; maximum=2.0,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value=1.3,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; step=0.05,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=&quot;CFG Scale&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; info=&quot;Guidance strength (higher = more adherence to text)&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; with gr.Column(scale=2):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; chatbot = gr.Chatbot(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=&quot;Conversation&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; height=400,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type=&quot;messages&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elem_id=&quot;chatbot&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg = gr.Textbox(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=&quot;Message&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; placeholder=&quot;Type your message or paste a script...&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lines=3&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_output = gr.Audio(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=&quot;Generated Audio&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type=&quot;filepath&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; autoplay=True,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; visible=False&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; with gr.Row():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; submit = gr.Button(&quot;🎵 Generate Audio&quot;, variant=&quot;primary&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clear = gr.Button(&quot;🗑️ Clear&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Example messages&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gr.Examples(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; examples=[&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Hello! How are you doing today?&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Speaker 0: Welcome to our podcast!\nSpeaker 1: Thanks for having me!&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Tell me an interesting fact about space.&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;What&#39;s your favorite type of music and why?&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ],&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inputs=msg,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=&quot;Example Messages&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Set up event handlers&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; def process_and_display(message, history, voice_1, voice_2, num_speakers, cfg_scale):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Process message and update both chatbot and audio.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Add user message to history&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; history = history or []&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; history.append({&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: message})&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Generate audio&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; audio_path = chat_fn(message, history, voice_1, voice_2, num_speakers, cfg_scale)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Add assistant response with audio&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if audio_path and audio_path.endswith(&#39;.wav&#39;):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; history.append({&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: f&quot;🎵 Audio generated successfully&quot;})&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return history, audio_path, gr.update(visible=True), &quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; history.append({&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: audio_path or &quot;Failed to generate audio&quot;})&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return history, None, gr.update(visible=False), &quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; submit.click(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fn=process_and_display,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inputs=[msg, chatbot, voice_1, voice_2, num_speakers, cfg_scale],&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outputs=[chatbot, audio_output, audio_output, msg],&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; queue=True&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.submit(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fn=process_and_display,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inputs=[msg, chatbot, voice_1, voice_2, num_speakers, cfg_scale],&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outputs=[chatbot, audio_output, audio_output, msg],&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; queue=True&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clear.click(lambda: ([], None, gr.update(visible=False)), outputs=[chatbot, audio_output, audio_output])&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; return interface&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;def parse_args():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; parser = argparse.ArgumentParser(description=&quot;VibeVoice Chat Interface&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; parser.add_argument(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;--model_path&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type=str,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default=&quot;microsoft/VibeVoice-1.5B&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; help=&quot;Path to the VibeVoice model&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; parser.add_argument(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;--device&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type=str,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default=&quot;cuda&quot; if torch.cuda.is_available() else &quot;cpu&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; help=&quot;Device for inference&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; parser.add_argument(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;--inference_steps&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type=int,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default=5,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; help=&quot;Number of DDPM inference steps (lower = faster, higher = better quality)&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; return parser.parse_args()&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;def main():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;&quot;&quot;Main function to run the chat interface.&quot;&quot;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; args = parse_args()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; set_seed(42)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(&quot;🎙️ Initializing VibeVoice Chat Interface...&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Initialize chat instance&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; chat_instance = VibeVoiceChat(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; model_path=args.model_path,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; device=args.device,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inference_steps=args.inference_steps&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Create interface&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; interface = create_chat_interface(chat_instance)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(f&quot;🚀 Launching chat interface&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(f&quot;📁 Model: {args.model_path}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(f&quot;💻 Device: {chat_instance.device}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(f&quot;🔢 Inference steps: {args.inference_steps}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(f&quot;🎭 Available voices: {len(chat_instance.available_voices)}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if chat_instance.device == &quot;cpu&quot;:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;\n⚠️&amp;nbsp; WARNING: Running on CPU - generation will be VERY slow!&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;&amp;nbsp; &amp;nbsp;For faster generation, ensure you have:&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;&amp;nbsp; &amp;nbsp;1. NVIDIA GPU with CUDA support&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;&amp;nbsp; &amp;nbsp;2. PyTorch with CUDA installed: pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Launch the interface&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; interface.queue(max_size=10).launch(&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; show_error=True,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; quiet=False,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; )&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;if __name__ == &quot;__main__&quot;:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; main()&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/4549918380980526105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/4549918380980526105' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/4549918380980526105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/4549918380980526105'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2025/09/run-microsoft-vibevoice-tts-locally-on.html' title='Run Microsoft VibeVoice TTS Locally on CPU'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/woZK76EJ47k/default.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3496259157130184660.post-5970894305714822194</id><published>2025-07-28T14:10:00.000-07:00</published><updated>2025-07-30T16:50:51.448-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="wan2.2. wan2.2 comfyui workflow"/><title type='text'>Install Wan2.2 Locally with Free ComfyUI Workflow: Text-to-Video and Image-to-Video</title><content type='html'>&lt;p&gt;&lt;span face=&quot;Roboto, Noto, sans-serif&quot; style=&quot;background-color: #282828; color: white; font-size: 15px; white-space-collapse: preserve;&quot;&gt;This video locally installs Wan2.2, which is the premier video foundation model.&lt;/span&gt;&lt;/p&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;376&quot; src=&quot;https://www.youtube.com/embed/JukIN2g-w-M&quot; width=&quot;452&quot; youtube-src-id=&quot;JukIN2g-w-M&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Models :&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/tree/main/split_files&quot;&gt;Comfy-Org/Wan_2.2_ComfyUI_Repackaged at main&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Workflow:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;https://github.com/fahdmirza/comfyuiworkflows&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.fahdmirza.com/feeds/5970894305714822194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3496259157130184660/5970894305714822194' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/5970894305714822194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3496259157130184660/posts/default/5970894305714822194'/><link rel='alternate' type='text/html' href='http://www.fahdmirza.com/2025/07/install-wan22-locally-with-free-comfyui.html' title='Install Wan2.2 Locally with Free ComfyUI Workflow: Text-to-Video and Image-to-Video'/><author><name>Fahd Mirza</name><uri>http://www.blogger.com/profile/14722451950835849728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhUV5TmW-L2vC0y9_tOUEON-rPEVJS5jXJTClrk7hZtjtq0z7wrmP-lrSaqv-5Hs4zOJsHmSigxLJvY5mfMKPcFqsvv-pYz0beUZn2L8g_0Ygs4Bx1Inj7AJ_DvhSf08/s220/fahdgooglephoto.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/JukIN2g-w-M/default.jpg" height="72" width="72"/><thr:total>1</thr:total></entry></feed>