This dataset enables Bee-8B to achieve exceptional performance, particularly in complex reasoning, establishing a new standard for fully open MLLMs.
1import requests
2import torch
3from PIL import Image
4from transformers import AutoModel, AutoProcessor
5
6model_path = "Open-Bee/Bee-8B-Stage3"
7
8# Load model
9model = AutoModel.from_pretrained(
10 model_path,
11 torch_dtype=torch.bfloat16,
12 trust_remote_code=True,
13).to("cuda")
14
15# Load processor
16processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
17
18# Define conversation messages
19messages = [{
20 "role":
21 "user",
22 "content": [
23 {
24 "type": "image",
25 "image": "https://huggingface.co/Open-Bee/Bee-8B-Stage3/resolve/main/assets/logo.png",
26 },
27 {
28 "type": "text",
29 "text": "Based on this picture, write an advertising slogan about Bee-8B (a Fully Open Multimodal Large Language Model)."
30 },
31 ],
32}]
33
34# Apply chat template
35text = processor.apply_chat_template(messages,
36 tokenize=False,
37 add_generation_prompt=True,
38 enable_thinking=True)
39
40# Load image
41image_url = "https://huggingface.co/Open-Bee/Bee-8B-Stage3/resolve/main/assets/logo.png"
42image = Image.open(requests.get(image_url, stream=True).raw)
43
44# Process inputs
45inputs = processor(images=image, text=text, return_tensors="pt").to("cuda")
46
47# Generate output
48generated_ids = model.generate(**inputs, max_new_tokens=16384, temperature=0.6)
49output_ids = generated_ids[0][len(inputs.input_ids[0]):]
50
51# Decode output
52output_text = processor.decode(output_ids, skip_special_tokens=True)
53
54# Print result
55print(output_text)
1git clone https://github.com/vllm-project/vllm.git
2cd vllm
3VLLM_USE_PRECOMPILED=1 uv pip install --editable .
1from transformers import AutoProcessor
2from vllm import LLM, SamplingParams
3from PIL import Image
4import requests
5
6
7def main():
8
9 model_path = "Open-Bee/Bee-8B-Stage3"
10
11 llm = LLM(
12 model=model_path,
13 limit_mm_per_prompt={"image": 5},
14 trust_remote_code=True,
15 tensor_parallel_size=1,
16 gpu_memory_utilization=0.8,
17 )
18
19 sampling_params = SamplingParams(
20 temperature=0.6,
21 max_tokens=16384,
22 )
23
24 image_url = "https://huggingface.co/Open-Bee/Bee-8B-Stage3/resolve/main/assets/logo.png"
25 image = Image.open(requests.get(image_url, stream=True).raw)
26
27 messages = [
28 {
29 "role":
30 "user",
31 "content": [
32 {
33 "type": "image",
34 "image": image
35 },
36 {
37 "type":
38 "text",
39 "text":
40 "Based on this picture, write an advertising slogan about Bee-8B (a Fully Open Multimodal Large Language Model)."
41 },
42 ],
43 },
44 ]
45
46 processor = AutoProcessor.from_pretrained(model_path,
47 trust_remote_code=True)
48 prompt = processor.apply_chat_template(
49 messages,
50 tokenize=False,
51 add_generation_prompt=True,
52 enable_thinking=True,
53 )
54
55 mm_data = {"image": image}
56 llm_inputs = {
57 "prompt": prompt,
58 "multi_modal_data": mm_data,
59 }
60
61 outputs = llm.generate([llm_inputs], sampling_params=sampling_params)
62 generated_text = outputs[0].outputs[0].text
63
64 print(generated_text)
65
66
67if __name__ == '__main__':
68 main()
1vllm serve \
2 Open-Bee/Bee-8B-Stage3 \
3 --served-model-name Bee-8B-Stage3 \
4 --tensor-parallel-size 8 \
5 --gpu-memory-utilization 0.8 \
6 --host 0.0.0.0 \
7 --port 8000 \
8 --trust-remote-code
1from openai import OpenAI
2
3# Set OpenAI's API key and API base to use vLLM's API server.
4openai_api_key = "EMPTY"
5openai_api_base = "http://localhost:8000/v1"
6
7client = OpenAI(
8 api_key=openai_api_key,
9 base_url=openai_api_base,
10)
11
12# image url
13image_messages = [
14 {
15 "role":
16 "user",
17 "content": [
18 {
19 "type": "image_url",
20 "image_url": {
21 "url":
22 "https://huggingface.co/Open-Bee/Bee-8B-Stage3/resolve/main/assets/logo.png"
23 },
24 },
25 {
26 "type":
27 "text",
28 "text":
29 "Based on this picture, write an advertising slogan about Bee-8B (a Fully Open Multimodal Large Language Model)."
30 },
31 ],
32 },
33]
34
35chat_response = client.chat.completions.create(
36 model="Bee-8B-Stage3",
37 messages=image_messages,
38 max_tokens=16384,
39 extra_body={
40 "chat_template_kwargs": {
41 "enable_thinking": True
42 },
43 },
44)
45print("Chat response:", chat_response.choices[0].message.content)
Bee-8B is developed based on the architectures and codebases of the following projects:
R-4B,
LLaVA-OneVision,
SigLIP2,
Qwen3, and evaluated using
VLMEvalKit. We sincerely thank these projects for their outstanding contributions to the open-source community.