{"id":22051293,"url":"https://github.com/capevace/llm-magic","last_synced_at":"2025-10-11T11:31:52.036Z","repository":{"id":265583406,"uuid":"896279821","full_name":"Capevace/llm-magic","owner":"Capevace","description":"LLM-agnostic AI toolkit for Laravel","archived":false,"fork":false,"pushed_at":"2025-09-20T15:20:06.000Z","size":327,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-11T11:19:55.019Z","etag":null,"topics":["ai","anthropic","developer-productivity","gemini","gpt-4","laravel","laravel-package","llm","openai","php","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Capevace.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-11-30T00:16:30.000Z","updated_at":"2025-09-11T09:33:05.000Z","dependencies_parsed_at":"2024-11-30T02:27:35.799Z","dependency_job_id":"79506828-6b1a-4354-9e0b-36d6742aaea7","html_url":"https://github.com/Capevace/llm-magic","commit_stats":null,"previous_names":["capevace/llm-magic"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Capevace/llm-magic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Capevace%2Fllm-magic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Capevace%2Fllm-magic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Capevace%2Fllm-magic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Capevace%2Fllm-magic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Capevace","download_url":"https://codeload.github.com/Capevace/llm-magic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Capevace%2Fllm-magic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007031,"owners_count":26084227,"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-10-11T02:00:06.511Z","response_time":55,"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":["ai","anthropic","developer-productivity","gemini","gpt-4","laravel","laravel-package","llm","openai","php","php-library"],"created_at":"2024-11-30T15:08:30.865Z","updated_at":"2025-10-11T11:31:52.031Z","avatar_url":"https://github.com/Capevace.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@mateffy/llm-magic`\n\n\u003e [!NOTE]\n\u003e This project is still in development and not yet publicly released. API will change!\n\nA PHP SDK to do magical things with LLMs using just a few lines of code.\nAlso enables developer-friendly extraction of structured and validated JSON data from files such as PDFs, Word documents, and images.\n\n```php\nuse Mateffy\\Magic;\nuse Mateffy\\Magic\\Chat\\Messages\\Step;\nuse Mateffy\\Magic\\Chat\\Tool;\n\n$answer = Magic::ask('What is the capital of France?');\n// -\u003e \"The capital of France is Paris.\"\n\n$messages = Magic::chat()\n    -\u003emodel('google/gemini-2.0-flash-lite')\n    -\u003etemperature(0.5)\n    -\u003emessages([\n        Step::user([\n            Step\\Text::make('What is in this picture and where was it taken?'),\n            Step\\Image::make('https://example.com/eiffel-tower.jpg'),\n        ]),\n        Step::assistant([\n            Step\\Text::make('The picture shows the Eiffel Tower, which is located in Paris, France.'),\n        ]),\n        Step::user('How much is a flight to Paris?'),\n    ])\n    -\u003etools([\n        Tool::make('search_flight')\n            -\u003edescription('Search for flights to a given destination. Pass the departure airport code and the destination airport code in the ISO 3166-1 alpha-3 format.')\n            -\u003ecallback(fn (string $from_airport_code, string $to_airport_code) {\n                return app(FlightService::class)\n                    -\u003esearch($from_airport_code, $to_airport_code)\n                    -\u003etoArray();\n            }),\n    ]);\n])\n\n$answer = Magic::chat()\n    -\u003emodel('google/gemini-2.0-flash-lite')\n    -\u003eprompt('What is the capital of France?')\n    -\u003estream()\n    -\u003etext();\n    \n$data = Magic::extract()\n    -\u003eschema([\n        'type' =\u003e 'object',\n        'properties' =\u003e [\n            'name' =\u003e ['type' =\u003e 'string'],\n            'age' =\u003e ['type' =\u003e 'integer'],\n        ],\n        'required' =\u003e ['name', 'age'],\n    ])\n    -\u003eartifacts([$artifact])\n    -\u003esend();\n```\n\n\n### Copyright and License\n\nThis project is made by [Lukas Mateffy](https://mateffy.me) and is licensed under the [GNU Affero General Public License v3.0 (AGPL-3.0)](https://choosealicense.com/licenses/agpl-3.0/).\n\nFor commercial licensing, please drop me an email at [hey@mateffy.me](mailto:hey@mateffy.me).\n\n### Contributing\n\nAt the moment, this project is not yet open for contributions, as I am in the process of writing a thesis about it. After that is done, and the published version is tagged, I may open it up for contributions, if there is interest.\n\nHowever, if you have ideas, bugs or suggestions, feel free to open an issue or start a discussion anyway! Feedback is always welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapevace%2Fllm-magic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapevace%2Fllm-magic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapevace%2Fllm-magic/lists"}