A typed Python CLI that takes a question, calls a deployed LLM with proper auth, and streams the answer grounded in financial documents. Project 1 of 6 in a regulated-document AI platform — the same skeleton as repostat with one endpoint swap: the GitHub call replaced by an LLM call.
uv run askdocs "What is a debt-to-income ratio?" --provider anthropic
uv run askdocs "Summarize this loan application" --provider azure
Authentication follows the same pattern as repostat — secrets are read from environment variables, never hardcoded.
# .env
AZURE_ENDPOINT=https://your-foundry-project.services.ai.azure.com/openai/v1
AZURE_DEPLOYMENT=gpt-4o-mini
AZURE_TOKENS_MAX=1024 # optional, defaults to 1024
ANTHROPIC_API_KEY=your_key_here
ANTHROPIC_MODEL=claude-haiku-4-5-20251001 # optional, defaults to haiku
ANTHROPIC_TOKENS_MAX=1024 # optional, defaults to 1024
FILE_PATH=docs # directory containing .txt files to ground answers
Azure uses DefaultAzureCredential — run az login for local development. No raw API keys in Azure.
uv sync
az login
uv run askdocs --help
uv run pytest # run tests
uv run ruff check src # lint
uv run pyright src # type check
- openai — OpenAI-compatible client pointed at Azure AI Foundry
- azure-identity —
DefaultAzureCredentialfor keyless auth - anthropic — direct Anthropic SDK for multi-provider support
- typer — type-hint-driven CLI
- python-dotenv —
.envfile loading - pytest — testing with mocked model clients
- Calling an LLM SDK and printing a completion
DefaultAzureCredentialinstead of a raw API key- Streaming completions — tokens print as they are generated
- Lazy document chunking with
yield - Naive retrieval — keyword overlap used to ground answers in financial documents
- Multi-provider abstraction —
--provider azureand--provider anthropicthrough the same code path
| Project | What it adds |
|---|---|
| repostat | Python language fundamentals: CLI, REST, typed models, error handling, secrets, tests |
| askdocs | LLM SDK, streaming, naive RAG, multi-provider |
| agentcli | Tool-calling agents, memory, asyncio, MCP |
| ragservice | FastAPI, embeddings, vector + hybrid search, citations, PII handling |
| extractor | Document intelligence, vision, batch processing, structured validation |
| evalkit | Evals, observability, cost tracking, tracing, Docker |