https://github.com/carlolepelaars/flocky
Simple (Unofficial) SDK for Flock.io
https://github.com/carlolepelaars/flocky
api flock huggingface llms web3
Last synced: 4 months ago
JSON representation
Simple (Unofficial) SDK for Flock.io
- Host: GitHub
- URL: https://github.com/carlolepelaars/flocky
- Owner: CarloLepelaars
- License: apache-2.0
- Created: 2025-03-28T16:17:41.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-01T15:36:36.000Z (about 1 year ago)
- Last Synced: 2025-04-01T15:54:56.507Z (about 1 year ago)
- Topics: api, flock, huggingface, llms, web3
- Language: Jupyter Notebook
- Homepage: https://carlolepelaars.github.io/flocky/
- Size: 380 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flocky
`flocky` makes participating in [Flock.io](https://www.flock.io) easy!
**NOTE:** This project is not officially affiliated with Flock.io. This
package is maintained by a participant of the Flock.io community. While
I strive for correctness, I cannot guarantee that this package is
bug-free. Always verify your own implementation, especially when using
`flocky` in production.
## Installation
pip install flocky
## Quickstart
### Get specific task
Data can be retrieved as JSON or a Pandas DataFrame.
``` python
from flocky.api import get_task
get_task(7, as_df=False)
```
{'title': 'FLock x OneKey: Advancing AI-Driven Smart Contract Security',
'description': 'FLock and OneKey are collaborating to launch the first AI-driven smart contract security challenge, combining FLock’s decentralized model training with OneKey’s expertise in blockchain security. By training AI on real-world vulnerabilities and security Q&A data, we aim to build a benchmark dataset and develop models capable of detecting and mitigating risks at scale. Top contributors will be rewarded with OneKey Hardware Wallet - FLock Limited Edition',
'task_type': 'training',
'data': {'training_set_url': 'https://fed-ledger-prod-dataset.s3.amazonaws.com/7/training_set.jsonl?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASSFQ745NLT5K57N2%2F20250401%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20250401T153446Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=fc9d7016681513e23a87fe9c30e5e7139ee53b76e3a8ef78a3cd02248d75494c',
'max_params': 15000000000,
'context_length': 8192},
'duration_in_seconds': 2419200,
'id': 7,
'status': 'submission_phase',
'initialized_at': '2025-03-26T16:22:01.791348',
'submission_phase_ends_at': '2025-04-23T23:59:59.791348',
'final_validation_ends_at': '2025-04-28T23:59:59.791348',
'final_link': None}
``` python
get_task(7, as_df=True)
```
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
| | title | description | task_type | duration_in_seconds | id | status | initialized_at | submission_phase_ends_at | final_validation_ends_at | final_link | data_training_set_url | data_max_params | data_context_length |
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
| 0 | FLock x OneKey: Advancing AI-Driven Smart Cont... | FLock and OneKey are collaborating to launch t... | training | 2419200 | 7 | submission_phase | 2025-03-26T16:22:01.791348 | 2025-04-23T23:59:59.791348 | 2025-04-28T23:59:59.791348 | None | https://fed-ledger-prod-dataset.s3.amazonaws.c... | 15000000000 | 8192 |
### Get open tasks
``` python
from flocky.api import open_tasks
tasks = open_tasks(as_df=True)
tasks
```
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
| | title | description | task_type | duration_in_seconds | id | status | initialized_at | submission_phase_ends_at | final_validation_ends_at | data_recommended_vram | data_dataset_s3_key | data_max_params | data_context_length | data_training_set_key | data_validation_set_key | data_final_validation_set_key |
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
| 0 | FLock x OneKey: Advancing AI-Driven Smart Cont... | FLock and OneKey are collaborating to launch t... | training | 2419200 | 7 | submission_phase | 2025-03-26T16:22:01.791348 | 2025-04-23T23:59:59.791348 | 2025-04-28T23:59:59.791348 | 48GB | onekey-security/combined.jsonl | 15000000000 | 8192 | 7/training_set.jsonl | 7/validation_set.jsonl | 7/final_validation_set.jsonl |
### Get submission scores
``` python
from flocky.api import get_subs
scores = get_subs(7, as_df=True)
scores
```
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
| | link | submission_phase_score | final_validation_score | submitted_at |
|----|----|----|----|----|
| 0 | https://huggingface.co/clepelaars/task-7-Qwen-... | None | None | 2025-03-28T12:45:21.402671 |
## Upload to HuggingFace
This function will upload the contents of the `outputs` directory to the
HuggingFace Hub with a given repo name. This require you to have set
`HF_TOKEN` in your environment variables.
``` python
from flocky.api import upload_to_hf
# upload_to_hf("clepelaars/flocky-test", output_dir="outputs")
```
## Contributing to Flocky
If you would like to contribute to Flocky, first of all thank you for
considering this! To get started feel free to create a Github issue so
we can discuss the contribution.
Please read the [contribution
guidelines](https://github.com/CarloLepelaars/flocky/blob/master/CONTRIBUTING.MD)
before submitting pull requests (PRs).