likhonsheikh/OpenDocker
0
1---2title: Docker-Providers3emoji: 🐳4colorFrom: blue5colorTo: green6sdk: docker7app_port: 80008---9 10# Docker-Providers11 12This project provides an OpenAI-compatible API interface for running the SmolLM2 model using Docker Model Runner. It allows you to use SmolLM2 as a drop-in replacement for OpenAI's API, making it easy to integrate with existing applications.13 14## Features15 16- OpenAI-compatible API endpoints17- Support for both chat completions and text completions18- Docker Model Runner integration with SmolLM219- Easy deployment with Docker20 21## Prerequisites22 23- Docker24- Docker Model Runner25- Python 3.11+26 27## Getting Started28 291. Pull the SmolLM2 model:30```bash31docker model pull ai/smollm232```33 342. Build and run the API:35```bash36# Build the Docker image37docker build -t smollm2-api .38 39# Run the container40docker run -d -p 8000:8000 --name smollm2-api smollm2-api41```42 43## API Endpoints44 45### Chat Completions46```bash47curl http://localhost:8000/v1/chat/completions \48 -H "Content-Type: application/json" \49 -d '{50 "model": "ai/smollm2",51 "messages": [52 {"role": "user", "content": "Hello, how are you?"}53 ]54 }'55```56 57### Text Completions58```bash59curl http://localhost:8000/v1/completions \60 -H "Content-Type: application/json" \61 -d '{62 "model": "ai/smollm2",63 "prompt": "Once upon a time"64 }'65```66 67### List Models68```bash69curl http://localhost:8000/v1/models70```71 72## Model Information73 74SmolLM2-360M is a compact language model with 360 million parameters, designed for:75- Chat assistants76- Text-extraction77- Rewriting and summarization78 79Available variants:80- ai/smollm2:360M-Q4_K_M (default)81- ai/smollm2:135M-Q4_082- ai/smollm2:135M-Q4_K_M83- ai/smollm2:135M-F1684- ai/smollm2:135M-Q2_K85- ai/smollm2:360M-Q4_086- ai/smollm2:360M-F1687 88## License89 90This project is licensed under the Apache 2.0 License.