{"id":21731774,"url":"https://github.com/evref-bl/pharo-llmapi","last_synced_at":"2025-03-20T23:43:16.991Z","repository":{"id":262838285,"uuid":"888519239","full_name":"Evref-BL/Pharo-LLMAPI","owner":"Evref-BL","description":"Use LLM API from Pharo","archived":false,"fork":false,"pushed_at":"2025-02-10T14:35:42.000Z","size":153,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T15:32:53.359Z","etag":null,"topics":["llm","pharo"],"latest_commit_sha":null,"homepage":"","language":"Smalltalk","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/Evref-BL.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":"2024-11-14T14:39:03.000Z","updated_at":"2025-02-10T14:35:46.000Z","dependencies_parsed_at":"2025-02-10T15:36:33.794Z","dependency_job_id":null,"html_url":"https://github.com/Evref-BL/Pharo-LLMAPI","commit_stats":null,"previous_names":["evref-bl/pharo-llmapi"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evref-BL%2FPharo-LLMAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evref-BL%2FPharo-LLMAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evref-BL%2FPharo-LLMAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evref-BL%2FPharo-LLMAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Evref-BL","download_url":"https://codeload.github.com/Evref-BL/Pharo-LLMAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244711938,"owners_count":20497417,"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","pharo"],"created_at":"2024-11-26T04:27:21.542Z","updated_at":"2025-03-20T23:43:16.969Z","avatar_url":"https://github.com/Evref-BL.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pharo LLM API\n\n## Installation\n\n```st\nMetacello new\n  githubUser: 'Evref-BL' project: 'Pharo-LLMAPI' commitish: 'main' path: 'src';\n  baseline: 'LLMAPI';\n  load\n```\n\n## Example\n\n### For the chat\n\n```st\napi := LLMAPI chat.\napi host: 'api.mistral.ai'.\napi apiKey: '\u003capiKey\u003e'.\n\napi payload\n\ttemperature: 0.5;\n\tmodel: 'mistral-small-latest';\n\ttop_p: 1;\n\tmax_tokens: 250;\n\tmessages: {\n\t\tLLMAPIChatObjectMessage role: 'system' content: 'You are a usefull assistant'.\n\t\tLLMAPIChatObjectMessage role: 'user' content: 'How to write hello world in Pharo?'.\n\t\t }.\n\nresult := api performRequest.\n```\n\n#### Using tools (function call)\n\nYou can also create code that will be called by the LLM.\nIt is named function call or function tool.\n\n```st\napi := LLMAPI chat.\napi host: 'api.mistral.ai'.\n\napi payload\n\ttemperature: 0.5;\n\tmodel: 'mistral-small-latest';\n\ttop_p: 1;\n\tmax_tokens: 250;\n\ttools: { (LLMAPIChatObjectToolCountClasses new) };\n\tmessages: {\n\t\t\t(LLMAPIChatObjectMessage\n\t\t\t\t role: 'system'\n\t\t\t\t content: 'You are a usefull assistant').\n\t\t\t(LLMAPIChatObjectMessage\n\t\t\t\t role: 'user'\n\t\t\t\t content: 'What is the number of classes in my computer ? ') }.\n\nresult := api performRequest.\n\n```\n\n### For the FIM\n\n```st\napi := LLMAPI fim.\napi host: 'api.mistral.ai'.\napi apiKey: '\u003capiKey\u003e'.\n\napi payload\n\ttemperature: 0.2;\n\tmodel: 'codestral-2405';\n\ttop_p: 1;\n\tmax_tokens: 250;\n\tprompt: 'def';\n\tsuffix: 'return a + b'.\nresult := api performRequest.\n```\n\n## UI\n\nThis project also includes a simple UI. Feel free to use it, improve it, and contribute.\n\nOpen it with:\n\n```st\nLLMAPISpec open\n```\n\n![alt text](doc/image.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevref-bl%2Fpharo-llmapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevref-bl%2Fpharo-llmapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevref-bl%2Fpharo-llmapi/lists"}