## Run WizardCoder With An API

WizardCoder is a Code Large Language Model (LLM) that has been fine-tuned on **Llama2** and has demonstrated superior performance compared to other open-source and closed LLMs on prominent code generation benchmarks.

You can now try out [wizardCoder-15B](/content/wizardlm/generate/models/wizardCoder-15B/index.html) and [wizardCoder-Python-34B](/content/wizardlm/generate/models/wizardCoder-Python-34B/index.html) in the Clarifai Platform and access it through the API.

### Table of Contents

- Introduction
- Evol-Instruct
- Prompt Format
- Running WizardCoder with Python
- Best Use Cases
- Evaluation

### Introduction

The world of coding has been revolutionized by the advent of large language models (LLMs) like GPT-4, StarCoder, and Code LLama. WizardCoder is taking things to a whole new level. WizardCoder is a specialized model that has been fine-tuned to follow complex coding instructions. It leverages the Evol-Instruct method to adapt to coding tasks, making it a powerful tool for developers.

### Evol-Instruct

Evol-Instruct is an evolutionary algorithm that generates diverse and complex instruction data for Large-scale Language Models (LLMs). It is designed to enhance the performance of LLMs by providing them with high-quality instructions that are difficult to create manually.

Evol-Instruct works by generating a pool of initial instructions(52k instruction dataset of Alpaca), which are then evolved through a series of steps to create more complex and diverse instructions. Once the instruction pool is generated, it is used to fine-tune an LLM, resulting in a new model called WizardCoder. The fine-tuning process involves training the LLM on the instruction data to improve its ability to generate coherent and fluent text in response to various inputs.

### Prompt Format

For WizardCoder, the Prompt should be as following:

### Running WizardCoder model with Python

You can run the WizardCoder-15 B Model using Clarifai’s Python client.

Check out the Code Below:

**You can also run WizardCoder-15 B Model using other Clarifai Client Libraries like Javascript, Java, cURL, NodeJS, PHP, etc** [here](https://docs.clarifai.com/api-guide/api-overview/api-clients/?__hstc=26175983.7bf20ca38b9167c324cc14c164543a28.1695211630887.1695217951266.1695281378632.3&__hssc=26175983.1.1695281378632&__hsfp=155447314)

### Model Demo in the Clarifai Platform:

Try out the WizardCoder-15B and WizardCoder-Python-34B models here: [https://clarifai.com/wizardlm/generate/models/wizardCoder-15B](/content/wizardlm/generate/models/wizardCoder-15B/index.html) and [https://clarifai.com/wizardlm/generate/models/wizardCoder-Python-34B](/content/wizardlm/generate/models/wizardCoder-Python-34B/index.html)

### Best Use Cases

WizardCoder can be used for a variety of code-related tasks, including code generation, code completion, and code summarization. Here are some examples of input prompts that can be used with the model:

- **Code generation:** Given a description of a programming task, generate the corresponding code. Example input: “Write a Python function that takes a list of integers as input and returns the sum of all even numbers in the list.”
- **Code completion:** Given an incomplete code snippet, complete the code. Example input: “def multiply(a, b): \n return a * b _”
- **Code summarization:** Given a long code snippet, generate a summary of the code. Example input: “Write a Python program that reads a CSV file and calculates the average of a specific column.”

The 34B model is not just a coding assistant; it’s a powerhouse capable of:

- **Automating DevOps Scripts:** Generate shell scripts or Python scripts for automating tasks.
- **Data Analysis:** Generate Python code for data preprocessing, analysis, and visualization.
- **Machine Learning Pipelines:** Generate end-to-end ML pipelines, from data collection to model deployment.
- **Web Scraping:** Generate code for web scraping tasks.
- **API Development:** Generate boilerplate code for RESTful APIs.
- **Blockchain:** Generate smart contracts for Ethereum or other blockchain platforms

### Evaluation

WizardCoder beats all other open-source Code LLMs, attaining state-of-the-art (SOTA) performance, according to experimental findings from four code-generating benchmarks, including HumanEval, HumanEval+, MBPP, and DS-100.

**WizardCoder-Python-34B** has demonstrated exceptional performance on code-related tasks. The model has outperformed other open-source and closed LLMs on prominent code generation benchmarks, including **HumanEval (73.2%)**, HumanEval+, and **MBPP(61.2%)**.

WizardCoder-Python-34B-V1.0 attains the second position in [HumanEval Benchmarks](https://github.com/openai/human-eval), surpassing GPT4 (2023/03/15, 73.2 vs. 67.0), ChatGPT-3.5 (73.2 vs. 72.5) and Claude2 (73.2 vs. 71.2).

**WizardCoder-15B-v1.0** model achieves the **57.3 pass@1** on the [HumanEval Benchmarks](https://github.com/openai/human-eval), which is 22.3 points higher than the SOTA open-source Code LLMs including StarCoder, CodeGen, CodeGee, and CodeT5+. Additionally, WizardCoder significantly outperforms all the open-source Code LLMs with instructions fine-tuning, including InstructCodeT5+, StarCoder-GPTeacher, and Instruct-Codegen-16B
