Text Generation
PyTorch
GGUF
English
quantum
quantum-entropy
from-scratch
char-level
cosmic-synapse-theory
custom-architecture
llama-cpp
continual-learning
reproducible-seed
open-science
null-results
Instructions to use phera-ra/QC67_cosmo 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 phera-ra/QC67_cosmo 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 phera-ra/QC67_cosmo # Run inference directly in the terminal: llama cli -hf phera-ra/QC67_cosmo
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf phera-ra/QC67_cosmo # Run inference directly in the terminal: llama cli -hf phera-ra/QC67_cosmo
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 phera-ra/QC67_cosmo # Run inference directly in the terminal: ./llama-cli -hf phera-ra/QC67_cosmo
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 phera-ra/QC67_cosmo # Run inference directly in the terminal: ./build/bin/llama-cli -hf phera-ra/QC67_cosmo
Use Docker
docker model run hf.co/phera-ra/QC67_cosmo
- LM Studio
- Jan
- vLLM
How to use phera-ra/QC67_cosmo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "phera-ra/QC67_cosmo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "phera-ra/QC67_cosmo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/phera-ra/QC67_cosmo
- Ollama
How to use phera-ra/QC67_cosmo with Ollama:
ollama run hf.co/phera-ra/QC67_cosmo
- Unsloth Studio
How to use phera-ra/QC67_cosmo with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for phera-ra/QC67_cosmo to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for phera-ra/QC67_cosmo to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for phera-ra/QC67_cosmo to start chatting
- Docker Model Runner
How to use phera-ra/QC67_cosmo with Docker Model Runner:
docker model run hf.co/phera-ra/QC67_cosmo
- Lemonade
How to use phera-ra/QC67_cosmo with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull phera-ra/QC67_cosmo
Run and chat with the model
lemonade run user.QC67_cosmo-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
| diff --git a/src/llama-arch.cpp b/src/llama-arch.cpp | |
| index 72968607d..8a1927243 100644 | |
| --- a/src/llama-arch.cpp | |
| +++ b/src/llama-arch.cpp | |
| static const std::map<llm_arch, const char *> LLM_ARCH_NAMES = { | |
| { LLM_ARCH_KIMI_LINEAR, "kimi-linear" }, | |
| { LLM_ARCH_TALKIE, "talkie" }, | |
| { LLM_ARCH_MELLUM, "mellum" }, | |
| + { LLM_ARCH_COSMOS, "cosmos" }, | |
| { LLM_ARCH_UNKNOWN, "(unknown)" }, | |
| }; | |
| static const std::map<llm_tensor, const char *> LLM_TENSOR_NAMES = { | |
| { LLM_TENSOR_ATTN_Q_NORM, "blk.%d.attn_q_norm" }, | |
| { LLM_TENSOR_ATTN_K_NORM, "blk.%d.attn_k_norm" }, | |
| { LLM_TENSOR_ATTN_GATE, "blk.%d.attn_gate" }, | |
| + { LLM_TENSOR_ATTN_54, "blk.%d.attn_54" }, | |
| { LLM_TENSOR_FFN_POST_NORM, "blk.%d.post_ffw_norm" }, | |
| { LLM_TENSOR_FFN_POST_NORM_1, "blk.%d.post_ffw_norm_1" }, | |
| { LLM_TENSOR_FFN_POST_NORM_2, "blk.%d.post_ffw_norm_2" }, | |
| static const std::map<llm_tensor, llm_tensor_info> LLM_TENSOR_INFOS = { | |
| {LLM_TENSOR_ATTN_QKV, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}}, | |
| {LLM_TENSOR_ATTN_OUT, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}}, | |
| {LLM_TENSOR_ATTN_GATE, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}}, | |
| + {LLM_TENSOR_ATTN_54, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}}, | |
| {LLM_TENSOR_FFN_GATE, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}}, | |
| {LLM_TENSOR_FFN_DOWN, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}}, | |
| {LLM_TENSOR_FFN_UP, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}}, | |
| diff --git a/src/llama-arch.h b/src/llama-arch.h | |
| index b74d53af4..036f4e30f 100644 | |
| --- a/src/llama-arch.h | |
| +++ b/src/llama-arch.h | |
| enum llm_arch { | |
| LLM_ARCH_MELLUM, | |
| LLM_ARCH_EAGLE3, | |
| LLM_ARCH_DFLASH, | |
| + LLM_ARCH_COSMOS, | |
| LLM_ARCH_UNKNOWN, | |
| }; | |
| enum llm_tensor { | |
| LLM_TENSOR_ATTN_ROT_EMBD, | |
| LLM_TENSOR_ATTN_SINKS, | |
| LLM_TENSOR_ATTN_GATE, | |
| + LLM_TENSOR_ATTN_54, | |
| LLM_TENSOR_FFN_GATE_INP, | |
| LLM_TENSOR_FFN_GATE_INP_SHEXP, | |
| LLM_TENSOR_FFN_NORM, | |
| diff --git a/src/llama-model.cpp b/src/llama-model.cpp | |
| index 4c10e4126..1cb328fa4 100644 | |
| --- a/src/llama-model.cpp | |
| +++ b/src/llama-model.cpp | |
| static llama_model * llama_model_mapping(llm_arch arch, const llama_model_params | |
| return new llama_model_eagle3(params); | |
| case LLM_ARCH_DFLASH: | |
| return new llama_model_dflash(params); | |
| + case LLM_ARCH_COSMOS: | |
| + return new llama_model_cosmos(params); | |
| case LLM_ARCH_MIMO2: | |
| return new llama_model_mimo2(params); | |
| case LLM_ARCH_KIMI_LINEAR: | |
| llama_rope_type llama_model_rope_type(const llama_model * model) { | |
| case LLM_ARCH_NEMOTRON_H: | |
| case LLM_ARCH_NEMOTRON_H_MOE: | |
| case LLM_ARCH_KIMI_LINEAR: | |
| + case LLM_ARCH_COSMOS: | |
| return LLAMA_ROPE_TYPE_NONE; | |
| // use what we call a normal RoPE, operating on pairs of consecutive head values | |
| diff --git a/src/llama-model.h b/src/llama-model.h | |
| index 45b054ced..a5c54f058 100644 | |
| --- a/src/llama-model.h | |
| +++ b/src/llama-model.h | |
| struct llama_layer { | |
| // openai-moe | |
| struct ggml_tensor * attn_sinks = nullptr; | |
| + // cosmos: 54D mixture-of-states Hebbian attention | |
| + struct ggml_tensor * attn_54 = nullptr; | |
| + struct ggml_tensor * attn_gate = nullptr; | |
| + | |
| // DeepSeek-V4 | |
| struct ggml_tensor * attn_kv_norm = nullptr; | |
| struct ggml_tensor * hc_attn_fn = nullptr; | |
| diff --git a/src/models/models.h b/src/models/models.h | |
| index a86ae05aa..91c7a512d 100644 | |
| --- a/src/models/models.h | |
| +++ b/src/models/models.h | |
| struct llama_model_qwen : public llama_model_base { | |
| }; | |
| +struct llama_model_cosmos : public llama_model_base { | |
| + llama_model_cosmos(const struct llama_model_params & params) : llama_model_base(params) {} | |
| + void load_arch_hparams(llama_model_loader & ml) override; | |
| + void load_arch_tensors(llama_model_loader & ml) override; | |
| + | |
| + struct graph : public llm_graph_context { | |
| + graph(const llama_model & model, const llm_graph_params & params); | |
| + }; | |
| + | |
| + std::unique_ptr<llm_graph_context> build_arch_graph(const llm_graph_params & params) const override; | |
| +}; | |
| + | |
| struct llama_model_qwen2 : public llama_model_base { | |
| llama_model_qwen2(const struct llama_model_params & params) : llama_model_base(params) {} | |
| void load_arch_hparams(llama_model_loader & ml) override; | |