Instructions to use CrowdMind/Blueberry with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CrowdMind/Blueberry with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CrowdMind/Blueberry", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("CrowdMind/Blueberry", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CrowdMind/Blueberry with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CrowdMind/Blueberry" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CrowdMind/Blueberry", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CrowdMind/Blueberry
- SGLang
How to use CrowdMind/Blueberry with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "CrowdMind/Blueberry" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CrowdMind/Blueberry", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "CrowdMind/Blueberry" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CrowdMind/Blueberry", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CrowdMind/Blueberry with Docker Model Runner:
docker model run hf.co/CrowdMind/Blueberry
Download configuration_blueberry.py from CrowdMind/Blueberry: direct link, hf CLI and curl.
- Browser
- Download file 6.92 kB
-
https://huggingface.co/CrowdMind/Blueberry/resolve/main/configuration_blueberry.py
- Command line
-
hf download hf://CrowdMind/Blueberry/configuration_blueberry.py
-
curl -L -o configuration_blueberry.py https://huggingface.co/CrowdMind/Blueberry/resolve/main/configuration_blueberry.py
6.92 kB
| # π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨ | |
| # This file was automatically generated from src/transformers/models/blueberry/modular_blueberry.py. | |
| # Do NOT edit this file manually as any edits will be overwritten by the generation of | |
| # the file from the modular. If any change should be done, please apply the change to the | |
| # modular_blueberry.py file directly. One of our CI enforces this. | |
| # π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨ | |
| # Copyright 2026 Dustin Loring and the HuggingFace Inc. team. All rights reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| from huggingface_hub.dataclasses import strict | |
| from transformers.configuration_utils import PreTrainedConfig | |
| from transformers.modeling_rope_utils import RopeParameters | |
| from transformers.utils import auto_docstring | |
| class BlueberryConfig(PreTrainedConfig): | |
| r""" | |
| num_unique_layers (`int`, *optional*, defaults to 8): | |
| Number of distinct decoder blocks. `num_hidden_layers` counts their executions, including repeated passes. | |
| loop_repeats (`int`, *optional*, defaults to 3): | |
| Total passes through the middle half of the decoder blocks. | |
| loop_gate (`bool`, *optional*, defaults to `True`): | |
| Whether to learn a per-token mix of the prelude and previous pass at loop boundaries. | |
| window_pattern (`str`, *optional*, defaults to `"SSSL"`): | |
| Pattern tiled across distinct blocks. `S` uses a short sliding window and `L` uses full causal attention. | |
| The final block always uses full attention. | |
| sliding_window (`int`, *optional*): | |
| Short attention window including the current token. Defaults to the quarter-context window rounded up | |
| to a multiple of 128 predecessors, plus the current token. | |
| value_gate_channels (`int`, *optional*, defaults to 12): | |
| Number of hidden channels used by each attention value gate. | |
| smear_gate_channels (`int`, *optional*, defaults to 24): | |
| Number of token embedding channels used by the previous-token mixing gate. | |
| """ | |
| model_type = "blueberry" | |
| vocab_size: int = 32768 | |
| hidden_size: int = 512 | |
| intermediate_size: int | None = None | |
| num_unique_layers: int = 8 | |
| num_attention_heads: int = 4 | |
| num_key_value_heads: int | None = None | |
| hidden_act: str = "relu2" | |
| max_position_embeddings: int = 2048 | |
| rope_parameters: RopeParameters | dict | None = None | |
| loop_repeats: int = 3 | |
| loop_gate: bool = True | |
| window_pattern: str = "SSSL" | |
| sliding_window: int | None = None | |
| value_gate_channels: int = 12 | |
| smear_gate_channels: int = 24 | |
| final_logit_softcapping: float = 15.0 | |
| use_cache: bool = True | |
| bos_token_id: int | None = None | |
| eos_token_id: int | list[int] | None = None | |
| pad_token_id: int | None = None | |
| tie_word_embeddings: bool = False | |
| def __post_init__(self, **kwargs): | |
| self.intermediate_size = self.intermediate_size if self.intermediate_size is not None else 4 * self.hidden_size | |
| if self.num_key_value_heads is None: | |
| self.num_key_value_heads = self.num_attention_heads | |
| if self.rope_parameters is None: | |
| self.rope_parameters = {"rope_type": "default", "rope_theta": 100_000.0} | |
| if self.sliding_window is None: | |
| self.sliding_window = ((self.max_position_embeddings + 511) // 512) * 128 + 1 | |
| self.window_pattern = self.window_pattern.upper() | |
| super().__post_init__(**kwargs) | |
| def loop_start(self): | |
| return self.num_unique_layers // 4 | |
| def layer_indices(self): | |
| indices = tuple(range(self.num_unique_layers)) | |
| loop_end = self.loop_start + self.num_unique_layers // 2 | |
| return ( | |
| indices[: self.loop_start] + indices[self.loop_start : loop_end] * self.loop_repeats + indices[loop_end:] | |
| ) | |
| def num_hidden_layers(self): | |
| return len(self.layer_indices) | |
| def layer_types(self): | |
| if not self.window_pattern: | |
| return [] | |
| types = [ | |
| "sliding_attention" if self.window_pattern[index % len(self.window_pattern)] == "S" else "full_attention" | |
| for index in self.layer_indices | |
| ] | |
| # The last cache slot holds full attention KV and the previous unsmeared token embedding. | |
| return types[:-1] + ["hybrid"] | |
| def has_value_embedding(self, layer_idx): | |
| return layer_idx % 2 == (self.num_unique_layers - 1) % 2 | |
| def validate_architecture(self): | |
| if self.num_unique_layers < 1 or self.loop_repeats < 1: | |
| raise ValueError("Blueberry requires at least one decoder block and one loop pass.") | |
| if self.loop_repeats > 1 and (self.num_unique_layers < 4 or self.num_unique_layers % 2): | |
| raise ValueError("Multiple loop passes require an even number of distinct blocks of at least four.") | |
| if self.loop_gate and self.loop_repeats == 1: | |
| raise ValueError("The loop gate requires at least two loop passes.") | |
| if not self.window_pattern or set(self.window_pattern) - {"S", "L"}: | |
| raise ValueError("`window_pattern` must contain one or more S or L characters.") | |
| if self.sliding_window < 1: | |
| raise ValueError("`sliding_window` must be positive.") | |
| if ( | |
| self.num_attention_heads < 1 | |
| or self.hidden_size % (2 * self.num_attention_heads) | |
| or self.num_key_value_heads < 1 | |
| or self.num_attention_heads % self.num_key_value_heads | |
| ): | |
| raise ValueError("Blueberry requires an even head dimension and valid grouped heads.") | |
| if not (0 < self.value_gate_channels <= self.hidden_size and 0 < self.smear_gate_channels <= self.hidden_size): | |
| raise ValueError("Gate channel counts must be positive and at most hidden_size.") | |
| __all__ = ["BlueberryConfig"] | |