{"id":23714915,"url":"https://github.com/teilomillet/operatio","last_synced_at":"2026-01-27T14:31:13.199Z","repository":{"id":258215670,"uuid":"872859832","full_name":"teilomillet/operatio","owner":"teilomillet","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-16T13:58:55.000Z","size":2572,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T20:51:54.519Z","etag":null,"topics":["llm","merging","mojo","task-arithmetic"],"latest_commit_sha":null,"homepage":"","language":"Mojo","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teilomillet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-15T07:44:22.000Z","updated_at":"2024-10-16T19:54:19.000Z","dependencies_parsed_at":"2024-10-18T02:57:14.520Z","dependency_job_id":null,"html_url":"https://github.com/teilomillet/operatio","commit_stats":null,"previous_names":["teilomillet/operatio"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teilomillet%2Foperatio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teilomillet%2Foperatio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teilomillet%2Foperatio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teilomillet%2Foperatio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teilomillet","download_url":"https://codeload.github.com/teilomillet/operatio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239803456,"owners_count":19699677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llm","merging","mojo","task-arithmetic"],"created_at":"2024-12-30T20:51:35.366Z","updated_at":"2026-01-27T14:31:08.180Z","avatar_url":"https://github.com/teilomillet.png","language":"Mojo","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Operatio\n\n![Operatio](img/operatio-logo.svg)\n\nOperatio is a tool for manipulating language models using task vectors. It's designed to help me learned about the underlying of the task arithmetic and about the mojo lang, it's also a tool to explore large language models through weight manipulation. I might try to implement the papers in the pdf/.\n\n## What are Task Vectors?\n\nTask vectors are the difference between the weights of a base model and a fine-tuned model. They capture the \"knowledge\" or \"skills\" that a model has acquired for a specific task during fine-tuning. By manipulating these task vectors, we can potentially transfer (or suppress) skills between models or create models with combined capabilities.\n\n## What Operatio Does\n\nOperatio provides a suite of operations for working with language models and task vectors:\n\n1. **Load Models**: Efficiently load and save model weights.\n2. **Extract Difference**: Compute the task vector by finding the difference between a base model and a fine-tuned model.\n3. **Transform Model**: Apply a task vector to a base model, potentially transferring skills or knowledge.\n4. **Full Pipeline**: Perform all of the above operations in sequence.\n\n## Installation\n\nI used `magic` from modular so I recommand using it too. After having clone this github, simply use `magic install` then `magic shell` and you can use the following commands.\n\n## Usage\n\nOperatio has a command-line tool with several operations:\n\n```bash\nmojo run main.mojo \u003coperation\u003e \u003cbase_model\u003e [\u003cft_model\u003e] [--output_dir \u003cdir\u003e] [--scaling_coef \u003ccoef\u003e]\n```\n\n## Operations:\n\n- load: Load and save model weights\n- extract: Compute the task vector\n- transform: Apply a task vector to a model\n- full: Run the complete pipeline\n\n## Arguments:\n\n- `\u003coperation\u003e`: The operation to perform (load, extract, transform, or full)\n- `\u003cbase_model\u003e`: Path or identifier for the base model\n- `\u003cft_model\u003e`: Path or identifier for the fine-tuned model (required for extract and full operations)\n- `--output_dir`: Directory to save output files (default: \"models\")\n- `--scaling_coef`: Scaling coefficient for the task vector (default: 0.5)\n\n## Examples:\n\nLoad models:\n```bash\nmojo run main.mojo load path/to/base/model path/to/finetuned/model\n```\n\nExtract task vector:\n```bash\nmojo run main.mojo extract path/to/base/model path/to/finetuned/model\n``` \n\nTransform a model:\n```bash\nmojo run main.mojo transform path/to/base/model --scaling_coef 0.7\n```\n\nRun full pipeline:\n```bash\nmojo run main.mojo full path/to/base/model path/to/finetuned/model --scaling_coef 0.7\n```\n\n## License\n\nThis project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteilomillet%2Foperatio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteilomillet%2Foperatio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteilomillet%2Foperatio/lists"}