{"id":26283330,"url":"https://github.com/fless-lab/agnassan","last_synced_at":"2025-08-07T02:13:56.349Z","repository":{"id":282029504,"uuid":"945911870","full_name":"fless-lab/agnassan","owner":"fless-lab","description":"The most advanced MLLM (Multi Large Language Model)","archived":false,"fork":false,"pushed_at":"2025-03-19T15:56:29.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T16:40:42.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fless-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-10T10:17:58.000Z","updated_at":"2025-03-19T15:56:32.000Z","dependencies_parsed_at":"2025-03-12T12:43:45.479Z","dependency_job_id":null,"html_url":"https://github.com/fless-lab/agnassan","commit_stats":null,"previous_names":["fless-lab/agnassan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fless-lab/agnassan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fless-lab%2Fagnassan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fless-lab%2Fagnassan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fless-lab%2Fagnassan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fless-lab%2Fagnassan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fless-lab","download_url":"https://codeload.github.com/fless-lab/agnassan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fless-lab%2Fagnassan/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269185726,"owners_count":24374634,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-03-14T17:18:06.091Z","updated_at":"2025-08-07T02:13:56.329Z","avatar_url":"https://github.com/fless-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agnassan: Advanced AI Orchestration System\n\nAgnassan is a powerful AI orchestration system that leverages multiple open-source models with sophisticated reasoning techniques to provide enhanced problem-solving capabilities.\n\n## Key Features\n\n### Advanced Reasoning Techniques\n\nAgnassan implements several advanced reasoning techniques:\n\n1. **Chain of Thought (CoT)** - Breaks down complex problems into sequential steps, making the reasoning process explicit and easier to follow.\n\n2. **Tree of Thought (ToT)** - Explores multiple reasoning paths simultaneously and selects the most promising one, allowing for more comprehensive problem-solving.\n\n3. **Parallel Thought Chains** - Applies multiple reasoning techniques in parallel and synthesizes their results, leveraging different cognitive approaches for more robust solutions.\n\n4. **Iterative Loops** - Applies a sequence of different reasoning techniques iteratively, with each technique building upon the results of the previous one, creating increasingly refined answers.\n\n5. **ReAct (Reasoning + Acting)** - Combines reasoning with the ability to take actions, enabling more interactive and dynamic problem-solving capabilities.\n\n6. **Meta-Critique** - Critically evaluates and improves the initial response, leading to more accurate and well-considered answers.\n\n### Model Integration\n\nAgnassan supports a wide range of models:\n\n- **Open-source models**: Mistral-7B, Phi-2, Llama-3-8B, Gemma-7B, MPT-7B\n- **Commercial models**: GPT-4o, Claude-3-Opus (optional)\n\n### Intelligent Routing\n\nThe system includes an intelligent routing mechanism that:\n\n1. Analyzes queries to determine the most appropriate model(s) and reasoning technique\n2. Supports parallel execution across multiple models\n3. Dynamically selects the best reasoning approach based on the query type\n\n## Installation\n\n```bash\npip install -r requirements.txt\n```\n\n## Using Models from Hugging Face API\n\nAgnassan supports using models directly from the Hugging Face API. Here's how to configure and use them:\n\n```python\nfrom agnassan.config import ModelConfig\nfrom agnassan.models import create_model_interface\nimport asyncio\n\n# Configure a Hugging Face model\nconfig = ModelConfig(\n    name=\"gpt2\",  # You can use any model available on Hugging Face\n    provider=\"huggingface\",\n    api_key_env=\"HUGGINGFACE_API_KEY\",  # Set this environment variable\n    parameters={\n        \"model\": \"gpt2\",\n        \"temperature\": 0.7,\n        \"max_tokens\": 100\n    },\n    strengths=[\"general_knowledge\", \"creative\"]\n)\n\n# Create the model interface\nmodel = create_model_interface(config)\n\n# Generate text\nasync def generate_text():\n    prompt = \"Once upon a time\"\n    response = await model.generate(prompt)\n    print(f\"Generated text: {response.text}\")\n    print(f\"Tokens used: {response.tokens_used}\")\n\n# Run the async function\nasyncio.run(generate_text())\n```\n\n## Downloading and Using Local Models\n\nFor better performance and to avoid API costs, you can download models and use them locally:\n\n```python\nfrom agnassan.config import ModelConfig\nfrom agnassan.models import create_model_interface\nimport asyncio\nfrom pathlib import Path\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\n# Function to download a model\ndef download_model(model_name, save_path):\n    # Create directory if it doesn't exist\n    save_path.mkdir(parents=True, exist_ok=True)\n    \n    # Download model and tokenizer\n    print(f\"Downloading {model_name} to {save_path}...\")\n    tokenizer = AutoTokenizer.from_pretrained(model_name)\n    model = AutoModelForCausalLM.from_pretrained(model_name)\n    \n    # Save to local directory\n    tokenizer.save_pretrained(save_path)\n    model.save_pretrained(save_path)\n    print(f\"Model {model_name} downloaded successfully!\")\n\n# Download a model (only needs to be done once)\nmodel_name = \"gpt2\"  # You can use any model from Hugging Face\nsave_path = Path(\"./models/gpt2\")\n\nif not save_path.exists():\n    download_model(model_name, save_path)\n\n# Configure the local model\nconfig = ModelConfig(\n    name=\"local-gpt2\",\n    provider=\"local\",\n    parameters={\n        \"model_path\": str(save_path),\n        \"temperature\": 0.7,\n        \"max_tokens\": 100\n    },\n    strengths=[\"general_knowledge\", \"creative\"]\n)\n\n# Create the model interface\nmodel = create_model_interface(config)\n\n# Generate text\nasync def generate_text():\n    prompt = \"The future of AI is\"\n    response = await model.generate(prompt)\n    print(f\"Generated text: {response.text}\")\n    print(f\"Tokens used: {response.tokens_used}\")\n\n# Run the async function\nasyncio.run(generate_text())\n```\n\n## Supported Model Providers\n\nAgnassan supports the following model providers:\n\n- **OpenAI**: GPT models (requires `openai` package)\n- **Anthropic**: Claude models (requires `anthropic` package)\n- **Hugging Face**: Any model on Hugging Face Hub (requires `huggingface_hub` package)\n- **Cohere**: Cohere models (requires `cohere` package)\n- **Grok**: Grok models (requires `aiohttp` package)\n- **Replicate**: Models hosted on Replicate (requires `replicate` package)\n- **Local**: Downloaded models (requires `transformers` and `torch` packages)\n\n## Configuration\n\nYou can configure multiple models in a YAML file:\n\n```yaml\nmodels:\n  - name: mistral-7b\n    provider: local\n    parameters:\n      model_path: ./models/mistral-7b\n      context_length: 4096\n      temperature: 0.7\n    strengths:\n      - general_knowledge\n      - coding\n    cost_per_token: 0.0\n  \n  - name: gpt-4o\n    provider: openai\n    api_key_env: OPENAI_API_KEY\n    parameters:\n      model: gpt-4o\n      temperature: 0.7\n      max_tokens: 4096\n    strengths:\n      - complex_reasoning\n      - creative\n      - coding\n    cost_per_token: 0.00001\n\ndefault_model: mistral-7b\nlog_dir: ./logs\nrouting_strategy: rule_based\n```\n\nLoad the configuration with:\n\n```python\nfrom agnassan.config import AgnassanConfig\n\nconfig = AgnassanConfig.from_yaml(\"config.yaml\")\n```\n\n## Running Tests\n\nTo run the tests that demonstrate how to use different model interfaces:\n\n```bash\npython -m tests.test_models\n```\n\nOr use pytest:\n\n```bash\npytest tests/test_models.py\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffless-lab%2Fagnassan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffless-lab%2Fagnassan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffless-lab%2Fagnassan/lists"}