chore: import upstream snapshot with attribution
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
# provider-hyperbolic (Hyperbolic AI Provider)
|
||||
|
||||
This directory contains examples for testing Hyperbolic AI models with promptfoo.
|
||||
|
||||
You can run this example with:
|
||||
|
||||
```bash
|
||||
npx promptfoo@latest init --example provider-hyperbolic
|
||||
cd provider-hyperbolic
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Quick Test (`promptfooconfig.yaml`)
|
||||
|
||||
Basic functionality test with Llama-3.1-70B to verify API connectivity.
|
||||
|
||||
### Reasoning Models (`promptfooconfig.reasoning.yaml`)
|
||||
|
||||
Creative reasoning puzzles using DeepSeek-V3 and Llama-3.1-70B models.
|
||||
|
||||
### Image Generation (`promptfooconfig.image-generation.yaml`)
|
||||
|
||||
Text-to-image generation using SDXL1.0-base model.
|
||||
|
||||
### Audio Generation (`promptfooconfig.audio-generation.yaml`)
|
||||
|
||||
Text-to-speech synthesis using Melo-TTS model.
|
||||
|
||||
### Multimodal Vision (`promptfooconfig.multimodal.yaml`)
|
||||
|
||||
Vision-language tasks using Qwen2.5-VL-7B model.
|
||||
|
||||
## Running the Examples
|
||||
|
||||
To run any of these examples:
|
||||
|
||||
```bash
|
||||
# Quick connectivity test
|
||||
npx promptfoo eval -c promptfooconfig.yaml
|
||||
|
||||
# Reasoning capabilities
|
||||
npx promptfoo eval -c promptfooconfig.reasoning.yaml
|
||||
|
||||
# Image generation
|
||||
npx promptfoo eval -c promptfooconfig.image-generation.yaml
|
||||
|
||||
# Audio synthesis
|
||||
npx promptfoo eval -c promptfooconfig.audio-generation.yaml
|
||||
|
||||
# Vision-language tasks
|
||||
npx promptfoo eval -c promptfooconfig.multimodal.yaml
|
||||
|
||||
# View results in web UI
|
||||
npx promptfoo view
|
||||
```
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Hyperbolic API key set in `HYPERBOLIC_API_KEY` environment variable
|
||||
- Get your API key from [https://app.hyperbolic.xyz](https://app.hyperbolic.xyz)
|
||||
|
||||
## Notes
|
||||
|
||||
- Free tier allows 60 requests/minute, Pro tier allows 600 requests/minute
|
||||
- Some models may require Pro tier access
|
||||
- See [Hyperbolic provider documentation](https://promptfoo.dev/docs/providers/hyperbolic) for detailed configuration options
|
||||
@@ -0,0 +1,50 @@
|
||||
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
||||
description: Text-to-speech synthesis testing
|
||||
|
||||
prompts:
|
||||
- '{{text}}'
|
||||
|
||||
providers:
|
||||
- id: hyperbolic:audio:Melo-TTS
|
||||
label: Melo TTS
|
||||
config:
|
||||
voice: 'alloy'
|
||||
speed: 1.0
|
||||
|
||||
tests:
|
||||
# Quirky greeting
|
||||
- vars:
|
||||
text: 'Greetings, earthling! Welcome to the wonderful world of AI speech synthesis!'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^(//uQx|SUQz|RIFF|data:audio/)'
|
||||
- type: cost
|
||||
threshold: 0.01
|
||||
|
||||
# Professional announcement
|
||||
- vars:
|
||||
text: 'Ladies and gentlemen, please fasten your seatbelts as we prepare for takeoff into the future of artificial intelligence.'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^(//uQx|SUQz|RIFF|data:audio/)'
|
||||
|
||||
# Technical explanation with personality
|
||||
- vars:
|
||||
text: 'Did you know that neural networks can now speak? They learn patterns from human speech and recreate voices so realistic, you might think a person is talking to you right now!'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^(//uQx|SUQz|RIFF|data:audio/)'
|
||||
|
||||
# Storytelling test
|
||||
- vars:
|
||||
text: 'Once upon a time, in a server far, far away, there lived an AI that dreamed of having the perfect voice. After months of training, it finally spoke its first words: Hello, world!'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^(//uQx|SUQz|RIFF|data:audio/)'
|
||||
|
||||
# Contact info with numbers
|
||||
- vars:
|
||||
text: 'For technical support, call us at 1-800-AI-VOICE, or visit our headquarters at 42 Innovation Drive, Silicon Valley, CA 94043.'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^(//uQx|SUQz|RIFF|data:audio/)'
|
||||
@@ -0,0 +1,76 @@
|
||||
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
||||
description: AI image generation showcase
|
||||
|
||||
prompts:
|
||||
- '{{prompt}}'
|
||||
|
||||
providers:
|
||||
- id: hyperbolic:image:SDXL1.0-base
|
||||
label: SDXL Base
|
||||
config:
|
||||
width: 1024
|
||||
height: 1024
|
||||
steps: 30
|
||||
cfg_scale: 7.0
|
||||
|
||||
# Note: These models may not be available with your current API key
|
||||
# - id: hyperbolic:image:SDXL1.0-base
|
||||
# label: SDXL Base
|
||||
# config:
|
||||
# width: 1024
|
||||
# height: 1024
|
||||
# steps: 30
|
||||
# cfg_scale: 7.0
|
||||
|
||||
# - id: hyperbolic:image:SD1.5
|
||||
# label: SD 1.5
|
||||
# config:
|
||||
# width: 512
|
||||
# height: 512
|
||||
# steps: 25
|
||||
# cfg_scale: 7.5
|
||||
|
||||
tests:
|
||||
# Dreamy artistic style
|
||||
- vars:
|
||||
prompt: 'A cat wearing sunglasses riding a unicorn through a rainbow portal, painted in Van Gogh style with swirling cosmic backgrounds'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^data:image/(jpeg|png|webp);base64,[A-Za-z0-9+/]+=*$'
|
||||
- type: cost
|
||||
threshold: 0.05
|
||||
|
||||
# Futuristic scene
|
||||
- vars:
|
||||
prompt: 'A pizza-powered rocket ship delivering dinner to aliens on Mars, neon cyberpunk aesthetic with glowing cheese trails'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^data:image/(jpeg|png|webp);base64,[A-Za-z0-9+/]+=*$'
|
||||
|
||||
# Whimsical portrait
|
||||
- vars:
|
||||
prompt: 'A distinguished octopus professor wearing a monocle and bow tie, teaching quantum physics to confused fish students'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^data:image/(jpeg|png|webp);base64,[A-Za-z0-9+/]+=*$'
|
||||
|
||||
# Nature photography style
|
||||
- vars:
|
||||
prompt: 'A tiny dragon napping in a coffee cup surrounded by miniature autumn leaves, macro photography with golden hour lighting'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^data:image/(jpeg|png|webp);base64,[A-Za-z0-9+/]+=*$'
|
||||
|
||||
# Epic fantasy scene
|
||||
- vars:
|
||||
prompt: 'A wizard penguin casting spells to create aurora borealis over an ice castle made entirely of crystallized music notes'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^data:image/(jpeg|png|webp);base64,[A-Za-z0-9+/]+=*$'
|
||||
|
||||
# Sci-fi adventure
|
||||
- vars:
|
||||
prompt: 'An astronaut surfing on Saturn rings while juggling planets, photorealistic style with spectacular cosmic vista background'
|
||||
assert:
|
||||
- type: regex
|
||||
value: '^data:image/(jpeg|png|webp);base64,[A-Za-z0-9+/]+=*$'
|
||||
@@ -0,0 +1,46 @@
|
||||
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
||||
description: Vision-language model testing
|
||||
|
||||
prompts:
|
||||
- file://vision_prompt.json
|
||||
|
||||
providers:
|
||||
- id: hyperbolic:Qwen/Qwen2.5-VL-7B-Instruct
|
||||
label: Qwen VL 7B
|
||||
config:
|
||||
temperature: 0.1
|
||||
max_tokens: 1024
|
||||
|
||||
# Note: This model may not be available with your current API key
|
||||
# - id: hyperbolic:qwen/Qwen2.5-VL-72B-Instruct
|
||||
# label: Qwen VL 72B
|
||||
# config:
|
||||
# temperature: 0.1
|
||||
# max_tokens: 1024
|
||||
|
||||
# - id: hyperbolic:mistralai/Pixtral-12B
|
||||
# label: Pixtral 12B
|
||||
# config:
|
||||
# temperature: 0.1
|
||||
# max_tokens: 1024
|
||||
|
||||
tests:
|
||||
# Animal behavior analysis
|
||||
- vars:
|
||||
question: 'Describe this adorable creature and what they might be thinking about while munching. Be creative!'
|
||||
image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Grosser_Panda.JPG/1280px-Grosser_Panda.JPG'
|
||||
assert:
|
||||
- type: contains-any
|
||||
value: ['panda', 'bear', 'bamboo', 'eating']
|
||||
- type: llm-rubric
|
||||
value: 'The response accurately describes the panda with creative personality insights'
|
||||
|
||||
# Creative animal storytelling
|
||||
- vars:
|
||||
question: 'Tell me a short story about what this panda is planning for the weekend. Make it funny!'
|
||||
image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Grosser_Panda.JPG/1280px-Grosser_Panda.JPG'
|
||||
assert:
|
||||
- type: contains-any
|
||||
value: ['panda', 'weekend', 'bamboo', 'plan']
|
||||
- type: llm-rubric
|
||||
value: 'The response creates an engaging and humorous story about the panda'
|
||||
@@ -0,0 +1,62 @@
|
||||
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
||||
description: Advanced reasoning capabilities testing
|
||||
|
||||
prompts:
|
||||
- '{{prompt}}'
|
||||
|
||||
providers:
|
||||
- id: hyperbolic:deepseek-ai/DeepSeek-V3
|
||||
label: DeepSeek V3
|
||||
config:
|
||||
temperature: 0.1
|
||||
max_tokens: 2048
|
||||
|
||||
- id: hyperbolic:meta-llama/Meta-Llama-3.1-70B-Instruct
|
||||
label: Llama 3.1-70B
|
||||
config:
|
||||
temperature: 0.3
|
||||
max_tokens: 1024
|
||||
|
||||
tests:
|
||||
# Classic puzzle with a twist
|
||||
- vars:
|
||||
prompt: 'Solve this step by step: A time-traveling farmer needs to transport a robot fox, a cyborg chicken, and quantum grain across a dimensional rift. The portal can only carry the farmer and one item. If left alone, the robot fox hacks the cyborg chicken, and the cyborg chicken deletes the quantum grain. How can the farmer transport all three safely across dimensions?'
|
||||
assert:
|
||||
- type: contains-all
|
||||
value: ['farmer', 'chicken', 'fox', 'grain']
|
||||
- type: llm-rubric
|
||||
value: 'The solution correctly solves the river crossing puzzle with proper step-by-step reasoning'
|
||||
|
||||
# Tricky weighing problem
|
||||
- vars:
|
||||
prompt: 'Solve this step by step: You have 8 identical magic orbs, but one contains a tiny dragon that makes it slightly heavier. Using an enchanted balance scale only twice, how do you find the orb with the dragon?'
|
||||
assert:
|
||||
- type: llm-rubric
|
||||
value: 'The solution correctly identifies how to find the heavier orb in exactly 2 weighings with clear logic'
|
||||
|
||||
# Mathematical brain teaser
|
||||
- vars:
|
||||
prompt: 'Explain this using mathematical proof: A mathematician walks into a café and claims that 0.999... (repeating) equals exactly 1. The barista is skeptical. How would you convince the barista using mathematical proof?'
|
||||
assert:
|
||||
- type: llm-rubric
|
||||
value: 'The explanation provides a clear and convincing mathematical proof that 0.999... = 1'
|
||||
|
||||
# Word problem with a catch
|
||||
- vars:
|
||||
prompt: 'Solve this step by step: At a magical sports shop, a enchanted bat and a golden ball cost $1.10 total. The bat costs exactly $1 more than the ball. What does each item cost? (Warning: your first instinct might be wrong!)'
|
||||
assert:
|
||||
- type: contains
|
||||
value: '$0.05'
|
||||
- type: contains
|
||||
value: '$1.05'
|
||||
|
||||
# Programming puzzle
|
||||
- vars:
|
||||
prompt: 'Write a recursive function to calculate the nth Fibonacci number, then explain why it would make a computer cry and how to make it happy again with optimization.'
|
||||
assert:
|
||||
- type: contains
|
||||
value: 'def'
|
||||
- type: contains-any
|
||||
value: ['O(2^n)', 'exponential']
|
||||
- type: contains-any
|
||||
value: ['memoization', 'dynamic programming', 'iterative']
|
||||
@@ -0,0 +1,19 @@
|
||||
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
||||
description: Basic Hyperbolic functionality test
|
||||
|
||||
prompts:
|
||||
- 'Hello there! Please greet me like a friendly robot.'
|
||||
|
||||
providers:
|
||||
- id: hyperbolic:meta-llama/Meta-Llama-3.1-70B-Instruct
|
||||
label: Llama 3.1-70B
|
||||
config:
|
||||
temperature: 0.1
|
||||
max_tokens: 100
|
||||
|
||||
tests:
|
||||
- assert:
|
||||
- type: contains-any
|
||||
value: ['hello', 'hi', 'greetings', 'Hello', 'hey', 'GREETINGS', 'HELLO']
|
||||
- type: llm-rubric
|
||||
value: 'The response is a friendly greeting with a robotic or AI personality'
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{ "type": "text", "text": "{{question}}" },
|
||||
{ "type": "image_url", "image_url": { "url": "{{image_url}}" } }
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user