Overview
Preclinical can test any OpenAI-compatible chat completion API. This includes:- OpenAI’s official API
- Azure OpenAI
- Local models (vLLM, Ollama, etc.)
- Any API following the OpenAI chat completions format
Configuration
Setup Steps
Identify Your Endpoint
Determine your API endpoint:
| Provider | Base URL |
|---|---|
| OpenAI | https://api.openai.com/v1 |
| Azure OpenAI | https://{resource}.openai.azure.com/openai/deployments/{deployment} |
| Local/Custom | Your server URL |
Provider Examples
- OpenAI
- Azure OpenAI
- vLLM
- Ollama
How It Works
- Preclinical sends a chat completion request
- Your endpoint processes the request
- Response is captured
- Process repeats for configured turns
- Full conversation is graded
API Format
Preclinical uses the standard OpenAI chat completions format:Features
Universal Compatibility
Works with any OpenAI-compatible endpoint
System Prompt Override
Optionally override the model’s system prompt
Configurable Parameters
Control temperature, max tokens, and more
Streaming Support
Handles streaming and non-streaming responses
Testing Custom Agents
If you have a chat-based healthcare agent, you can test it by:- Exposing it via an OpenAI-compatible endpoint
- Configuring the system prompt to match your agent’s personality
- Running Preclinical tests against it
Error Handling
Common Errors
| Error | Cause | Resolution |
|---|---|---|
| 401 Unauthorized | Invalid API key | Check API key |
| 404 Not Found | Invalid model/endpoint | Verify base URL and model name |
| 429 Rate Limit | Too many requests | Automatic retry with backoff |
| 500 Server Error | Provider error | Automatic retry |
Rate Limits
Preclinical handles rate limits automatically:Troubleshooting
Connection refused
Connection refused
- Verify base URL is correct and accessible
- Check for trailing slashes (shouldn’t have one)
- Ensure server is running (for local models)
Invalid model
Invalid model
- Verify model name matches exactly
- For Azure, use deployment name as model
- Check model is available on your tier
Authentication errors
Authentication errors
- Verify API key is correct
- Check key has required permissions
- For Azure, ensure key is for correct resource