FeedForward's AI configuration system allows you to integrate multiple Large Language Model (LLM) providers to generate diverse, high-quality feedback for students. This guide covers setting up AI providers, managing API keys, configuring models, and optimizing for cost and performance.
FeedForward uses a hierarchical system for AI configuration:
Provider (OpenAI)
└── Model (GPT-4)
└── Instance (GPT-4 for Essays - High Temperature)
└── Instance (GPT-4 for Code - Low Temperature)
Provider Details:
Name: OpenAI
Type: openai
Display Name: OpenAI GPT Models
API Configuration:
API Key: sk-...your-key-here
Organization ID: org-... (optional)
API Base URL: https://api.openai.com/v1 (default)
Advanced Settings:
Request Timeout: 60 seconds
Max Retries: 3
Rate Limit: 60 requests/minute
For Azure OpenAI, use a custom API Base URL and add the API Version.
Provider Details:
Name: Anthropic
Type: anthropic
Display Name: Claude Models
API Configuration:
API Key: sk-ant-api...your-key-here
API Base URL: https://api.anthropic.com (default)
Advanced Settings:
Request Timeout: 120 seconds
Max Retries: 3
Rate Limit: 50 requests/minute
Provider Details:
Name: Google AI
Type: google
Display Name: Google Gemini
API Configuration:
API Key: AI...your-key-here
# OR for Vertex AI:
Service Account JSON: (upload file)
Project ID: your-gcp-project
Location: us-central1
Provider Details:
Name: Ollama Local
Type: ollama
Display Name: Local LLM Models
API Configuration:
Base URL: http://localhost:11434
No API Key Required
Note: Requires Ollama running locally
After adding a provider:
API Key Storage - Keys are encrypted using Fernet encryption - Stored in database with AES-256 - Never logged or displayed in full - Accessible only to admin role
Key Rotation - Set reminders for regular rotation - Keep previous key during transition - Update all model instances - Test before removing old key
Access Control - System-wide keys (admin only) - Instructor keys (optional feature) - Audit trail for key usage - IP restrictions where supported
Never share API keys via email or messaging. Always enter them directly into the system.
Example Dashboard:
- OpenAI GPT-4: 1,234 requests ($12.34)
- Anthropic Claude: 567 requests ($5.67)
- Total this month: $18.01
Basic Information:
Provider: OpenAI (select from dropdown)
Model ID: gpt-4-turbo-preview
Display Name: GPT-4 Turbo
Description: Latest GPT-4 with 128k context
Capabilities:
Max Tokens: 4096
Context Window: 128000
Supports Functions: Yes
Supports Vision: Yes
Cost Information:
Input Cost: $0.01 per 1k tokens
Output Cost: $0.03 per 1k tokens
Availability:
Status: Active
Available to: All Instructors
Configure default parameters for each model:
Generation Parameters:
Temperature: 0.7 (0.0-2.0)
Top P: 1.0 (0.0-1.0)
Frequency Penalty: 0.0 (-2.0-2.0)
Presence Penalty: 0.0 (-2.0-2.0)
Response Settings:
Max Output Tokens: 2000
Stop Sequences: ["\n\n", "END"]
Response Format: text
Safety Settings:
Content Filter: Enabled
Personal Info Filter: Enabled
Profanity Filter: Enabled
Model instances allow different configurations of the same model:
Instance Name: GPT-4 Essay Feedback
Base Model: GPT-4 Turbo
Description: Optimized for essay feedback
Parameter Overrides:
Temperature: 0.8 (more creative)
Max Tokens: 3000 (longer responses)
System Prompt: |
You are an experienced writing instructor providing
constructive feedback on student essays. Focus on
improvement rather than just criticism.
Usage Restrictions:
Available for: Essay assignments
Department: English, Humanities
Set system defaults for different contexts:
Default Models:
Primary Feedback: GPT-4 Turbo
Quick Feedback: GPT-3.5 Turbo
Code Review: Claude-3 Opus
Fallback Chain:
1. Primary Model
2. Secondary Model
3. Tertiary Model
Error Handling:
On Model Failure: Use fallback
On Provider Failure: Queue for retry
Max Retries: 3
When using multiple models or runs:
Aggregation Methods:
Available Methods:
- Average (mean of all scores)
- Weighted Average (based on model confidence)
- Maximum (highest score)
- Median (middle score)
- Consensus (most common)
Default Method: Weighted Average
Confidence Weights:
GPT-4: 1.0
Claude-3: 0.95
GPT-3.5: 0.8
Local Models: 0.7
Protect against excessive usage:
Global Limits:
Total API Calls/Day: 10000
Per Provider/Hour: 1000
Per Instructor/Day: 500
Per Student/Day: 20
Burst Limits:
Requests/Minute: 60
Concurrent Requests: 10
Queue Size: 1000
Cost Controls:
Daily Spend Limit: $100
Alert Threshold: 80%
Auto-Pause at Limit: Yes
Alert Thresholds:
Daily: $50, $75, $100
Monthly: $500, $1000, $1500
Alert Recipients:
- admin@university.edu
- billing@university.edu
Actions on Limit:
Soft Limit (80%): Email alert
Hard Limit (100%): Pause non-essential
Emergency: Pause all AI calls
Model Selection - Use expensive models sparingly - Quick feedback with cheaper models - Premium models for final drafts
Prompt Optimization - Shorter, focused prompts - Reuse successful prompts - Cache common responses
Usage Patterns - Batch processing during off-peak - Limit retries and regenerations - Set per-course budgets
Generate usage reports:
Add non-standard providers:
Provider Configuration:
Name: Custom LLM
Base URL: https://api.custom-llm.com
Auth Type: Bearer Token
Request Format:
Endpoint: /v1/completions
Method: POST
Headers:
Authorization: Bearer {api_key}
Content-Type: application/json
Response Parsing:
Success Path: $.choices[0].text
Error Path: $.error.message
Create reusable prompt templates:
Template Name: Essay Feedback Standard
Variables:
- rubric_criteria
- word_count
- assignment_type
Template: |
Analyze this {assignment_type} based on the rubric.
Rubric criteria:
{rubric_criteria}
Expected length: {word_count} words
Provide specific, actionable feedback for improvement.
Test different models or configurations:
Experiment: Model Comparison
Duration: 2 weeks
Sample Size: 100 submissions
Variants:
A: GPT-4 (50%)
B: Claude-3 (50%)
Metrics:
- Student satisfaction
- Instructor approval rate
- Cost per feedback
API Key Invalid - Verify key is active - Check for typos - Ensure correct provider - Verify billing active
Model Not Available - Check provider status - Verify model ID - Ensure region access - Check quota limits
High Latency - Review timeout settings - Check network connectivity - Consider closer regions - Optimize prompt length
Inconsistent Results - Adjust temperature - Improve prompt clarity - Check model version - Consider different model
Access AI-specific logs:
Match Model to Task - Essays: High creativity models - Code: Precise, technical models - Math: Logical reasoning models
Consider Context Length - Long assignments need large context - Chunk if necessary - Monitor token usage
Balance Quality/Cost - Premium for final feedback - Standard for drafts - Quick for real-time
Clear Instructions - Specific evaluation criteria - Desired output format - Tone and style
Include Context - Assignment details - Rubric criteria - Student level
Iterative Improvement - Monitor feedback quality - Gather instructor input - Refine prompts
AI models and pricing change frequently. Check provider documentation for the latest information.