Text Generation
MLX
Safetensors
English
CoDA
quantized
text-diffusion
conversational
4-bit precision
Instructions to use TiGa-RCE/CoDA-v0-Instruct-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use TiGa-RCE/CoDA-v0-Instruct-MLX-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("TiGa-RCE/CoDA-v0-Instruct-MLX-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use TiGa-RCE/CoDA-v0-Instruct-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "TiGa-RCE/CoDA-v0-Instruct-MLX-4bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "TiGa-RCE/CoDA-v0-Instruct-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use TiGa-RCE/CoDA-v0-Instruct-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "TiGa-RCE/CoDA-v0-Instruct-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "TiGa-RCE/CoDA-v0-Instruct-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TiGa-RCE/CoDA-v0-Instruct-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use TiGa-RCE/CoDA-v0-Instruct-MLX-4bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "TiGa-RCE/CoDA-v0-Instruct-MLX-4bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default TiGa-RCE/CoDA-v0-Instruct-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use TiGa-RCE/CoDA-v0-Instruct-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "TiGa-RCE/CoDA-v0-Instruct-MLX-4bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "TiGa-RCE/CoDA-v0-Instruct-MLX-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download model_config.py from TiGa-RCE/CoDA-v0-Instruct-MLX-4bit: direct link, hf CLI and curl.
- Browser
- Download file 3.34 kB
-
https://huggingface.co/TiGa-RCE/CoDA-v0-Instruct-MLX-4bit/resolve/main/model_config.py
- Command line
-
hf download hf://TiGa-RCE/CoDA-v0-Instruct-MLX-4bit/model_config.py
-
curl -L -o model_config.py https://huggingface.co/TiGa-RCE/CoDA-v0-Instruct-MLX-4bit/resolve/main/model_config.py
3.34 kB
| from transformers.configuration_utils import PretrainedConfig | |
| from transformers.modeling_rope_utils import rope_config_validation | |
| from transformers.utils import logging | |
| logger = logging.get_logger(__name__) | |
| class CoDAConfig(PretrainedConfig): | |
| model_type = "CoDA" | |
| keys_to_ignore_at_inference = ["past_key_values"] | |
| def __init__( | |
| self, | |
| vocab_size=151936, | |
| head_dim=128, | |
| hidden_act="silu", | |
| hidden_size=2048, | |
| intermediate_size=6144, | |
| num_attention_heads=16, | |
| num_hidden_layers=28, | |
| num_key_value_heads=8, | |
| max_position_embeddings=40960, | |
| initializer_range=0.02, | |
| use_cache=True, | |
| use_sliding_window=False, | |
| tie_word_embeddings=True, | |
| rms_norm_eps=1e-6, | |
| rope_scaling=None, | |
| rope_theta=1000000, | |
| sliding_window=None, | |
| max_window_layers=28, | |
| attention_bias=False, | |
| attention_dropout=0.0, | |
| bos_token_id=151643, | |
| eos_token_id=151645, | |
| pad_token_id=151643, | |
| mask_token_id=151669, | |
| attention_kernel="flash_attention", | |
| prefix_probability=0, | |
| truncate_probability=0, | |
| block_masking_probability=[0.25, 0.5, 0.5, 0.75, 0.25], | |
| mask_block_sizes=[4, 8, 16, 32], | |
| sampling_eps=[0.001, 0.25, 0.5, 0.25, 0.001], # minimum noise level | |
| **kwargs, | |
| ): | |
| self.vocab_size = vocab_size | |
| self.max_position_embeddings = max_position_embeddings | |
| self.hidden_size = hidden_size | |
| self.intermediate_size = intermediate_size | |
| self.num_hidden_layers = num_hidden_layers | |
| self.num_attention_heads = num_attention_heads | |
| self.use_sliding_window = use_sliding_window | |
| self.sliding_window = sliding_window if use_sliding_window else None | |
| self.max_window_layers = max_window_layers | |
| # for backward compatibility | |
| if num_key_value_heads is None: | |
| num_key_value_heads = num_attention_heads | |
| self.num_key_value_heads = num_key_value_heads | |
| self.hidden_act = hidden_act | |
| self.initializer_range = initializer_range | |
| self.rms_norm_eps = rms_norm_eps | |
| self.use_cache = use_cache | |
| self.rope_theta = rope_theta | |
| self.rope_scaling = rope_scaling | |
| self.attention_dropout = attention_dropout | |
| # Validate the correctness of rotary position embeddings parameters | |
| # BC: if there is a 'type' field, move it to 'rope_type'. | |
| if self.rope_scaling is not None and "type" in self.rope_scaling: | |
| self.rope_scaling["rope_type"] = self.rope_scaling["type"] | |
| rope_config_validation(self) | |
| self.head_dim = head_dim | |
| self.attention_bias = attention_bias | |
| self.bos_token_id = bos_token_id | |
| self.eos_token_id = eos_token_id | |
| self.attention_kernel = attention_kernel | |
| self.prefix_probability = prefix_probability | |
| self.truncate_probability = truncate_probability | |
| self.block_masking_probability = block_masking_probability | |
| self.mask_block_sizes = mask_block_sizes | |
| self.sampling_eps = sampling_eps | |
| super().__init__( | |
| tie_word_embeddings=tie_word_embeddings, | |
| **kwargs, | |
| ) | |
| self.mask_token_id = mask_token_id | |
| self.pad_token_id = pad_token_id | |