{"id":30904482,"url":"https://github.com/aygp-dr/scheme-llm-toolkit","last_synced_at":"2026-02-14T15:03:42.408Z","repository":{"id":307904200,"uuid":"1031040140","full_name":"aygp-dr/scheme-llm-toolkit","owner":"aygp-dr","description":"Composable Guile Scheme library for LLM integration featuring functional APIs, type-safe bindings, and meta-programming support for AI-powered development","archived":false,"fork":false,"pushed_at":"2025-12-23T05:21:43.000Z","size":2146,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T16:01:28.300Z","etag":null,"topics":["functional-programming","guile","llm","scheme"],"latest_commit_sha":null,"homepage":null,"language":"Scheme","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/aygp-dr.png","metadata":{"files":{"readme":"README.org","changelog":"CHANGELOG.md","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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-08-02T21:54:38.000Z","updated_at":"2025-12-23T05:21:47.000Z","dependencies_parsed_at":"2025-08-02T23:35:45.521Z","dependency_job_id":"3454ce7d-0156-432b-868d-1555c4bbc51b","html_url":"https://github.com/aygp-dr/scheme-llm-toolkit","commit_stats":null,"previous_names":["aygp-dr/scheme-llm-toolkit"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aygp-dr/scheme-llm-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscheme-llm-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscheme-llm-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscheme-llm-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscheme-llm-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aygp-dr","download_url":"https://codeload.github.com/aygp-dr/scheme-llm-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscheme-llm-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29447768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T14:10:32.461Z","status":"ssl_error","status_checked_at":"2026-02-14T14:09:49.945Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["functional-programming","guile","llm","scheme"],"created_at":"2025-09-09T09:32:13.626Z","updated_at":"2026-02-14T15:03:42.401Z","avatar_url":"https://github.com/aygp-dr.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: Guile Scheme LLM Integration Toolkit  \n#+AUTHOR: aygp-dr\n#+DATE: 2025-08-02\n#+PROPERTY: header-args:scheme :session *guile* :results output :exports both\n\n[[https://github.com/aygp-dr/scheme-llm-toolkit][https://img.shields.io/badge/Guile-Scheme-blue.svg]]\n[[https://github.com/aygp-dr/scheme-llm-toolkit/blob/main/LICENSE][https://img.shields.io/badge/License-MIT-green.svg]]\n[[https://github.com/aygp-dr/scheme-llm-toolkit/issues][https://img.shields.io/github/issues/aygp-dr/scheme-llm-toolkit.svg]]\n\n* Guile Scheme LLM Integration Toolkit\n\nA powerful Guile Scheme library for integrating Large Language Models into functional programming workflows, emphasizing composability and type safety.\n\n** Overview\n\nThis toolkit provides idiomatic Scheme interfaces for LLM integration:\n\n- Composable prompt construction using S-expressions\n- Type-safe API bindings for multiple LLM providers\n- Functional streaming and batch processing\n- Integration with existing Scheme AI frameworks\n- Meta-programming support for code generation\n\n** Intersections with Existing Projects\n\n- *ollama-topic-forge*: Provides the foundational LLM integration patterns\n- *pseudo-llm-macro*: Macro system for LLM-powered code generation\n- *aibrainrot-zeddev*: Development environment integration examples\n- *multi-framework-agent-lab*: Agent framework comparison and analysis\n\n** Features\n\n*** Functional LLM Interface\n#+BEGIN_SRC scheme\n;; Composable prompt construction\n(define-prompt weather-query\n  `(system \"You are a helpful weather assistant.\")\n  `(user ,(format #f \"What's the weather like in ~a?\" city)))\n\n;; Streaming responses with functional processing\n(llm-stream (ollama \"llama2\")\n            (weather-query \"Boston\")\n            #:on-token (λ (token) (display token))\n            #:on-complete (λ (response) (process-weather response)))\n#+END_SRC\n\n*** Type-Safe API Bindings\n#+BEGIN_SRC scheme\n;; Provider abstraction with consistent interface\n(define-provider openai\n  #:api-key (getenv \"OPENAI_API_KEY\")\n  #:model \"gpt-4\"\n  #:max-tokens 1000)\n\n(define-provider ollama  \n  #:base-url \"http://localhost:11434\"\n  #:model \"llama2\")\n\n;; Unified interface across providers\n(llm-complete provider prompt #:temperature 0.7)\n#+END_SRC\n\n*** Meta-Programming Integration  \n#+BEGIN_SRC scheme\n;; LLM-powered macro expansion\n(define-syntax llm-generate\n  (syntax-rules ()\n    ((llm-generate description)\n     (let ((code (llm-complete ollama-code-model description)))\n       (eval-string code)))))\n\n;; Usage: Generate code at compile-time\n(llm-generate \"Create a function that calculates fibonacci numbers\")\n#+END_SRC\n\n** Architecture\n\nThe toolkit is organized into composable modules:\n\n- ~(llm core)~ :: Core LLM abstraction layer\n- ~(llm providers)~ :: Provider-specific implementations\n- ~(llm streaming)~ :: Functional streaming interfaces  \n- ~(llm prompts)~ :: Prompt construction DSL\n- ~(llm types)~ :: Type definitions and contracts\n- ~(llm agents)~ :: Multi-agent conversation patterns\n\n** Provider Support\n\n*** Currently Supported\n- *Ollama*: Local model hosting with full feature support\n- *OpenAI*: GPT-3.5/GPT-4 with streaming and function calling\n- *Anthropic*: Claude models with conversation management\n- *Hugging Face*: Transformers library integration\n\n*** Planned Support\n- *Google Gemini*: Multimodal capabilities\n- *Mistral AI*: European AI provider\n- *Local Models*: Direct transformers.scm integration\n\n** Usage Examples\n\n*** Basic Completion\n#+BEGIN_SRC scheme\n(use-modules (llm core) (llm providers ollama))\n\n(define response\n  (llm-complete (make-ollama #:model \"llama2\")\n                \"Explain recursion in Scheme\"))\n\n(display response)\n#+END_SRC\n\n*** Conversation Management\n#+BEGIN_SRC scheme\n(use-modules (llm conversation))\n\n(define chat (make-conversation))\n\n(conversation-add! chat 'user \"Hello, I'm learning Scheme\")\n(conversation-add! chat 'assistant \n  (llm-complete provider (conversation-\u003eprompt chat)))\n\n(conversation-add! chat 'user \"Can you explain macros?\")\n(define response \n  (llm-complete provider (conversation-\u003eprompt chat)))\n#+END_SRC\n\n*** Function Calling\n#+BEGIN_SRC scheme\n(use-modules (llm functions))\n\n(define-llm-function get-weather\n  \"Get current weather for a city\"\n  ((city string? \"The city name\")))\n\n(define tools (list get-weather))\n\n(llm-complete-with-tools provider\n                         \"What's the weather in Boston?\"\n                         tools)\n#+END_SRC\n\n** Quick Start\n\n#+BEGIN_SRC bash\n# Clone and setup\ngit clone https://github.com/aygp-dr/scheme-llm-toolkit.git\ncd scheme-llm-toolkit\n\n# Check dependencies (all core functionality tested)\nmake install-guile-deps\n\n# Run dependency check\nguile3 experiments/000-deps-check/check.scm\n\n# Test JSON functionality\nguile3 -L src experiments/001-json-test/test-json.scm\n\n# Set up provider configurations (optional)\ncp config/providers.example.scm config/providers.scm\n# Edit config/providers.scm with your API keys for external providers\n#+END_SRC\n\n*** System Requirements\n- Guile 3.0+ (tested on 3.0.10)\n- guile-json (install manually if auto-install fails)\n- curl or wget (for HTTP requests)\n- Optional: Ollama (for local LLM testing)\n\n*** FreeBSD Installation Notes\n#+BEGIN_SRC bash\n# Install dependencies\npkg install guile3 guile-json curl\n\n# The toolkit uses guile3 shebang for FreeBSD compatibility\n#+END_SRC\n\n** Configuration\n\n#+BEGIN_SRC scheme\n;; config/providers.scm\n(define-module (config providers))\n\n(define ollama-config\n  `((base-url . \"http://localhost:11434\")\n    (models . (\"llama2\" \"codellama\" \"mistral\"))))\n\n(define openai-config\n  `((api-key . ,(getenv \"OPENAI_API_KEY\"))\n    (organization . ,(getenv \"OPENAI_ORG\"))\n    (models . (\"gpt-4\" \"gpt-3.5-turbo\"))))\n#+END_SRC\n\n** License\n\nMIT License - Functional LLM integration for the Scheme ecosystem.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Fscheme-llm-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faygp-dr%2Fscheme-llm-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Fscheme-llm-toolkit/lists"}