Getting Started with OrionStar-Yi-34B-Chat-Llama

Jan 28, 2024 • 4 minutes to read

OrionStar-Yi-34B-Chat-Llama is the same as OrionStarAI's OrionStar-Yi-34B, *only difference being that the tensors have been renamed to follow the LLaMA format for automatic evaluation on the HF leaderboard. *is based on the open-source Yi-34B, it's been fine-tuned on a massive Chinese/English corpus to excel in interactive user experiences. The Yi series are known for benchmark performance, and OrionStar's further fine-tuning pushes it even further. It's freely available for academic research, though certain agreements and Yi licenses apply.

In this article, we will cover

  • How to run OrionStar-Yi-34B-Chat-Llama on your own device
  • How to create an OpenAI-compatible API service for OrionStar-Yi-34B-Chat-Llama

We will use LlamaEdge (the Rust + Wasm stack) to develop and deploy applications for this model. There is no complex Python packages or C++ toolchains to install! See why we choose this tech stack.

Run the model on your own device

Step 1: Install WasmEdge via the following command line.

curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugins wasmedge_rustls wasi_nn-ggml

Step 2: Download the OrionStar-Yi-34B-Chat-Llama model GGUF file It may take a long time, since the size of the model is several GBs.

curl -LO https://huggingface.co/second-state/OrionStar-Yi-34B-Chat-Llama-GGUF/resolve/main/OrionStar-Yi-34B-Chat-Llama-Q5_K_M.gguf

Step 3: Download a cross-platform portable Wasm file for the chat app. The application allows you to chat with the model on the command line. The Rust source code for the app is here.

curl -LO https://github.com/LlamaEdge/LlamaEdge/releases/latest/download/llama-chat.wasm

That's it. You can chat with the model in the terminal by entering the following command.

wasmedge --dir .:. --nn-preload default:GGML:AUTO:OrionStar-Yi-34B-Chat-Llama-Q5_K_M.gguf llama-chat.wasm -p human-assistant

The portable Wasm app automatically takes advantage of the hardware accelerators (eg GPUs) I have on the device.

[You]:
Can you explain me what is AMD?

[Bot]:
AMD, or Advanced Micro Devices, Inc., is an American multinational semiconductor manufacturing company that designs, develops, and sells a wide range of advanced digital technology products, including processors, computer systems, graphics solutions, and data center hardware. The company's primary headquarters are in El Segundo, California.

AMD was formed through the merger of two major semiconductor companies: AMD (Advanced Micro Devices) and ATI Technologies Inc., on November 26, 2013, by combining these entities to form a leading technology and innovation company.

The main goal of AMD is to provide advanced computing solutions for various industries such as gaming, professional graphics, data center, and cloud infrastructure. They produce both CPUs (Central Processing Units) and GPUs (Graphics Processors), which are crucial components in modern personal computers, workstations, and gaming consoles.

AMD's products include the Ryzen series of CPUs that feature Zen cores architecture, the Navi GPU architecture for high-end gaming systems, and various data center solutions like EPYC processors and Radeon graphics cards. The company has a wide range of product lines focused on different segments in the technology market, making it one of the major players in the semiconductor industry.

Create an OpenAI-compatible API service

An OpenAI-compatible web API allows the model to work with a large ecosystem of LLM tools and agent frameworks such as flows.network, LangChain and LlamaIndex.

Download an API server app. It is also a cross-platform portable Wasm app that can run on many CPU and GPU devices.

curl -LO https://github.com/LlamaEdge/LlamaEdge/releases/latest/download/llama-api-server.wasm

Then, download the chatbot web UI to interact with the model with a chatbot UI.

curl -LO https://github.com/LlamaEdge/chatbot-ui/releases/latest/download/chatbot-ui.tar.gz
tar xzf chatbot-ui.tar.gz
rm chatbot-ui.tar.gz

Next, use the following command lines to start an API server for the model. Then, open your browser to http://localhost:8080 to start the chat!

wasmedge --dir .:. --nn-preload default:GGML:AUTO:OrionStar-Yi-34B-Chat-Llama-Q5_K_M.gguf llama-api-server.wasm -p human-assistant

From another terminal, you can interact with the API server using curl.

curl -X POST http://localhost:8080/v1/chat/completions \
  -H 'accept:application/json' \
  -H 'Content-Type: application/json' \
  -d '{"messages":[{"role":"system", "content": "You are a sentient, superintelligent artificial general intelligence, here to teach and assist me."}, {"role":"user", "content": "Write a short story about Goku discovering kirby has teamed up with Majin Buu to destroy the world."}], "model":"OrionStar-Yi-34B-Chat-Llama"}'

That’s all. WasmEdge is easiest, fastest, and safest way to run LLM applications. Give it a try!

Talk to us!

Join the WasmEdge discord to ask questions and share insights.

Any questions getting this model running? Please go to second-state/LlamaEdge to raise an issue or book a demo with us to enjoy your own LLMs across devices!

LLMAI inferenceRustWebAssembly
A high-performance, extensible, and hardware optimized WebAssembly Virtual Machine for automotive, cloud, AI, and blockchain applications