# Does llama-2 need pro subscription?

**URL:** <https://discuss.huggingface.co/t/does-llama-2-need-pro-subscription/48554>\
**Category:** Beginners\
**Created:** [July 28, 2023, 7:29pm UTC](https://discuss.huggingface.co/t/does-llama-2-need-pro-subscription/48554 "2023-07-28T19:29:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonali-tamhankar](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sonali-tamhankar](https://discuss.huggingface.co/u/sonali-tamhankar)\
**Post date:** [July 28, 2023, 7:29pm UTC](https://discuss.huggingface.co/t/does-llama-2-need-pro-subscription/48554/1 "2023-07-28T19:29:50Z")

</div>

I get the following error when trying to use meta-llama/Llama-2-7b-hf model. I didn’t find any pointers through web search, so asking here. Can someone please help?

> llm = HuggingFaceHub(repo\_id = “meta-llama/Llama-2-7b-hf”,huggingfacehub\_api\_token=my\_token, model\_kwargs={“temperature”:0.5, “max\_length”:512})

Generates the following error. If I swap out the repo\_id to “google/flan-t5-base”, the code runs fine.

> raise ValueError(f"Error raised by inference API: {response[‘error’]}")  
> ValueError: Error raised by inference API: Model requires a Pro subscription

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![YaTharThShaRma999](https://avatars.discourse-cdn.com/v4/letter/y/41988e/32.png) [@YaTharThShaRma999](https://discuss.huggingface.co/u/YaTharThShaRma999)\
**Post date:** [July 28, 2023, 9:54pm UTC](https://discuss.huggingface.co/t/does-llama-2-need-pro-subscription/48554/2 "2023-07-28T21:54:23Z")

</div>

yes to use it with inference api, you need pro subscription since its too large(13gbish\>10gb which is free api limit). Ofcourse you could run it locally without any error.

---

<div class="post-metadata">

**Author:** ![sonali-tamhankar](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sonali-tamhankar](https://discuss.huggingface.co/u/sonali-tamhankar)\
**Post date:** [July 28, 2023, 10:15pm UTC](https://discuss.huggingface.co/t/does-llama-2-need-pro-subscription/48554/3 "2023-07-28T22:15:36Z")

</div>

Thank you, @YaTharThShaRma999! Are there quantized versions I can use through inference API? I see models by ‘TheBloke’ which are smaller than 10GB, but it appears that inference API is turned off for these.

Thank you so much for your help!

---

<div class="post-metadata">

**Author:** ![YaTharThShaRma999](https://avatars.discourse-cdn.com/v4/letter/y/41988e/32.png) [@YaTharThShaRma999](https://discuss.huggingface.co/u/YaTharThShaRma999)\
**Post date:** [July 28, 2023, 11:36pm UTC](https://discuss.huggingface.co/t/does-llama-2-need-pro-subscription/48554/4 "2023-07-28T23:36:48Z")

</div>

You cant use those since those are actually for different libraries and things. Like gptq version is for exllama and autogptq while ggml version are for llama cpp.

If you really want to use a llama model and dont have some sort of gpu, try out llama cpp python.  
It uses like 4gb ram max for 7b model(avg phones have like 6gb ram).

If you do have gpu, use autogptq or something which works with transformers as well.

---

<div class="post-metadata">

**Author:** ![prakash1524](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@prakash1524](https://discuss.huggingface.co/u/prakash1524)\
**Post date:** [August 2, 2023, 11:17am UTC](https://discuss.huggingface.co/t/does-llama-2-need-pro-subscription/48554/5 "2023-08-02T11:17:44Z")

</div>

@YaTharThShaRma999 hi sir can you please provide some resources for the mentioned  
i wanna implement llama cpp python but using ctransformer library does not provide some functions like  
import torch  
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, AutoTokenizer

model\_name = “TheBloke/Llama-2-7B-GGML”

bnb\_config = BitsAndBytesConfig(  
load\_in\_4bit=True,  
bnb\_4bit\_quant\_type=“nf4”,  
bnb\_4bit\_compute\_dtype=torch.float16,  
)

model = AutoModelForCausalLM.from\_pretrained(  
model\_name,  
quantization\_config=bnb\_config,  
trust\_remote\_code=True  
)  
model.config.use\_cache = False

like this code i am not able to use in ggml  
so i am not able to understand what model should we pick for finetuning ???  
is ggml not for finetuning?  
if not then whats the uses of ggml ?

can you please answer or give some links for these as i am not able to get

---

<div class="post-metadata">

**Author:** ![YaTharThShaRma999](https://avatars.discourse-cdn.com/v4/letter/y/41988e/32.png) [@YaTharThShaRma999](https://discuss.huggingface.co/u/YaTharThShaRma999)\
**Post date:** [August 2, 2023, 9:05pm UTC](https://discuss.huggingface.co/t/does-llama-2-need-pro-subscription/48554/6 "2023-08-02T21:05:02Z")

</div>

Ggml is for inference but it is kinda possible to train a new model from scratch.

Also, in your code for some reason, you try to load a ggml model(already 4 bit quantized) in 4 bit again?

That is not possible. If you need a bit more information check out ctransformers docs? (Ctransformers is also just for inference and doesn’t have all the things like transformers)

Ggml models are used because they use extremely low ram up and very fast inference in cpu.

---

<div class="post-metadata">

**Author:** ![valogoblin](https://avatars.discourse-cdn.com/v4/letter/v/8e7dd6/32.png) [@valogoblin](https://discuss.huggingface.co/u/valogoblin)\
**Post date:** [November 24, 2023, 8:25pm UTC](https://discuss.huggingface.co/t/does-llama-2-need-pro-subscription/48554/7 "2023-11-24T20:25:22Z")

</div>

hi did you got any solution, found any other model or found any way to use API for free?
