Repository navigation
Leanllm 0.1.0
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, andMistralModel. - 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.
- 10 Model Families:
- 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.
- Reuses and proactively refreshes local subscription OAuth sessions from Claude Code (
- Monadic Interface (
LLMM) & SSE Streaming:ReaderT LLMContext (ExceptT LLMError IO)with automaticLeanHttp.Sessionreuse 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.