Enabling AI Services¶
To enable AI services in your deployment, provide the AI provider configuration
details in the ai_provider.yaml file. This configuration must include the code
name of the AI provider and any provider-specific options. Refer to the
Links and Resources section below for detailed
configuration options for each supported provider.
Currently, the deployment supports the following AI providers and their respective code names:
- AWS Bedrock (
aws) - Azure OpenAI (
azure) - Ollama (
ollama)
Tip
By default, the deployment looks for the ai_provider.yaml file in the
root of the inventory directory. You can override this location by
setting the ai_provider_file variable in the
inventory file. A sample ai_provider.yaml
file is provided in the root of the installation package.
ai_provider:
name: aws
model: anthropic.claude-haiku-4-5-20251001-v1:0
temperature: 0.7
max_tokens: 100000
Authentication and Permissions
For information on configuring cloud authentication and IAM/RBAC permissions required for AI services, see the AI Services Permissions sections in the Cloud Integrations guide.
Log Analysis with AI¶
VOR Stream supports AI-powered log analysis for each run. This feature uses your configured AI provider to summarize and interpret logs, helping you quickly identify issues and understand what happened during the run.
After a run completes, you can view the log analysis by clicking the "Explain Logs" button in the log viewer for that run.
Configuring Log Analysis Limits¶
- By default, the system analyzes up to 500 log entries per run.
- You can change this limit by setting the
run_log_analysis_max_logsvariable in your Ansible inventory file or Django config. - Increasing the limit provides deeper analysis but may impact performance and cost (depending on your AI provider).
Example (hosts.ini file)¶
[django:vars]
run_log_analysis_max_logs=1000
Customizing AI Prompts¶
AI prompts can be customized during deployment using Ansible templates. This allows you to tailor the AI's behavior for your specific environment without modifying the application code.
How It Works¶
- Default prompts are defined in
{vor_stream_package}/django/template/ai_prompts/as Jinja2 templates (.j2files). - During deployment, if an AI provider is configured, Ansible deploys these templates to the Django application.
- After deployment, prompts are located in
{vor_root}/django/src/ai/prompts/.
Prerequisites
AI prompts are only deployed when an AI provider is configured in ai_provider.yaml.
If no AI provider is set up, the prompt deployment task is skipped.
Prompt Template Format¶
Each prompt consists of two separate text files:
{prompt_name}_system.txt: System instructions for the AI assistant{prompt_name}_user.txt: User message template with variable placeholders
Variables in the user template are specified using curly braces: {variable_name}
Example:
my_prompt_system.txt:
You are an expert AI assistant.
Provide clear and concise answers.
my_prompt_user.txt:
Please analyze the following data for user {user_id}:
{data}
Customizing Prompts for Your Deployment¶
To customize AI prompts for your deployment:
-
Navigate to your installation package directory:
cd <installation_package_directory>/django/template/ai_prompts/ -
Edit the desired template file(s):
# For example, customize the log summarization system prompt vi summarize_logs_system.txt.j2 -
Make your changes. For example:
You are an expert analyst for financial risk applications. Focus specifically on: - Data quality issues - Calculation errors - Regulatory compliance warnings Provide recommendations that align with risk management best practices. Keep responses concise and actionable for business users. -
Deploy the changes:
cd ../../../ # Back to ansible directory ansible-playbook django/playbook.yaml -i hosts.ini -
The Django service will automatically restart with the new prompts
Advanced Customization with Jinja2
Since these are Jinja2 templates, you can use any Ansible variables or Jinja2 features for advanced customization:
Using Ansible variables:
You are an AI assistant for {{ inventory_hostname }}.
Data center: {{ datacenter | default('dc1') }}
Conditional logic:
{% if custom_ai_tone is defined and custom_ai_tone == 'formal' %}
Provide formal, business-oriented recommendations.
{% else %}
Provide clear, practical recommendations.
{% endif %}
Custom variables:
Define custom variables in your inventory file (e.g., hosts.ini) and reference them:
[django:vars]
ai_focus_area=financial risk management
Then use in your prompt:
You are an expert in {{ ai_focus_area | default('data analysis') }}.