Models API¶
Model management. List available models, download for offline use, and manage model versions.
Endpoints¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/models | List all models |
| GET | /v1/models/{id} | Get model details |
| POST | /v1/models/{id}/download | Request download URL |
| GET | /v1/models/updates | Check for updates |
GET /models¶
List available translation models.
Request¶
Query Parameters¶
| Parameter | Type | Description |
|---|---|---|
type | string | Filter by type: translation, detection, ocr, speech |
language | string | Filter by language code |
domain | string | Filter by EuroVoc domain |
offline | boolean | Only offline-capable models |
Response¶
{
"data": {
"models": [
{
"id": "model_en_fi_v3",
"name": "English to Finnish v3",
"type": "translation",
"version": "3.2.0",
"source_language": "en",
"target_language": "fi",
"domain": null,
"size_mb": 850,
"offline_capable": true,
"quality_score": 0.94,
"created_at": "2025-01-01T00:00:00Z"
},
{
"id": "model_legal_en_fi",
"name": "Legal English to Finnish",
"type": "translation",
"version": "2.1.0",
"source_language": "en",
"target_language": "fi",
"domain": "12 Law",
"size_mb": 1200,
"offline_capable": true,
"quality_score": 0.97,
"created_at": "2025-01-01T00:00:00Z"
}
],
"total": 528,
"pagination": {
"limit": 50,
"offset": 0,
"has_more": true
}
}
}
GET /models/{id}¶
Get detailed model information.
Request¶
Response¶
{
"data": {
"id": "model_legal_en_fi",
"name": "Legal English to Finnish",
"description": "Specialized model for legal document translation. Trained on EU legislation, Finnish law, and legal contracts.",
"type": "translation",
"version": "2.1.0",
"source_language": "en",
"target_language": "fi",
"domain": "12 Law",
"subdomains": ["1211 Civil law", "1216 Criminal law", "1221 Justice"],
"size_mb": 1200,
"offline_capable": true,
"quality_metrics": {
"bleu": 0.87,
"comet": 0.94,
"human_eval": 0.96
},
"training": {
"corpus_size": "50M sentences",
"last_updated": "2025-01-01T00:00:00Z"
},
"requirements": {
"min_ram_gb": 8,
"recommended_ram_gb": 16,
"gpu_supported": true,
"onnx_version": "1.16.0"
},
"license": "commercial",
"changelog": [
{
"version": "2.1.0",
"date": "2025-01-01",
"changes": ["Improved GDPR terminology", "Added EU AI Act terms"]
},
{
"version": "2.0.0",
"date": "2024-06-01",
"changes": ["Major architecture update", "20% quality improvement"]
}
]
}
}
POST /models/{id}/download¶
Request a download URL for offline models.
Request¶
curl -X POST https://api.pauhu.ai/v1/models/model_legal_en_fi/download \
-H "Authorization: Bearer pk_..." \
-H "Content-Type: application/json" \
-d '{
"format": "onnx",
"quantization": "fp16"
}'
Parameters¶
| Parameter | Type | Description |
|---|---|---|
format | string | onnx (default), torchscript |
quantization | string | fp32, fp16, int8 |
Response¶
{
"data": {
"model_id": "model_legal_en_fi",
"version": "2.1.0",
"format": "onnx",
"quantization": "fp16",
"size_mb": 600,
"download_url": "https://models.pauhu.ai/...",
"checksum_sha256": "abc123...",
"expires_at": "2025-01-15T11:30:00Z"
}
}
Download with CLI¶
# Using Pauhu CLI
pauhu models download model_legal_en_fi --path /opt/pauhu/models
# Or with curl
curl -o model_legal_en_fi.onnx "https://models.pauhu.ai/..."
GET /models/updates¶
Check for model updates.
Request¶
curl "https://api.pauhu.ai/v1/models/updates?installed=model_en_fi_v3:3.1.0,model_legal_en_fi:2.0.0" \
-H "Authorization: Bearer pk_..."
Response¶
{
"data": {
"updates_available": [
{
"model_id": "model_en_fi_v3",
"current_version": "3.1.0",
"latest_version": "3.2.0",
"size_delta_mb": 50,
"changes": ["Improved fluency", "Better number handling"]
},
{
"model_id": "model_legal_en_fi",
"current_version": "2.0.0",
"latest_version": "2.1.0",
"size_delta_mb": 100,
"changes": ["Added EU AI Act terms"]
}
],
"checked_at": "2025-01-15T10:30:00Z"
}
}
Python SDK¶
from pauhu import Pauhu
client = Pauhu()
# List models
models = client.models.list(
type="translation",
domain="12 Law"
)
for model in models:
print(f"{model.name}: {model.quality_score}")
# Get model details
model = client.models.get("model_legal_en_fi")
print(f"Size: {model.size_mb} MB")
print(f"BLEU: {model.quality_metrics.bleu}")
# Download model
download = client.models.download(
model_id="model_legal_en_fi",
path="/opt/pauhu/models",
format="onnx",
quantization="fp16"
)
# Check for updates
updates = client.models.check_updates(
installed={
"model_en_fi_v3": "3.1.0",
"model_legal_en_fi": "2.0.0"
}
)
for update in updates:
print(f"{update.model_id}: {update.current_version} -> {update.latest_version}")
CLI Usage¶
# List models
pauhu models list --domain "12 Law"
# Download model
pauhu models download model_legal_en_fi --path /opt/pauhu/models
# Check for updates
pauhu models check-updates --path /opt/pauhu/models
# Update all models
pauhu models update --path /opt/pauhu/models
Model Categories¶
| Category | Count | Total Size | Description |
|---|---|---|---|
| Translation | 462 | 380 GB | Language pair models |
| Domain Specialists | 21 | 168 GB | EuroVoc domain models |
| Quality | 12 | 45 GB | QA and grammar check |
| Detection | 1 | 2 GB | Language detection |
| OCR | 8 | 65 GB | Text extraction |
| Speech | 24 | 35 GB | STT and TTS |