Yi
01.AI Large Language Model
01.AI's open-source large language model. Offers a high-performance lineup including Yi-Lightning and Yi-Large.
01.AI Large Language Model
01.AI's open-source large language model. Offers a high-performance lineup including Yi-Lightning and Yi-Large.
Yi is a series of large language models developed by 01.AI, founded by Kai-Fu Lee, an AI investor and former president of Google China. Since its first release in November 2023, the Yi series has shown outstanding performance in both Chinese and English and has been drawing attention in the global LLM market.
Yi models are divided into open-source versions (Yi-6B, Yi-34B) and commercial API versions (Yi-Large, Yi-Lightning). The open-source versions are provided under the Apache 2.0 license, allowing commercial use, and can be downloaded from Hugging Face. The commercial API can be accessed through platform.lingyiwanwu.com.
The core technologies of the Yi models are an enhanced MoE (Mixture of Experts) architecture and large-scale multilingual pre-training. Yi-Lightning maximized training and inference efficiency through fine-grained expert segmentation and advanced routing strategies, and in October 2024 it ranked joint 3rd on the UC Berkeley LMSYS leaderboard, following OpenAI and x.AI.
In practice, Yi is drawing attention as a cost-effective alternative. Yi-Lightning offers competitive performance at $0.14 per million tokens, cheaper than GPT-4o-mini ($0.15–$0.60). It is particularly strong in Chinese language processing, code generation, and mathematical reasoning, making it a useful option when building multilingual services.
# Yi API 사용 예제 (OpenAI 호환 인터페이스)
from openai import OpenAI
# 01.AI Platform API 클라이언트 설정
client = OpenAI(
api_key="your-yi-api-key",
base_url="https://api.lingyiwanwu.com/v1"
)
# Yi-Lightning 모델 호출 (가장 비용 효율적)
def chat_with_yi_lightning(prompt: str) -> str:
response = client.chat.completions.create(
model="yi-lightning",
messages=[
{"role": "system", "content": "당신은 한국어와 중국어에 능통한 AI 어시스턴트입니다."},
{"role": "user", "content": prompt}
],
max_tokens=1000,
temperature=0.7
)
return response.choices[0].message.content
# Yi-Large 모델 호출 (고성능 추론)
def chat_with_yi_large(prompt: str, stream: bool = False) -> str:
response = client.chat.completions.create(
model="yi-large",
messages=[
{"role": "user", "content": prompt}
],
max_tokens=2000,
stream=stream
)
if stream:
full_response = ""
for chunk in response:
if chunk.choices[0].delta.content:
full_response += chunk.choices[0].delta.content
print(chunk.choices[0].delta.content, end="", flush=True)
return full_response
return response.choices[0].message.content
# 다국어 번역 예제 (Yi의 강점)
def translate_multilingual(text: str, source_lang: str, target_lang: str) -> str:
prompt = f"""
다음 텍스트를 {source_lang}에서 {target_lang}로 번역해주세요.
자연스럽고 문맥에 맞는 번역을 제공하세요.
원문: {text}
번역:
"""
return chat_with_yi_lightning(prompt)
# Hugging Face에서 오픈소스 Yi 모델 사용
from transformers import AutoModelForCausalLM, AutoTokenizer
def load_yi_opensource():
model_id = "01-ai/Yi-34B-Chat"
tokenizer = AutoTokenizer.from_pretrained(
model_id,
trust_remote_code=True
)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype="auto",
trust_remote_code=True
)
return model, tokenizer
def generate_with_yi_local(model, tokenizer, prompt: str) -> str:
messages = [{"role": "user", "content": prompt}]
input_ids = tokenizer.apply_chat_template(
messages,
return_tensors="pt"
).to(model.device)
output = model.generate(
input_ids,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9
)
return tokenizer.decode(output[0], skip_special_tokens=True)
# 실행 예제
if __name__ == "__main__":
# API 사용
result = chat_with_yi_lightning("Python에서 async/await 사용법을 설명해주세요.")
print(result)
# 번역 예제
translation = translate_multilingual(
"인공지능이 세상을 바꾸고 있습니다.",
"한국어",
"중국어"
)
print(f"번역 결과: {translation}")
This is the API pricing information for 01.AI Yi models as of January 2025. (Note: after March 2025, 01.AI halted its own pre-training and shifted to solutions based on DeepSeek models.)
| Model | Input/Output (1M tokens) | Context | Features |
|---|---|---|---|
| Yi-Lightning | $0.14 / $0.14 | 16K tokens | Best cost efficiency, MoE architecture |
| Yi-Lightning-Lite | $0.07 / $0.07 | 16K tokens | Lightweight version, for simple tasks |
| Yi-Large | $2.00 / $2.00 | 32K tokens | GPT-4-level performance, complex reasoning |
| Yi-34B (open source) | Free (self-hosting) | 200K tokens | Apache 2.0, commercial use allowed |
Benchmark performance: Yi-Lightning ranked joint 3rd with Grok-2 on the LMSYS leaderboard in October 2024, and its inference speed improved by 40% compared to before. Its price in China is 0.99 yuan per million tokens (about $0.14), which is competitive compared to GPT-4o-mini.
"I need to build a chatbot for entering the Chinese market. Which model would be good?" - "The Yi series is a good fit. Yi-Lightning costs $0.14 per million tokens, which is cheaper than GPT-4o-mini, and it excels at Chinese language processing. Since 01.AI is a Chinese company, it has abundant Chinese training data, and it also ranks near the top of the LMSYS leaderboard. For a multilingual service, its cost efficiency is clearly good."
"Please explain the features of the Yi models and how they differ from other LLMs." - "Yi is a model from 01.AI, founded by Kai-Fu Lee, and it offers two options: open source and a commercial API. Its biggest feature is cost efficiency based on the MoE architecture, and Yi-Lightning has excellent price-to-performance compared to GPT-4o-mini. Yi-34B can be used commercially under the Apache 2.0 license, so it is well suited to on-premises deployment, and it supports a 200K context window."
"What should I watch out for when adopting Yi in production?" - "01.AI announced that starting in March 2025 it would halt its own pre-training and shift to DeepSeek models. The existing Yi API will probably continue to operate, but in the long term it seems advisable to consider using DeepSeek directly or self-hosting the open-source Yi-34B. In particular, the open-source version can be run stably without being affected by updates."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
In March 2025, 01.AI halted its own LLM pre-training and shifted to solutions based on DeepSeek models. For new projects, review your dependence on the Yi API with this in mind.
Yi-Lightning (16K), Yi-Large (32K), and the open-source Yi-34B (200K) have different context sizes. If you need to process long documents, self-hosting the open-source version may be more suitable.
If cost optimization is your goal, use Yi-Lightning; if you need long-term stability, self-host the open-source Yi-34B. Because it provides an OpenAI-compatible API, migrating existing code is easy.