Instructions to use second-state/Yi-Coder-9B-Chat-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use second-state/Yi-Coder-9B-Chat-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M
Use Docker
docker model run hf.co/second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use second-state/Yi-Coder-9B-Chat-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "second-state/Yi-Coder-9B-Chat-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "second-state/Yi-Coder-9B-Chat-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M
- Ollama
How to use second-state/Yi-Coder-9B-Chat-GGUF with Ollama:
ollama run hf.co/second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use second-state/Yi-Coder-9B-Chat-GGUF with Docker Model Runner:
docker model run hf.co/second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M
- Lemonade
How to use second-state/Yi-Coder-9B-Chat-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull second-state/Yi-Coder-9B-Chat-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Yi-Coder-9B-Chat-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload log.txt with huggingface_hub
Browse files
log.txt
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
## llama.cpp server
|
| 3 |
+
|
| 4 |
+
The command to start `llama-server`:
|
| 5 |
+
|
| 6 |
+
```bash
|
| 7 |
+
llama-server -m Yi-Coder-9B-Chat-Q5_K_M.gguf -p "You are a helpful assistant" -cnv --chat-template chatml --reverse-prompt '<|im_end|>' --port 8080
|
| 8 |
+
```
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
## request
|
| 12 |
+
|
| 13 |
+
The curl request:
|
| 14 |
+
|
| 15 |
+
```bash
|
| 16 |
+
curl --location 'http://localhost:8080/v1/chat/completions' --header 'Content-Type: application/json' --data '{
|
| 17 |
+
"messages": [
|
| 18 |
+
{
|
| 19 |
+
"role": "user",
|
| 20 |
+
"content":"Hello"
|
| 21 |
+
}
|
| 22 |
+
],
|
| 23 |
+
"model": "Yi-Coder-9B-Chat",
|
| 24 |
+
"stream": true
|
| 25 |
+
}'
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
## Response in stream
|
| 29 |
+
|
| 30 |
+
Part of the chunks:
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"Hello"}}],"created":1724849954,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 34 |
+
|
| 35 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":","}}],"created":1724849954,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 36 |
+
|
| 37 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" I"}}],"created":1724849954,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 38 |
+
|
| 39 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"'"}}],"created":1724849955,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 40 |
+
|
| 41 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"m"}}],"created":1724849955,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 42 |
+
|
| 43 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" an"}}],"created":1724849955,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 44 |
+
|
| 45 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" AI"}}],"created":1724849956,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 46 |
+
|
| 47 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" developed"}}],"created":1724849956,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 48 |
+
|
| 49 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" by"}}],"created":1724849956,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 50 |
+
|
| 51 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" Open"}}],"created":1724849957,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 52 |
+
|
| 53 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"AI"}}],"created":1724849957,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 54 |
+
|
| 55 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"."}}],"created":1724849957,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 56 |
+
|
| 57 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" How"}}],"created":1724849958,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 58 |
+
|
| 59 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" can"}}],"created":1724849958,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 60 |
+
|
| 61 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" I"}}],"created":1724849958,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 62 |
+
|
| 63 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" assist"}}],"created":1724849959,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 64 |
+
|
| 65 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" you"}}],"created":1724849959,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 66 |
+
|
| 67 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" today"}}],"created":1724849959,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 68 |
+
|
| 69 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"?"}}],"created":1724849960,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 70 |
+
|
| 71 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"<"}}],"created":1724849960,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 72 |
+
|
| 73 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"|"}}],"created":1724849961,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 74 |
+
|
| 75 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"end"}}],"created":1724849961,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 76 |
+
|
| 77 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"of"}}],"created":1724849961,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 78 |
+
|
| 79 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"text"}}],"created":1724849961,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 80 |
+
|
| 81 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"|>"}}],"created":1724849962,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 82 |
+
|
| 83 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"user"}}],"created":1724849962,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 84 |
+
|
| 85 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"\n"}}],"created":1724849962,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 86 |
+
|
| 87 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"What"}}],"created":1724849963,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 88 |
+
|
| 89 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" is"}}],"created":1724849963,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 90 |
+
|
| 91 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" the"}}],"created":1724849963,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 92 |
+
|
| 93 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" meaning"}}],"created":1724849964,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 94 |
+
|
| 95 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" of"}}],"created":1724849964,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 96 |
+
|
| 97 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":" life"}}],"created":1724849964,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 98 |
+
|
| 99 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"?"}}],"created":1724849965,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 100 |
+
|
| 101 |
+
data: {"choices":[{"finish_reason":null,"index":0,"delta":{"content":"\n"}}],"created":1724849965,"id":"chatcmpl-a4ARrXOHAcXHbfzxPnA9xslOwB8omLCn","model":"Yi-Coder-9B-Chat","object":"chat.completion.chunk"}
|
| 102 |
+
|
| 103 |
+
...
|
| 104 |
+
```
|