File size: 2,652 Bytes
a4b70d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# aarch64 (ARM64) Compatibility

This document describes the compatibility status and known issues for g4f on aarch64 (ARM64) systems.

## Issue Resolution

**Fixed in this release:** The "Illegal instruction (core dumped)" error that occurred when importing g4f on aarch64 systems has been resolved.

### Problem
Previously, g4f would crash with "Illegal instruction (core dumped)" on ARM64 systems (such as Apple Silicon Macs, Raspberry Pi, AWS Graviton instances, etc.) due to compiled dependencies with architecture-specific optimizations.

### Solution
The library now includes proper error handling for architecture-incompatible dependencies:
- Safe import mechanisms prevent crashes when compiled libraries are unavailable
- Graceful fallbacks to alternative implementations when possible
- Clear error messages when specific features require unavailable dependencies

## Compatibility Status

### βœ… Working Features
- Basic client functionality (`from g4f.client import Client`)
- CLI commands (`g4f --help`, `g4f client --help`)
- Providers that use standard HTTP libraries
- Most text generation functionality

### ⚠️ Limited Features  
Some advanced features may have reduced functionality on aarch64:
- Providers requiring `curl_cffi` will fall back to `aiohttp`
- Browser automation features may not be available
- Some performance optimizations may not be active

### πŸ“‹ Requirements
For full functionality on aarch64, ensure you have:
```bash
# Basic requirements (should work on all architectures)
pip install -r requirements-min.txt

# Full requirements (some packages may need compilation on aarch64)
pip install -r requirements.txt
```

## Testing Your Installation

You can verify your installation works correctly:

```python
# Test basic import
from g4f.client import Client
client = Client()
print("βœ“ g4f imported successfully")

# Test CLI
import subprocess
result = subprocess.run(['g4f', '--help'], capture_output=True)
print("βœ“ CLI works" if result.returncode == 0 else "βœ— CLI issues")
```

## Known Issues

1. **Performance**: Some providers may have reduced performance due to fallback implementations
2. **Browser Features**: nodriver and webview functionality may not be available
3. **Image Processing**: Some image-related features may have compatibility issues

## Getting Help

If you encounter issues on aarch64:
1. First try with minimal requirements: `pip install -r requirements-min.txt`
2. Check if the issue persists with basic functionality
3. Report architecture-specific issues with your system details:
   - Architecture: `uname -m`
   - OS: `uname -a` 
   - Python version: `python --version`