---
title: "Create Docker Image From Huggingface"
method: POST
path: "/v1/admin/create-docker-image-from-huggingface"
tags: ["Admin Management"]
---

# Create Docker Image From Huggingface

`POST /v1/admin/create-docker-image-from-huggingface`

## Request

- Base URL: `https://api.oneinfer.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.oneinfer.ai/v1/admin/create-docker-image-from-huggingface`
- Auth: HTTP bearer

Get runtime configuration for deploying a HuggingFace model with vLLM.

This endpoint:
1. Analyzes the HuggingFace model to extract specs
2. Determines optimal GPU configurations (single GPU vs multi-GPU)
3. Returns the pre-built vLLM base image with environment variables
4. NO Docker build required - uses runtime configuration!

Args:
    request: CreateDockerImageRequest with HuggingFace URL

Returns:
    Model specifications, GPU recommendations, and runtime configuration

## Request body

- CreateDockerImageRequest
  - `huggingface_model_url` string, required: HuggingFace model URL (e.g., https://huggingface.co/openai/gpt-oss-20b)
  - `dockerhub_username` string, required: Docker Hub username
  - `dockerhub_password` string, required: Docker Hub password/token
  - `image_name` string, nullable: Custom image name (auto-generated if not provided)
  - `tag` string: Docker image tag
  - `build_only` boolean: Only build, don't push to Docker Hub
  - `hf_token` string, nullable: HuggingFace token for gated models (e.g., Llama, Mistral). Required for models that need license acceptance.

## Response `200`

Successful Response

- CreateDockerImageResponse
  - `job_id` string, required: Unique job ID for tracking build progress
  - `status` string, required: Status: queued/building/pushing/success/failed/docker_not_available
  - `image_name` string, required: Full Docker image name
  - `model_specs` ModelSpecs, required
    - `model_id` string, required: HuggingFace model ID
    - `model_name` string, required: Model display name
    - `parameters` string, required: Number of parameters (e.g., '20B', '7B')
    - `architecture` string, required: Model architecture type
    - `context_length` integer, required: Maximum context length in tokens
    - `estimated_vram_gb` integer, required: Estimated VRAM requirement in GB
    - `model_size_gb` number, required: Model size on disk in GB
    - `quantization_support` string[], required: Supported quantization formats
  - `gpu_recommendations` GPURecommendation[], required: GPU recommendations
    - `gpu_name` string, required: GPU model name
    - `vram_gb` integer, required: VRAM in GB
    - `quantity` integer, required: Number of GPUs needed
    - `reason` string, required: Recommendation reason
    - `cost_tier` string, required: Cost tier: budget/mid/premium
  - `build_log` string, nullable: Build log output (partial for in-progress jobs)
  - `docker_pull_command` string, nullable: Command to pull the image
  - `estimated_build_time_minutes` integer, required: Estimated build time in minutes
  - `progress_percentage` integer, nullable: Build progress percentage (0-100)
  - `current_step` string, nullable: Current build step description

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/oneinfer/apis/oneinfer-apis.md) · [All operations](https://skmtc.dev/oneinfer/apis/oneinfer-apis/llms.txt) · [OpenAPI document](https://skmtc.dev/oneinfer/apis/oneinfer-apis/revisions/a49f22311a8f?raw)
