Views
No views yet
1chmod +x TinyLlama-1.1B.llamafile
2
3./TinyLlama-1.1B.llamafile --server --host 0.0.0.0 --port 12341from openai import OpenAI
2
3
4client = OpenAI(base_url="http://127.0.0.1:1234/v1", api_key="test")
5
6# Prompt
7prompt = "Hi, tell me something new about AppSec"
8
9# Send API request to llamafile server
10stream = client.chat.completions.create(
11 model="avi-llmsky",
12 messages=[{"role": "user", "content": prompt}],
13 stream=True,
14)
15
16# Print the responses
17for chunk in stream:
18 if chunk.choices[0].delta.content is not None:
19 print(chunk.choices[0].delta.content, end="")
20