Instructions to use EZCon/GLM-OCR-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use EZCon/GLM-OCR-mlx with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("EZCon/GLM-OCR-mlx") config = load_config("EZCon/GLM-OCR-mlx") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- Pi new
How to use EZCon/GLM-OCR-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "EZCon/GLM-OCR-mlx"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "EZCon/GLM-OCR-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use EZCon/GLM-OCR-mlx 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 "EZCon/GLM-OCR-mlx"
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 EZCon/GLM-OCR-mlx
Run Hermes
hermes
| { | |
| "architectures": [ | |
| "GlmOcrForConditionalGeneration" | |
| ], | |
| "eos_token_id": [ | |
| 59246, | |
| 59253 | |
| ], | |
| "image_end_token_id": 59257, | |
| "image_start_token_id": 59256, | |
| "image_token_id": 59280, | |
| "model_type": "glm_ocr", | |
| "text_config": { | |
| "model_type": "glm_ocr_text", | |
| "pad_token_id": 59246, | |
| "vocab_size": 59392, | |
| "eos_token_id": [ | |
| 59246, | |
| 59253 | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 1536, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4608, | |
| "max_position_embeddings": 131072, | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 16, | |
| "num_nextn_predict_layers": 1, | |
| "num_key_value_heads": 8, | |
| "rms_norm_eps": 1e-05, | |
| "dtype": "bfloat16", | |
| "rope_parameters": { | |
| "rope_type": "default", | |
| "mrope_section": [ | |
| 16, | |
| 24, | |
| 24 | |
| ], | |
| "partial_rotary_factor": 1.0, | |
| "rope_theta": 10000 | |
| }, | |
| "tie_word_embeddings": false, | |
| "use_cache": true | |
| }, | |
| "transformers_version": "5.0.1dev0", | |
| "video_end_token_id": 59259, | |
| "video_start_token_id": 59258, | |
| "video_token_id": 59281, | |
| "vision_config": { | |
| "model_type": "glm_ocr_vision", | |
| "hidden_size": 1024, | |
| "depth": 24, | |
| "num_heads": 16, | |
| "attention_bias": true, | |
| "intermediate_size": 4096, | |
| "hidden_act": "silu", | |
| "hidden_dropout_prob": 0.0, | |
| "initializer_range": 0.02, | |
| "image_size": 336, | |
| "patch_size": 14, | |
| "out_hidden_size": 1536, | |
| "rms_norm_eps": 1e-05, | |
| "spatial_merge_size": 2, | |
| "temporal_patch_size": 2 | |
| } | |
| } |