aviol commited on
Commit
eaf718b
·
verified ·
1 Parent(s): 9f9649a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -0
README.md CHANGED
@@ -1,3 +1,34 @@
1
  ---
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
  ---
4
+
5
+
6
+ # Download tiny llama llamafile
7
+ - Go to https://huggingface.co/aviol/TinyLlama1.1-llamafile-bootstraped/blob/main/TinyLlama-1.1B.llamafile
8
+ - Download using the download button
9
+
10
+ # Run the server
11
+ ```shell
12
+ # Make executable after downloading
13
+ chmod +x TinyLlama-1.1B.llamafile
14
+
15
+ # Run
16
+ ./TinyLlama-1.1B.llamafile --server --host 0.0.0.0 --port 1234
17
+ ```
18
+
19
+
20
+ # Use the LLM using OpenAI SDK:
21
+ ```python
22
+ from openai import OpenAI
23
+
24
+ client = OpenAI(base_url="http://127.0.0.1:1234/v1", api_key="test")
25
+
26
+ stream = client.chat.completions.create(
27
+ model="chatgpt-4",
28
+ messages=[{"role": "user", "content": prompt}],
29
+ stream=True,
30
+ )
31
+ for chunk in stream:
32
+ if chunk.choices[0].delta.content is not None:
33
+ print(chunk.choices[0].delta.content, end="")
34
+ ```