Private by design
The model, database and files stay in your AWS account and region. The model endpoint has no public URL, and prompts are never logged.
Deploy open-source LLMs (Qwen, Llama, Gemma, DeepSeek…) on Amazon SageMaker with vLLM, with a private ChatGPT-style app in front: accounts with Google sign-in and 2FA, documents, images, OCR, and GPUs that switch themselves off.
Or try it on your laptop in 5 minutes, no GPU needed: make up


A complete, secure app and the infrastructure to run it, from a laptop demo to a production deployment, with every step explained.
The model, database and files stay in your AWS account and region. The model endpoint has no public URL, and prompts are never logged.
Pick a preset (Qwen, Llama, Gemma, DeepSeek) or any Hugging Face model vLLM supports. Ollama and OpenAI-compatible servers work too.
Answers stream token by token, with Markdown, code highlighting, tables and math. History, search, pin, regenerate and stop.
Attach PDFs, Word files, text and code: their text goes into the prompt, trimmed to fit. Vision models see images as images.
Extract text from photos, screenshots and scanned PDFs with a vision LLM, with Tesseract as a CPU fallback. Copy, download, or chat about it.
Email and password with verification, Sign in with Google, two-factor auth with an authenticator app or email codes, recovery codes.
Endpoints start when someone sends a message and are deleted after 30 idle minutes. A forgotten GPU can't run up a bill.
The whole AWS stack in Terraform: CloudFront, load balancer, ECS Fargate, RDS, S3, SES, SageMaker, and CI/CD with GitHub OIDC.


From the moment you press Send to the first token on your screen.
You press Send. The message and any attached files go to the API over HTTPS, with your session cookie.
POST /api/conversations/{id}/messages/Checks the model's GPU is awake (or wakes it), then builds the prompt: history, your files and instructions, trimmed to the context window.
ensure_ready() → build_prompt()The request is IAM-signed and streamed to your private endpoint, where vLLM generates the answer on the GPU.
InvokeEndpointWithResponseStreamEach token is relayed to the browser as a Server-Sent Event, so the answer appears as it is written. Stop works at any time.
text/event-streamEverything runs in your account, created by Terraform. Locally, Docker Compose runs the same web and api images with PostgreSQL, Mailpit, SearXNG for web search, and an open-source model on your own GPU.
Each preset runs on AWS's own vLLM container, so there is nothing to build: python ml/sagemaker/deploy.py deploy qwen3-vl-8b. Or any model vLLM supports.
| Model | Instance | GPU | $/hour | Notes |
|---|---|---|---|---|
| Qwen3-VL 8B (FP8)Qwen/Qwen3-VL-8B-Instruct-FP8 | ml.g6e.xlarge | 1x NVIDIA L40S, 48 GB | $2.61 | Vision / OCR |
| Qwen3-VL 4BQwen/Qwen3-VL-4B-Instruct | ml.g6.xlarge | 1x NVIDIA L4, 24 GB | $1.13 | Vision / OCR |
| Qwen3 8B (FP8)Qwen/Qwen3-8B-FP8 | ml.g6.xlarge | 1x NVIDIA L4, 24 GB | $1.13 | Text |
| Llama 3.1 8B Instructmeta-llama/Llama-3.1-8B-Instruct | ml.g5.xlarge | 1x NVIDIA A10G, 24 GB | $1.41 | Gated |
| DeepSeek-R1 Distill (Qwen 7B)deepseek-ai/DeepSeek-R1-Distill-Qwen-7B | ml.g5.xlarge | 1x NVIDIA A10G, 24 GB | $1.41 | Text |
| Gemma 3 12Bgoogle/gemma-3-12b-it | ml.g6e.xlarge | 1x NVIDIA L40S, 48 GB | $2.61 | Vision / OCRGated |
| Qwen3 32B (FP8)Qwen/Qwen3-32B-FP8 | ml.g6e.2xlarge | 1x NVIDIA L40S, 48 GB | $2.80 | Text |
| Llama 3.3 70B Instructmeta-llama/Llama-3.3-70B-Instruct | ml.g6e.12xlarge | 4x NVIDIA L40S, 192 GB | $13.12 | Gated |
…or any model vLLM supports. Prices are us-east-1 on-demand SageMaker rates; see the cost guide and how to size a GPU.
Each level builds on the previous one. Stop wherever you have what you need.
A small always-on baseline for the app, plus GPU hours: $1.13–$2.61 per hour for the single-GPU presets.
on_demand it can't happen by accident.on_demand scaling you only pay for hours actually used. See the cost guide.base_url. Handy for comparing quality, though then your data leaves your account.You only need Docker. Pick an open-source model and it runs on your laptop: no GPU and no AWS account needed to try it.
$ git clone https://github.com/codewithmuh/private-llm-chat-sagemaker-aws.git$ cd private-llm-chat-sagemaker-aws$ make up