Sign inSign up

javanhut/gpt-neo-api

By javanhut

•Updated about 1 year ago

Docker API image of GPT_Neo:125M parameter with a API call to generate text from an API call.

Image
Machine learning & AI
0

495

javanhut/gpt-neo-api repository overview

⁠GPT-Neo 125M API Docker Image

A containerized FastAPI server for text generation using EleutherAI's GPT-Neo 125M model.

⁠Features

• Pre-cached Model: GPT-Neo 125M model is downloaded during build for faster startup • REST API: Simple HTTP endpoints for text generation • Health Checks: Built-in health monitoring • GPU Support: Automatic GPU detection and utilization • Production Ready: Non-root user, proper logging, and health checks

⁠Quick Start

⁠Run the container

docker run -d -p 8000:8000 javanhut/gpt-neo-api

⁠Test the API

curl http://localhost:8000/health⁠

⁠API Endpoints

⁠Generate Text

curl -X POST "http://localhost:8000/generate⁠"
-H "Content-Type: application/json"
-d '{ "prompt": "The future of AI is", "max_length": 50, "temperature": 0.8 }'

⁠Health Check

curl http://localhost:8000/health⁠

⁠Interactive Documentation

Visit http://localhost:8000/docs⁠ for Swagger UI

⁠Parameters

• prompt: Input text (required) • max_length: Max generated tokens (1-200, default: 50) • temperature: Sampling randomness (0.1-2.0, default: 0.8) • top_k: Top-k sampling (1-100, default: 50) • top_p: Nucleus sampling (0.1-1.0, default: 0.9) • num_return_sequences: Number of outputs (1-5, default: 1)

⁠Docker Compose

version: '3.8' services: gpt-neo-api: image: javanhut/gpt-neo-api ports: - "8000:8000" restart: unless-stopped

Size: ~2.5GB (includes model weights) Architecture: linux/amd64 Python: 3.13-slim base

Tag summary

Content type

Image

Digest

sha256:1ca47d1bf…

Size

8.2 GB

Last updated

about 1 year ago

docker pull javanhut/gpt-neo-api