Code Llama 34B Instruct
Code Llama 34B Instruct is Meta's 34-billion-parameter code model tuned to follow chat instructions. Meta groups the 34B with the 70B as the sizes that return its best results.
Overview
This page runs the 34-billion-parameter Instruct version of Code Llama. Meta derived Code Llama from Llama 2 by continuing its training on code-specific data, then fine-tuned the Instruct variant on instructions paired with expected outputs, which Meta says helps it understand what people expect from a prompt. Besides writing new code, it can explain code you paste in, and Meta names debugging as one of its uses. Training ran from January to July 2023 on an offline dataset.
Choosing a variant: Meta says the 34B and 70B return the best results and points to the smaller 7B and 13B for tasks such as code completion. Pick this page when answer quality comes first, for example a change that spans several functions. For a single function or a short script, Code Llama 7B Instruct is the smaller option.
What you can build
- A developer-portal assistant for requests like "add input validation to this handler and write tests for it".
- Onboarding Q&A where a new engineer pastes an unfamiliar module and asks what it does.
- A porting aid that rewrites a function in another language, for example Python into TypeScript.
Inputs
The prompt is the one required field, and the code you want worked on goes in with it. The system prompt defaults to a general instruction to answer helpfully and safely; a line like "answer in TypeScript, code only" turns it into house rules. Give each end user a user_id and each thread a session_id to hold multi-turn conversations.
The advanced panel adds temperature (0 to 5, 0.7 by default), the top_p and top_k filters, penalties for repetition and length, token limits and stop strings separated by semicolons. Quantization starts enabled; it lowers weight precision to reduce memory use and may slightly lower quality. There is no seed field.
Outputs
One text answer per request. The sample on this page responds to the default prompt with an isPositive function that returns num > 0 and a console.log usage example, then notes that the check does not tell whole numbers from decimals and suggests isInteger() for that.
Recommended settings
For code headed into a build or a pull request, set do_sample to false, which the parameter note recommends for code generation. There is no seed field, and every run uses the same fixed seed, so the same prompt in a new session returns the same answer with sampling on or off. To compare several approaches, keep sampling on and change the temperature or the wording of the prompt; the temperature note calls values above 1 random.
Limitations
- No infilling: Meta's card leaves it unmarked for the 34B, and the page takes chat prompts only.
- Meta's intended use excludes natural languages other than English, and its testing so far has been in English only.
- Responses can be inaccurate or objectionable, Meta warns. Test generated code before using it.
- Frameworks and API versions released after its 2023 training are missing from what it learned.
Safety & compliance
Code Llama ships under the Llama 2 Community License, with Meta's Acceptable Use Policy on top. Meta scopes it to commercial and research work in English and the relevant programming languages, and calls the Instruct variant the one intended to be safer for code assistant and generation applications. Before deployment, Meta asks for safety testing and tuning tailored to each application.
API quick start
Run CodeLlama-34b-Instruct-hf with a single API call.
{
"prompt": "Can you write a javascript function that …",
"user_id": "...",
"session_id": "...",
"system_prompt": "You are a helpful, respectful and honest …"
}curl -X POST "https://api.wiro.ai/v1/Run/meta-llama/codellama-34b-instruct-hf" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_WIRO_API_KEY" \
--data-binary @- <<'JSON'
{
"prompt": "Can you write a javascript function that …",
"user_id": "...",
"session_id": "...",
"system_prompt": "You are a helpful, respectful and honest …"
}
JSONOther models you might like
Explore similar llm & chat models.



