WhoBuilt

Fine tune 20 Llama Models in 5 Minutes

Feb 9, 2025· 6 min· 1.4K views·Watch on YouTube

Speaker

Santosh Radha of Covalent explains at an AI Engineer event how to fine-tune and deploy multiple models from Python using Covalent’s compute orchestration.

Run Python on the compute you need

Radha describes Covalent as an open-source product for writing Python locally and sending it to a chosen compute backend. A decorator can specify hardware such as an H100 with 36 GB of memory and a two-day time limit. Users can run jobs on their own cluster, on-premises, or in Covalent’s cloud, where charges are based on GPU time used.

Deploy Python inference services

Radha says users can define an initializer and an endpoint such as `/generate`, then deploy the service with one `cc deploy` command. He says the endpoint can scale to zero or scale with incoming requests. Users can also set autoscaling rules based on a schedule, GPU utilization, or request volume.

Build a model selection workflow

Radha demonstrates ordinary Python functions for fine-tuning and evaluating models. He assigns training to a 24-core CPU and an H100 with 48 GB of memory, then evaluates accuracy and sorts models on CPU to reserve GPU resources for training. A workflow loops through models, records their accuracy, and deploys the best performer.

Review job costs and results

After dispatching the workflow with one line of code, Radha shows jobs running on their assigned devices. One evaluation took six minutes on an L4 machine and cost 87 cents; another took six minutes on a v0 machine and cost 11 cents. He says the resulting fine-tuned model was deployed without requiring users to write Docker or Kubernetes code.

Takeaways

  • Match each workflow step to its needs: use GPUs for fine-tuning and CPUs for sorting results.
  • Automate model comparison by recording evaluation scores and selecting the top performer.
  • Track compute costs at the job level; Radha’s examples show different prices for six-minute evaluations.
  • Define deployment and autoscaling rules in Python to manage an inference endpoint.

Mentioned in this talk

Search inside this talk

What was claimed 6

  • feature
    Covalent: Lets users dispatch Python functions to selected compute backends with a decorator and receive the result as a Python object.
    “We help people write Python locally and ship the code to whatever compute backend they need.”
    YouTube
    Unverified1 source· Talk
  • feature
    Covalent: Supports running jobs on a user's own compute or on Covalent's GPU cluster.
    “You can attach your own compute cluster, and it runs there.”
    YouTube
    Unverified1 source· Talk
  • feature
    Covalent: Deploys Python inference services as API endpoints with configurable scaling, including scaling to zero.
    “You get back an API endpoint that scales to zero or scales with requests as they come in.”
    YouTube
    Unverified1 source· Talk
  • feature
    Covalent: Allows users to define custom autoscaling rules based on schedules, GPU utilization, or request counts.
    “You can define your custom autoscaling mechanism.”
    YouTube
    Unverified1 source· Talk
  • metric
    Covalent: Another model evaluation ran on a v0 machine for six minutes and cost 11 cents.
    “Another model ran on a v0 machine for six minutes again, and it cost 11 cents.”
    YouTube
    Unverified1 source· Talk
  • metric
    Covalent: One model evaluation ran on an L4 machine for six minutes and cost 87 cents.
    “It ran on an L4 machine for six minutes, and it cost 87 cents.”
    YouTube
    Unverified1 source· Talk

Related talks