{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "TkJQ1gZs4XUq"
   },
   "outputs": [],
   "source": [
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "VVc8IyVs4ZCI"
   },
   "outputs": [],
   "source": [
    "url = \"http://127.0.0.1:8000/v1/chat/completions\"\n",
    "headers = {\"Content-Type\": \"application/json\"}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "E3D1Noqi4ZFB"
   },
   "outputs": [],
   "source": [
    "payload = {\n",
    "    \"model\": \"qwen3-4b\",\n",
    "    \"messages\": [\n",
    "        {\n",
    "            \"role\": \"user\",\n",
    "            \"content\": \"Write a haiku in Afrikaans about thriftiness.\",\n",
    "        },\n",
    "    ],\n",
    "    \"temperature\": 0.7,\n",
    "    \"chat_template_kwargs\": {\n",
    "        \"enable_thinking\": False,\n",
    "    },\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "hDcfxkhV4ZIB",
    "outputId": "0ba759d1-c5c7-44b4-c5dd-8c80640c8e20"
   },
   "outputs": [],
   "source": [
    "response = requests.post(url, headers=headers, json=payload)\n",
    "result = response.json()\n",
    "\n",
    "poem = result[\"choices\"][0][\"message\"][\"content\"]\n",
    "print(poem)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "wIz3406P4ZK4"
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "accelerator": "GPU",
  "colab": {
   "gpuType": "T4",
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "name": "python3"
  },
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
