Skip to content

Leanllm 0.1.0

Choose a tag to compare

@hargup hargup released this 14 Oct 05:29
· 13 commits to main since this release

Initial release of leanllm (v0.1.0), a unified LLM client library for Lean 4 built on LeanHttp (v0.6.0).

Highlights

  • Four Orthogonal Axes (Model × Provider × WireApi × AuthMode):
    • 10 Model Families: ClaudeModel, OpenAIModel, GeminiModel, DeepSeekModel, KimiModel, GlmModel, QwenModel, MiniMaxModel, GrokModel, and MistralModel.
    • Providers: .direct, .openRouter, .bedrock, .azure, .vertex, .copilot, .antigravity, .grokBuild, .kimiCode, .zaiCoding, .alibabaCoding, .opencodeZen, .opencodeGo, .groq, .cerebras, .together, .fireworks, .deepinfra, .novita, .baseten, .nebius, .nvidiaNim, .ollama, .lmstudio, and .custom.
    • 6 Wire Dialects: .anthropicMessages, .openaiChat, .openaiResponses, .geminiGenerate, .bedrockConverse, and .bedrockInvoke.
  • Subscription OAuth & Cross-Tool Credential Reuse (Leanllm.Auth):
    • Reuses and proactively refreshes local subscription OAuth sessions from Claude Code (~/.claude/.credentials.json, macOS Keychain, $CLAUDE_CODE_OAUTH_TOKEN), OpenAI Codex (~/.codex/auth.json), Gemini CLI (~/.gemini/oauth_creds.json), Antigravity, GitHub Copilot (~/.config/github-copilot/hosts.json), Grok CLI (~/.grok/auth.json), jcode (~/.jcode/), OpenCode, Pi, OpenClaw, and Hermes.
    • Pure Lean Base64URL + JWT claim decoding (exp, client_id, aud, azp, chatgpt_account_id) with zero hardcoded OAuth client IDs.
  • Monadic Interface (LLMM) & SSE Streaming:
    • ReaderT LLMContext (ExceptT LLMError IO) with automatic LeanHttp.Session reuse and scoped combinators (LLMM.withProvider, LLMM.withWireApi, LLMM.withModel, LLMM.withAuth).
    • Synchronous (call, completion, ask) and incremental Server-Sent Events streaming (callStream, completionStream, askStream) with multimodal images, tool calling, and reasoning/thinking blocks.