llama2

Llama 2 is a collection of foundation language models ranging from 7B to 70B parameters.

7b 13b 70b
Hızlı Kurulum (Ollama kuruluysa)
ollama run llama2

Ollama kurulu değil mi? ollama.com/download — Windows, macOS ve Linux için ücretsiz. İlk çalıştırmada model indirilir, sonrası tamamen çevrimdışıdır.

Varyantlar

Boyut büyüdükçe kalite artar, donanım ihtiyacı yükselir. Başlangıç için küçük varyantı deneyin.

EtiketBoyutBağlamGirdiKomut
latest 3.8GB 4K Text ollama run llama2:latest
chat 3.8GB 4K Text ollama run llama2:chat
text 3.8GB 4K Text ollama run llama2:text
7b 3.8GB 4K Text ollama run llama2:7b
13b 7.4GB 4K Text ollama run llama2:13b
70b 39GB 4K Text ollama run llama2:70b
7b-chat 3.8GB 4K Text ollama run llama2:7b-chat
7b-chat-q2_K 2.8GB 4K Text ollama run llama2:7b-chat-q2_K
7b-chat-q3_K_S 2.9GB 4K Text ollama run llama2:7b-chat-q3_K_S
7b-chat-q3_K_M 3.3GB 4K Text ollama run llama2:7b-chat-q3_K_M
7b-chat-q3_K_L 3.6GB 4K Text ollama run llama2:7b-chat-q3_K_L
7b-chat-q4_0 3.8GB 4K Text ollama run llama2:7b-chat-q4_0
7b-chat-q4_1 4.2GB 4K Text ollama run llama2:7b-chat-q4_1
7b-chat-q4_K_S 3.9GB 4K Text ollama run llama2:7b-chat-q4_K_S
7b-chat-q4_K_M 4.1GB 4K Text ollama run llama2:7b-chat-q4_K_M
7b-chat-q5_0 4.7GB 4K Text ollama run llama2:7b-chat-q5_0
7b-chat-q5_1 5.1GB 4K Text ollama run llama2:7b-chat-q5_1
7b-chat-q5_K_S 4.7GB 4K Text ollama run llama2:7b-chat-q5_K_S
7b-chat-q5_K_M 4.8GB 4K Text ollama run llama2:7b-chat-q5_K_M
7b-chat-q6_K 5.5GB 4K Text ollama run llama2:7b-chat-q6_K
7b-chat-q8_0 7.2GB 4K Text ollama run llama2:7b-chat-q8_0
7b-chat-fp16 13GB 4K Text ollama run llama2:7b-chat-fp16
7b-text 3.8GB 4K Text ollama run llama2:7b-text
7b-text-q2_K 2.8GB 4K Text ollama run llama2:7b-text-q2_K
7b-text-q3_K_S 2.9GB 4K Text ollama run llama2:7b-text-q3_K_S

77 varyant daha var — tümü için ollama.com.

Model Detayları ve Benchmarklar (kaynak: ollama.com)

Llama 2 is released by Meta Platforms, Inc. This model is trained on 2 trillion tokens, and by default supports a context length of 4096. Llama 2 Chat models are fine-tuned on over 1 million human annotations, and are made for chat.

CLI

Open the terminal and run ollama run llama2

API

Example using curl:

curl -X POST http://localhost:11434/api/generate -d '{
  "model": "llama2",
  "prompt":"Why is the sky blue?"
 }'

API documentation

Memory requirements

  • 7b models generally require at least 8GB of RAM
  • 13b models generally require at least 16GB of RAM
  • 70b models generally require at least 64GB of RAM

If you run into issues with higher quantization levels, try using the q4 model or shut down any other programs that are using a lot of memory.

Model variants

Chat is fine-tuned for chat/dialogue use cases. These are the default in Ollama, and for models tagged with -chat in the tags tab.

Example: ollama run llama2

Pre-trained is without the chat fine-tuning. This is tagged as -text in the tags tab.

Example: ollama run llama2:text

By default, Ollama uses 4-bit quantization. To try other quantization levels, please try the other tags. The number after the q represents the number of bits used for quantization (i.e. q4 means 4-bit quantization). The higher the number, the more accurate the model is, but the slower it runs, and the more memory it requires.

References

Llama 2: Open Foundation and Fine-Tuned Chat Models

Meta’s Hugging Face repo