{"id":35169971,"url":"https://github.com/docker/model-test","last_synced_at":"2025-12-28T20:06:30.087Z","repository":{"id":296869717,"uuid":"994752502","full_name":"docker/model-test","owner":"docker","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-14T20:40:57.000Z","size":88,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-24T10:57:24.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/docker.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-02T12:32:35.000Z","updated_at":"2025-12-22T16:19:20.000Z","dependencies_parsed_at":"2025-06-03T08:49:53.188Z","dependency_job_id":null,"html_url":"https://github.com/docker/model-test","commit_stats":null,"previous_names":["ilopezluna/model-test","docker/model-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/docker/model-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fmodel-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fmodel-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fmodel-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fmodel-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docker","download_url":"https://codeload.github.com/docker/model-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fmodel-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28103425,"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-12-28T02:00:05.685Z","response_time":62,"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-12-28T20:05:21.989Z","updated_at":"2025-12-28T20:06:30.080Z","avatar_url":"https://github.com/docker.png","language":"Go","readme":"# Agent Loop Tool Efficiency Test\n\nA Go application for testing AI models with function calling using an agent loop architecture. Tests tool calling\nefficiency, cart management scenarios, and provides detailed performance metrics.\n\n## Quick Start\n\n```bash\n# Clone and setup\ngit clone https://github.com/ilopezluna/model-test\ncd model-test\n\n# Run with default model\nmake run\n\n# Run with specific model\nmake run MODEL=\"ai/llama3.2\"\n\n# Run single test case\nmake run TEST_CASE=\"simple_view_cart\" MODEL=\"ai/gemma3\"\n```\n\n## Command Line Usage\n\n### Basic Usage\n\n```bash\n# Run all test cases with default model (gpt-4o-mini)\n./model-test\n\n# Run with specific model\n./model-test --model \"ai/qwen2.5\"\n\n# Run single test case\n./model-test --test-case \"simple_view_cart\"\n\n# Custom API settings\n./model-test --model \"gpt-4\" --base-url \"https://api.openai.com/v1\" --api-key \"your-key\"\n```\n\n### Command Line Flags\n\n```\n  -api-key string\n        OpenAI API key (or set OPENAI_API_KEY env var) (default \"DMR\")\n  -base-url string\n        OpenAI API base URL (or set OPENAI_BASE_URL env var) (default \"http://localhost:13434\")\n  -config string\n        Path to test cases configuration file (default \"config/test_cases.json\")\n  -model string\n        Model to use (or set OPENAI_MODEL env var, defaults to gpt-4o-mini)\n  -test-case string\n        Run only the specified test case by name\n```\n\n### Environment Variables\n\n```bash\nexport OPENAI_API_KEY=\"your-api-key\"\nexport OPENAI_BASE_URL=\"https://api.openai.com/v1\"\nexport OPENAI_MODEL=\"gpt-4\"\n```\n\n## Make Commands\n\n### Basic Commands\n\n```bash\n# Run commands\nmake run                                    # Run with default values\nmake run MODEL=\"gpt-4\"                     # Run with specific model\nmake run TEST_CASE=\"simple_view_cart\"      # Run specific test case\nmake run MODEL=\"gpt-4\" TEST_CASE=\"cart\"    # Run with multiple parameters\n\n# Test commands\nmake test                                  # Test all models\nmake test MODELS=\"gpt-4,claude-3\"          # Test specific models\nmake test TEST_CASE=\"simple_view_cart\"     # Test specific case\nmake test MODELS=\"gpt-4\" TEST_CASE=\"cart\"  # Test specific model and case\n\n# Utility commands\nmake list-tests                            # List available test cases\nmake help                                  # Show all available commands\n```\n\n### Development Commands\n\n```bash\nmake build          # Build the application\nmake clean          # Clean build artifacts and results\n```\n\n## Test Cases\n\nThe application includes 18 test cases covering:\n\n- **Zero Tool Cases**: Greetings, general questions (no tools expected)\n- **Simple Cases**: Single tool operations (search, add, view, remove, checkout)\n- **Medium Cases**: Two-step operations (search then add, remove then add)\n- **Complex Cases**: Multi-step workflows with cart management\n\n### Example Test Cases\n\n- `zero_greeting` - Simple greeting (no tools)\n- `simple_search_electronics` - Search for electronics\n- `simple_add_iphone` - Add iPhone to cart\n- `medium_search_and_add` - Search and add to cart\n- `complex_cart_management` - Multi-step cart organization (with initial cart state)\n\n## Output and Results\n\n### Result Files\n\nResults are saved to `results/` directory with format:\n\n```\nagent_test_results_\u003cmodel\u003e_\u003ctimestamp\u003e.json\n```\n\nExamples:\n\n- `agent_test_results_gpt-4_20250603_112616.json`\n- `agent_test_results_ai_llama3.2_20250603_112623.json`\n- `agent_test_results_gpt-4o-mini_20250603_112630.json`\n\n### Performance Metrics\n\n```\n📈 Agent Test Results\n==================================================\nTotal Tests: 18\n✅ Passed: 15\n❌ Failed: 3\n⏱️  Total LLM Time: 12.4s\n⏱️  Average Time per Request: 1.2s\n📊 Overall Success Rate: 83.33%\n```\n\n### Key Metrics\n\n- **Total LLM Time**: Time spent in actual LLM requests (excludes framework overhead)\n- **Average Time per Request**: Per individual LLM API call (not per test)\n- **Tool Call Accuracy**: Matches expected tool calling patterns\n- **Success Rate**: Percentage of tests that matched expected behavior\n\n## Configuration\n\n### Test Case Structure\n\n```json\n{\n  \"name\": \"complex_cart_management\",\n  \"prompt\": \"Help me organize my shopping cart...\",\n  \"initial_cart_state\": {\n    \"items\": [\n      {\n        \"product_name\": \"iPhone\",\n        \"quantity\": 2\n      },\n      {\n        \"product_name\": \"Wireless Headphones\",\n        \"quantity\": 1\n      }\n    ]\n  },\n  \"expected_tools_variants\": [\n    \n  ]\n}\n```\n\n### Available Tools\n\n- `search_products` - Search by query, category, or both\n- `add_to_cart` - Add products with quantity\n- `remove_from_cart` - Remove products from cart\n- `view_cart` - View cart contents and totals\n- `checkout` - Process checkout\n\n## Requirements\n\n- **Go**: 1.19+\n- **Local AI Server**: Docker Model Runner or Ollama\n- **OR OpenAI API**: With valid API key\n\n### Adding New Test Cases\n\n1. Add test case to `config/test_cases.json`\n2. Define expected tool call variants\n3. Optionally specify initial cart state\n4. Run with `make run TEST_CASE=\"your_test_name\"`\n\n### Model Comparison\n\n```bash\n# Test multiple models\nmake test MODELS=\"gpt-4,gpt-4o-mini,ai/llama3.2\"\n\n# Or test them individually\nmake run MODEL=\"gpt-4\"\nmake run MODEL=\"gpt-4o-mini\"\nmake run MODEL=\"ai/llama3.2\"\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Fmodel-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocker%2Fmodel-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Fmodel-test/lists"}