{"id":26711270,"url":"https://github.com/joanrod/star-vector","last_synced_at":"2025-03-27T10:01:57.385Z","repository":{"id":220537953,"uuid":"730033775","full_name":"joanrod/star-vector","owner":"joanrod","description":"StarVector is a foundation model for SVG generation that transforms vectorization into a code generation task. Using a vision-language modeling architecture, StarVector processes both visual and textual inputs to produce high-quality SVG code with remarkable precision.","archived":false,"fork":false,"pushed_at":"2025-03-20T15:44:00.000Z","size":3,"stargazers_count":119,"open_issues_count":4,"forks_count":1,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-03-20T16:40:30.806Z","etag":null,"topics":["llm","multimodal-large-language-models","svg","vlm"],"latest_commit_sha":null,"homepage":"https://starvector.github.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joanrod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-11T03:53:55.000Z","updated_at":"2025-03-20T16:09:38.000Z","dependencies_parsed_at":"2024-02-02T17:04:28.825Z","dependency_job_id":null,"html_url":"https://github.com/joanrod/star-vector","commit_stats":null,"previous_names":["joanrod/star-vector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanrod%2Fstar-vector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanrod%2Fstar-vector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanrod%2Fstar-vector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanrod%2Fstar-vector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joanrod","download_url":"https://codeload.github.com/joanrod/star-vector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245823299,"owners_count":20678172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llm","multimodal-large-language-models","svg","vlm"],"created_at":"2025-03-27T10:01:54.300Z","updated_at":"2025-03-27T10:01:57.372Z","avatar_url":"https://github.com/joanrod.png","language":"Python","funding_links":[],"categories":["HarmonyOS","Python","多模态大模型","Repos","🤖 AI \u0026 Machine Learning"],"sub_categories":["Windows Manager","资源传输下载"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e💫 StarVector: Generating Scalable Vector Graphics Code from Images and Text\u003c/h1\u003e\n  \u003cimg src=\"assets/starvector-xyz.png\" alt=\"starvector\" style=\"width: 800px; display: block; margin-left: auto; margin-right: auto;\"/\u003e\n\n\u003ca href=\"https://arxiv.org/abs/2312.11556\" target=\"_blank\"\u003e\n    \u003cimg alt=\"arXiv\" src=\"https://img.shields.io/badge/arXiv-StarVector-red?logo=arxiv\" height=\"25\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://starvector.github.io/\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Website\" src=\"https://img.shields.io/badge/🌎_Website-starvector.github.io-blue.svg\" height=\"25\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://huggingface.co/starvector/starvector-1b-im2svg\" target=\"_blank\"\u003e\n    \u003cimg alt=\"HF Models: StarVector\" src=\"https://img.shields.io/badge/%F0%9F%A4%97%20_Model-StarVector--1B-ffc107?color=ffc107\u0026logoColor=white\" height=\"25\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://huggingface.co/starvector/starvector-8b-im2svg\" target=\"_blank\"\u003e\n    \u003cimg alt=\"HF Models: StarVector\" src=\"https://img.shields.io/badge/%F0%9F%A4%97%20_Model-StarVector--8B-ffc107?color=ffc107\u0026logoColor=white\" height=\"25\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://huggingface.co/datasets/starvector/svg-stack\" target=\"_blank\"\u003e\n    \u003cimg alt=\"HF Dataset: SVG-Stack\" src=\"https://img.shields.io/badge/%F0%9F%A4%97%20_Data-SVG--Stack-ffc107?color=ffc107\u0026logoColor=white\" height=\"25\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://huggingface.co/collections/starvector/starvector-svg-datasets-svg-bench-67811204a76475be4dd66d09\" target=\"_blank\"\u003e\n    \u003cimg alt=\"HF Dataset: SVG-Bench\" src=\"https://img.shields.io/badge/%F0%9F%A4%97%20_Benchmark-SVG--Bench-ffc107?color=ffc107\u0026logoColor=white\" height=\"25\" /\u003e\n\u003c/a\u003e\n\n\u003cdiv style=\"font-family: charter;\"\u003e\n    \u003ca href=\"https://joanrod.github.io\" target=\"_blank\"\u003eJuan A. Rodriguez\u003c/a\u003e,\n    \u003ca href=\"https://abhaypuri.github.io/portfolio/\" target=\"_blank\"\u003eAbhay Puri\u003c/a\u003e,\n    \u003ca href=\"https://shubhamagarwal92.github.io/\" target=\"_blank\"\u003eShubham Agarwal\u003c/a\u003e,\n    \u003ca href=\"https://scholar.google.ca/citations?user=8vRS7F0AAAAJ\u0026hl=en\" target=\"_blank\"\u003eIssam H. Laradji\u003c/a\u003e,\n    \u003ca href=\"https://scholar.google.es/citations?user=IwBx73wAAAAJ\u0026hl=ca\" target=\"_blank\"\u003ePau Rodriguez\u003c/a\u003e,\n    \u003ca href=\"https://scholar.google.es/citations?user=1jHvtfsAAAAJ\u0026hl=ca\" target=\"_blank\"\u003eDavid Vazquez\u003c/a\u003e,\n    \u003ca href=\"https://scholar.google.com/citations?user=1ScWJOoAAAAJ\u0026hl=en\" target=\"_blank\"\u003eChris Pal\u003c/a\u003e,\n    \u003ca href=\"https://scholar.google.com/citations?user=aVfyPAoAAAAJ\u0026hl=en\" target=\"_blank\"\u003eMarco Pedersoli\u003c/a\u003e\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## 🔥 News\n- March 2025: **StarVector Accepted at CVPR 2025**,\n  - StarVector has been accepted at CVPR 2025! Check out the paper [[Link](https://arxiv.org/abs/2312.11556)]\n  - Check out our website for more information [[Link](https://starvector.github.io/)]\n  - StarVector models are now available on HuggingFace! [[Link](https://huggingface.co/starvector/starvector-1b-im2svg)] [[Link](https://huggingface.co/starvector/starvector-8b-im2svg)]\n  - SVGBench and SVG-Stack datasets are now available on HuggingFace Datasets! [[Link](https://huggingface.co/datasets/starvector/svg-bench)] [[Link](https://huggingface.co/datasets/starvector/svg-stack)]\n  \n## 🚀 Introduction\nStarVector is a multimodal vision-language model for Scalable Vector Graphics (SVG) generation. It can be used to perform image2SVG and text2SVG generation. We pose image generation as a code generation task, using the power of multimodal VLMs\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/starvector-teaser.png\" alt=\"starvector\" style=\"width: 900px; display: block; margin-left: auto; margin-right: auto;\" /\u003e\n\u003c/div\u003e\n\n\u003e **Abstract**: Scalable Vector Graphics (SVGs) are vital for modern image rendering due to their scalability and versatility. Previous SVG generation methods have focused on curve-based vectorization, lacking semantic understanding, often producing artifacts, and struggling with SVG primitives beyond \\textit{path} curves. To address these issues, we introduce StarVector, a multimodal large language model for SVG generation. It performs image vectorization by understanding image semantics and using SVG primitives for compact, precise outputs. Unlike traditional methods, StarVector works directly in the SVG code space, leveraging visual understanding to apply accurate SVG primitives. To train StarVector, we create SVG-Stack, a diverse dataset of 2M samples that enables generalization across vectorization tasks and precise use of primitives like ellipses, polygons, and text. We address challenges in SVG evaluation, showing that pixel-based metrics like MSE fail to capture the unique qualities of vector graphics. We introduce SVG-Bench, a benchmark across 10 datasets, and 3 tasks: Image-to-SVG, Text-to-SVG generation, and diagram generation. Using this setup, StarVector achieves state-of-the-art performance, producing more compact and semantically rich SVGs.\n\n### Multimodal Architecture\n\nStarVector uses a multimodal architecture to process images and text. When performing Image-to-SVG (or image vectorization), the image is projected into visual tokens, and SVG code is generated. When performing Text-to-SVG, the model only recieves the text instruction (no image is provided), and a novel SVG is created. The LLM is based of StarCoder, which we leverage to transfer coding skills to SVG generation.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/starvector-arch.png\" alt=\"starvector\" style=\"width: 700px; display: block; margin-left: auto; margin-right: auto;\" /\u003e\n\u003c/div\u003e\n\n## 📖 Table of Contents\n- [💿 Installation](#installation)\n- [🏎️ Quick Start - Image2SVG Generation](#quick-start---image2svg-generation)\n- [🎨 Models](#models)\n- [📊 Datasets](#datasets---svg-bench)\n- [🏋️‍♂️ Training](#training)\n- [🏆 Evaluation on SVG-Bench](#validation-on-svg-benchmarks-svg-bench)\n- [🧩 Demo](#starvector-demo)\n- [📚 Citation](#citation)\n- [📝 License](#license)\n\n\n## Installation\n\n1. Clone this repository and navigate to star-vector folder\n```bash\ngit clone https://github.com/joanrod/star-vector.git\ncd star-vector\n```\n\n2. Install Package\n```Shell\nconda create -n starvector python=3.11.3 -y\nconda activate starvector\npip install --upgrade pip  # enable PEP 660 support\npip install -e .\n```\n\n3. Install additional packages for training\n```\npip install -e \".[train]\"\n```\n\n### Upgrade to latest code base\n\n```Shell\ngit pull\npip install -e .\n```\n\n## Quick Start - Image2SVG Generation\n\n```Python\nfrom PIL import Image\nfrom starvector.model.starvector_arch import StarVectorForCausalLM\nfrom starvector.data.util import process_and_rasterize_svg\n\nmodel_name = \"starvector/starvector-8b-im2svg\"\n\nstarvector = StarVectorForCausalLM.from_pretrained(model_name)\n\nstarvector.cuda()\nstarvector.eval()\n\nimage_pil = Image.open('assets/examples/sample-0.png')\nimage = starvector.process_images([image_pil])[0].cuda()\nbatch = {\"image\": image}\n\nraw_svg = starvector.generate_im2svg(batch, max_length=1000)[0]\nsvg, raster_image = process_and_rasterize_svg(raw_svg)\n```\n\n### Use it from HuggingFace AutoModel\n\n```Python\nfrom PIL import Image\nfrom transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor\nfrom starvector.data.util import process_and_rasterize_svg\nimport torch\n\nmodel_name = \"starvector/starvector-8b-im2svg\"\n\nstarvector = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, trust_remote_code=True)\nprocessor = starvector.model.processor\ntokenizer = starvector.model.svg_transformer.tokenizer\n\nstarvector.cuda()\nstarvector.eval()\n\nimage_pil = Image.open('assets/examples/sample-18.png')\n\nimage = processor(image_pil, return_tensors=\"pt\")['pixel_values'].cuda()\nif not image.shape[0] == 1:\n    image = image.squeeze(0)\nbatch = {\"image\": image}\n\nraw_svg = starvector.generate_im2svg(batch, max_length=4000)[0]\nsvg, raster_image = process_and_rasterize_svg(raw_svg)\n```\n\n\n## Models\n\nWe provide [Hugging Face 🤗 model checkpoints](https://huggingface.co/collections/starvector/starvector-models-6783b22c7bd4b43d13cb5289) for image2SVG vectorization, for 💫 StarVector-8B and 💫 StarVector-1B. These are the results on SVG-Bench, using the DinoScore metric.\n\n| Method        | SVG-Stack | SVG-Fonts | SVG-Icons | SVG-Emoji | SVG-Diagrams |\n|---------------|-----------|-----------|-----------|-----------|--------------|\n| AutoTrace    | 0.942     | 0.954     | 0.946     | 0.975     | 0.874        |\n| Potrace      | 0.898     | 0.967     | 0.972     | 0.882     | 0.875        |\n| VTracer      | 0.954     | 0.964     | 0.940     | 0.981     | 0.882        |\n| Im2Vec        | 0.692     | 0.733     | 0.754     | 0.732     | -            |\n| LIVE          | 0.934     | 0.956     | 0.959     | 0.969     | 0.870        |\n| DiffVG        | 0.810     | 0.821     | 0.952     | 0.814     | 0.822        |\n| GPT-4-V       | 0.852     | 0.842     | 0.848     | 0.850     | -            |\n| 💫 StarVector-1B (🤗 [Link](https://huggingface.co/starvector/starvector-1b-im2svg)) | 0.926     | 0.978     | 0.975     | 0.929     | 0.943        |\n| 💫 StarVector-8B (🤗 [Link](https://huggingface.co/starvector/starvector-8b-im2svg)) | **0.966** | **0.982** | **0.984** | **0.981** | **0.959**    |\n\n*Note*: StarVector models will not work for natural images or illustrations, as they have not been trained on those images. They excel in vectorizing icons, logotypes, technical diagrams, graphs, and charts.\n\n## Datasets - SVG-Bench\nSVG-Bench is a benchmark for evaluating SVG generation models. It contains 10 datasets, and 3 tasks: Image-to-SVG, Text-to-SVG, and Diagram-to-SVG.\n\nSee our [Huggingface 🤗 Dataset Collection](https://huggingface.co/collections/starvector/starvector-svg-datasets-67811204a76475be4dd66d09)  \n\n| Dataset         |  Train  | Val   | Test | Token Length     | SVG Primitives | Annotation     |\n|-----------------|--------|-------|------|------------------|----------------|----------------|\n| SVG-Stack (🤗 [Link](https://huggingface.co/datasets/starvector/svg-stack)) | 2.1M   | 108k  | 5.7k | 1,822 ± 1,808    | All            | [Captions](https://huggingface.co/datasets/starvector/text2svg-stack)        |\n| SVG-Stack_sim (🤗 [Link](https://huggingface.co/datasets/starvector/svg-stack-simple)) | 601k   | 30.1k | 1.5k | 2k ± 918         | Vector path    | -        |\n| SVG-Diagrams (🤗 [Link](https://huggingface.co/datasets/starvector/svg-diagrams)) | -      | -     | 472  | 3,486 ± 1,918    | All            | -        |\n| SVG-Fonts (🤗 [Link](https://huggingface.co/datasets/starvector/svg-fonts)) | 1.8M   | 91.5k | 4.8k | 2,121 ± 1,868    | Vector path    | Font letter      |\n| SVG-Fonts_sim (🤗 [Link](https://huggingface.co/datasets/starvector/svg-fonts-simple)) | 1.4M   | 71.7k | 3.7k | 1,722 ± 723      | Vector path    | Font letter      |\n| SVG-Emoji (🤗 [Link](https://huggingface.co/datasets/starvector/svg-emoji)) | 8.7k   | 667   | 668  | 2,551 ± 1,805    | All            | -          |\n| SVG-Emoji_sim (🤗 [Link](https://huggingface.co/datasets/starvector/svg-emoji-simple)) | 580    | 57    | 96   | 2,448 ± 1,026    | Vector Path    | -          |\n| SVG-Icons (🤗 [Link](https://huggingface.co/datasets/starvector/svg-icons)) | 80.4k  | 6.2k  | 2.4k | 2,449 ± 1,543    | Vector path    | -              |\n| SVG-Icons_sim (🤗 [Link](https://huggingface.co/datasets/starvector/svg-icons-simple)) | 80,435 | 2,836 | 1,277| 2,005 ± 824      | Vector path    | -              |\n| SVG-FIGR (🤗 [Link](https://huggingface.co/datasets/starvector/FIGR-SVG)) | 270k   | 27k   | 3k   | 5,342 ± 2,345    | Vector path    | Class, Caption | \n\n\n\u003eWe offer a summary of statistics about the datasets used in our training and evaluation experiments. This datasets are included in SVG-Bench. The subscript _sim_ stands for the simplified version of the dataset, as required by some baselines.\n\n## Training\n\n### Confirm dependencies are installed\n\n```bash\npip install -e \".[train]\"\n```\n\n### Set environment variables\nWe recommend setting the following environment variables:\n\n```bash\n  export HF_HOME=\u003cpath to the folder where you want to store the models\u003e\n  export HF_TOKEN=\u003cyour huggingface token\u003e\n  export WANDB_API_KEY=\u003cyour wandb token\u003e\n  export OUTPUT_DIR=\u003cpath/to/output\u003e\n```\n\ncd the root of the repository.\n\n```Shell\ncd star-vector\n```\n\n### Image2SVG Pretraining (Stage 1)\n\nWe have different training approaches for StarVector-1B and StarVector-8B. StarVector-1B can be trained using Deepspeed, while StarVector-8B requires FSDP.\n\n#### StarVector-1B Training\n\nYou can use the following command to train StarVector-1B on SVG-Stack for the Image2SVG vectorization task, using Deepspeed and Accelerate\n\n```bash\n# StarVector-1B\naccelerate launch --config_file configs/accelerate/deepspeed-8-gpu.yaml starvector/train/train.py config=configs/models/starvector-1b/im2svg-stack.yaml\n```\n\n#### StarVector-8B Training\n\nYou can use the following command to train StarVector-8B on SVG-Stack for the Image2SVG vectorization task, using FSDP and Accelerate. We provide the torchrun command to support multi-nodes and multi-GPUs.\n\n```bash\n# StarVector-8B\ntorchrun \\\n  --nproc-per-node=8 \\\n  --nnodes=1 \\\n  starvector/train/train.py \\\n  config=configs/models/starvector-8b/im2svg-stack.yaml\n```\n\n\n### Finetuning StarVector (Stage 2)\n\nAfter pretraining StarVector on image vectorization, we finetune it on additional SVG tasks like Text2SVG, and SVG-Bench datasets.\n\n#### Text2SVG Finetuning\n\n```bash\n# StarVector-1B\naccelerate launch --config_file config/accelerate/deepspeed-8-gpu.yaml starvector/train/train.py config=configs/models/starvector-1b/text2svg-stack.yaml\n\n# StarVector-8B\ntorchrun \\\n  --nproc-per-node=8 \\\n  --nnodes=1 \\\n  starvector/train/train.py \\\n  config=configs/models/starvector-8b/text2svg-stack.yaml\n```\n\n#### SVG-Bench Finetuning\n\n```bash\n# StarVector-1B\naccelerate launch --config_file config/accelerate/deepspeed-8-gpu.yaml starvector/train/train.py config=configs/models/starvector-1b/im2svg-{fonts,icons,emoji}.yaml\n\n# StarVector-8B\ntorchrun \\\n  --nproc-per-node=8 \\\n  --nnodes=1 \\\n  starvector/train/train.py \\\n  config=configs/models/starvector-8b/im2svg-{fonts,icons,emoji}.yaml\n```\n\nWe also provide shell scripts in `scripts/train/*` \n\n## Validation on SVG Benchmarks (⭐ SVG-Bench)\n\nWe validate StarVector on ⭐ SVG-Bench Benchmark. We provide the SVGValidator class that allows you to run StarVector using **1) the HuggingFace generation backend** or **2) the VLLM backend**. The later is substantially faster thanks to the use of Paged Attention. \n\n### HuggingFace Generation Backend\nLet's start with the evaluation for StarVector-1B and StarVector-8B on SVG-Stack, using the HuggingFace generation backend (StarVectorHFAPIValidator). To override the input arguments, you can add cli args following the yaml file structure.\n\n```bash\n# StarVector-1B on SVG-Stack, using the HuggingFace backend \npython starvector/validation/validate.py \\\nconfig=configs/generation/hf/starvector-1b/im2svg.yaml \\\ndataset.name=starvector/svg-stack\n\n# StarVector-8B on SVG-Stack, using the vanilla HuggingFace generation API\npython starvector/validation/validate.py \\\nconfig=configs/generation/hf/starvector-8b/im2svg.yaml \\\ndataset.name=starvector/svg-stack\n```\n\n### vLLM Backend\n\nFor using the vLLM backend (StarVectorVLLMAPIValidator), first install our StarVector fork of VLLM, [here](https://github.com/starvector/vllm).\n\n```bash\ngit clone https://github.com/starvector/vllm.git\ncd vllm\npip install -e .\n```\n\nThen, launch the using the vllm config file (it uses StarVectorVLLMValidator):\n\n```bash\n# StarVector-1B\npython starvector/validation/validate.py \\\nconfig=configs/generation/vllm/starvector-1b/im2svg.yaml \\\ndataset.name=starvector/svg-stack\n\n# StarVector-8B\npython starvector/validation/validate.py \\\nconfig=configs/generation/vllm/starvector-8b/im2svg.yaml \\\ndataset.name=starvector/svg-stack\n```\n\nWe provide evaluation scripts in `scripts/eval/*`\n\n\n## StarVector Demo\n\nThe demo provides two options for converting images to SVG code:\n1. HuggingFace generation functionality\n2. VLLM (recommended) - offers faster generation speed\n\n### Option 1: HuggingFace Generation with Gradio Web UI\n\nWe provide a Gradio web UI for you to play with our model.\n\n#### Launch a controller\n```Shell\npython -m starvector.serve.controller --host 0.0.0.0 --port 10000\n```\n\n#### Launch a gradio web server.\n```Shell\npython -m starvector.serve.gradio_web_server --controller http://localhost:10000 --model-list-mode reload --port 7000\n```\nYou just launched the Gradio web interface. Now, you can open the web interface with the URL printed on the screen. You may notice that there is no model in the model list. Do not worry, as we have not launched any model worker yet. It will be automatically updated when you launch a model worker.\n\n#### Launch a model worker\n\nThis is the actual *worker* that performs the inference on the GPU.  Each worker is responsible for a single model specified in `--model-path`.\n\n```Shell\npython -m starvector.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40000 --worker http://localhost:40000 --model-path joanrodai/starvector-1.4b\n```\nWait until the process finishes loading the model and you see \"Uvicorn running on ...\".  Now, refresh your Gradio web UI, and you will see the model you just launched in the model list.\n\nYou can launch as many workers as you want, and compare between different model checkpoints in the same Gradio interface. Please keep the `--controller` the same, and modify the `--port` and `--worker` to a different port number for each worker.\n\n\n```Shell\nvllm serve starvector/starvector-8b-im2svg --chat-template configs/chat-template.jinja --trust-remote-code --port 8001 --max-model-len 16000\n\npython -m starvector.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port \u003cdifferent from 40000, say 40001\u003e --worker http://localhost:\u003cchange accordingly, i.e. 40001\u003e --model-path \u003cckpt2\u003e\n```\n\n#### Option 2: Launch VLLM\n\n0. Remember to clone the starvector/vllm fork (it has modifications for starvector).\n\n```Shell\ngit clone https://github.com/starvector/vllm.git\ncd vllm\npip install -e .\n```\n\n1. Call this to launch the VLLM endpoint\n\n\n```Shell\nvllm serve starvector/starvector-1b-im2svg --chat-template configs/chat-template.jinja --trust-remote-code --port 8000 --max-model-len 8192\n```\n\n2. Create the demo for VLLM\n\n```Shell\npython -m starvector.serve.vllm_api_gradio.controller --host 0.0.0.0 --port 10000\npython -m starvector.serve.vllm_api_gradio.gradio_web_server --controller http://localhost:10000 --model-list-mode reload --port 7000\npython -m starvector.serve.vllm_api_gradio.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40000 --worker http://localhost:40000 --model-name starvector/starvector-1b-im2svg --vllm-base-url http://localhost:8000\n```\n\n3. Add more models by serving them with VLLM and calling a new model worker\n\n```Shell\nvllm serve starvector/starvector-8b-im2svg --chat-template configs/chat-template.jinja --trust-remote-code --port 8001 --max-model-len 16384\n\npython -m starvector.serve.vllm_api_gradio.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40001 --worker http://localhost:40001 --model-name starvector/starvector-8b-im2svg --vllm-base-url http://localhost:8001\n```\n\n## Citation\n```\n@misc{rodriguez2024starvector,\n      title={StarVector: Generating Scalable Vector Graphics Code from Images and Text}, \n      author={Juan A. Rodriguez and Abhay Puri and Shubham Agarwal and Issam H. Laradji and Pau Rodriguez and Sai Rajeswar and David Vazquez and Christopher Pal and Marco Pedersoli},\n      year={2024},\n      eprint={2312.11556},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV},\n      url={https://arxiv.org/abs/2312.11556}, \n}\n```\n\n## License\nThis project is licensed under the Apache License, Version 2.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoanrod%2Fstar-vector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoanrod%2Fstar-vector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoanrod%2Fstar-vector/lists"}