[WIP] eval: adding full prompt eval harness#16
Draft
ishandhanani wants to merge 12 commits intomainfrom
Draft
Conversation
Collaborator
Author
|
Pausing this right now because we're reworking our prompts and flow. But will come back to this when we finalize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Prompt Evaluation Pipeline for Agent Service
Overview
This PR introduces a comprehensive prompt evaluation pipeline for the Agent Service, enabling systematic testing and validation of our LLM prompts. The system is designed to ensure prompt reliability and consistency across different models and use cases. We use
promptfooas our eval harness. Notepromptfoodoes not allow for a single config file where prompts can be tied to specific use caes which is why we devise this structure.Key Components
1. Structured Testing Framework
2. Provider Architecture
Created three distinct NIM providers to handle different model capabilities:
nim-8b.py: Optimized for JSON schema validation and structured outputsnim-405b.py: Handles complex reasoning and content generationnim-70b.py: Specialized for dialogue generation and natural language tasksThis was required for promptfoo as nims do not fully implement the OpenAI API spec.
3. Configuration Management
Implemented a YAML-based configuration system for test stages. Each stage has its own configuration file. There is also a helper function in order to retrieve and process previous prompts to emulate the concept of prompt-chaining.
4. Test Runner Infrastructure
Created a flexible test runner that supports:
5. Schema Generation
Automated schema generation from our Pydantic models:
Development Workflow
Added a comprehensive Makefile to streamline the development process:
make test-prompts: Run full evaluation pipelinemake test-upto stage=N: Test specific stagesmake test-list: View available test stagesmake clean: Reset test environmentDesign Decisions
Stage Isolation: Each transformation step is isolated in its own configuration file, making it easier to:
Provider Specialization: Different models are used for different tasks based on their strengths:
Schema-First Approach: By generating schemas from our Pydantic models, we ensure:
Automated Testing: The pipeline is designed to be fully automated, enabling:
Testing
To test the changes:
make setup-testmake test-promptsmake test-upto stage=2Future Improvements