text generationGated
gemma-2-9b-it
by google
A powerful AI model available via API.
779,241 downloads1,146 likes
Get API KeyAPI Usage
Endpoint
POST https://api.gpu.fm/v1/inferenceRequest
curl -X POST https://api.gpu.fm/v1/inference \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemma-2-9b-it",
"inputs": "Explain the theory of relativity in simple terms",
"parameters": {
"max_new_tokens": 256
}
}'Response
{
"result": "Albert Einstein's theory of relativity...",
"usage": {
"inputTokens": 12,
"outputTokens": 128
},
"pricing": {
"total": "0.000018"
}
}Python SDK
import requests
response = requests.post(
"https://api.gpu.fm/v1/inference",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "google/gemma-2-9b-it",
"inputs": "Explain the theory of relativity in simple terms",
"parameters": {"max_new_tokens": 256}
}
)
result = response.json()
print(result["result"])Pricing
Input$0.13/1M tokens
Output$0.39/1M tokens
Billed from your prepaid credits. No minimum commitment.
Details
- Model ID
- google/gemma-2-9b-it
- Library
- transformers
- Pipeline
- text generation
- Updated
- 8/27/2024
Tags
transformerssafetensorsgemma2text-generationconversationalarxiv:2009.03300arxiv:1905.07830arxiv:1911.11641arxiv:1904.09728arxiv:1905.10044