fastllm-claude-code
This FastLLM provider runs models through an authenticated Claude Code CLI using fastclaude. Ordinary streaming and non-streaming FastLLM calls work as with any provider. Client-owned tool loops do not: continuing after a tool call requires previous_response_id, because the paused turn lives in a running CLI process that a regular completions-style history replay cannot recreate.
Usage
Installation
Install latest from the GitHub repository:
$ pip install git+https://github.com/AnswerDotAI/fastllm-claude-code.git
or from conda
$ conda install -c AnswerDotAI fastllm_claude_code
or from pypi
$ pip install fastllm_claude_code
Documentation
Documentation can be found hosted on this GitHub repository’s pages. Additionally you can find package manager specific guidelines on conda and pypi respectively.
How to use
Installing the package registers the claude_code transport through FastLLM’s provider entry point. The Claude CLI must already be installed and authenticated for the current user.
A normal FastLLM call uses the provider prefix:
from fastllm.acomplete import acomplete
answer = await acomplete('Answer briefly: what is 2+2?', model='claude_code/claude-sonnet-5')
For a client-owned tool loop, pass standard Responses API or Chat Completions function schemas. Continuing after a tool call requires previous_response_id: it is not a regular completions turn, since replaying history cannot resume the paused process. The parameter is FastLLM’s standard continuation contract, shared with the Responses transport, but here the id names a paused local process rather than stored server state. A response containing tool calls has a response_id naming that process:
first = await acomplete(messages, model='claude_code/claude-sonnet-5', tools=tools)
assert first.tool_calls and first.response_id
assert not first.response_id_reusable
final = await acomplete(tool_result_messages, model='claude_code/claude-sonnet-5',
tools=tools, previous_response_id=first.response_id)
assert final.response_id is None
The continuation ID is opaque, one-shot, and process-local. It expires after response_ttl seconds (3600 by default), and claude_cancel(response_id) closes an abandoned paused process. Reusing an expired or consumed ID raises a 409 invalid_previous_response_id error. A terminal response deliberately has no ID; a later top-level turn should replay canonical history into a fresh Claude process.
Set stream=True for FastLLM’s normalized async stream. Non-streaming calls collect the same stream into one Completion. The adapter returns tool requests but never executes them.
Release files for fastllm-claude-code 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastllm_claude_code-0.0.10.tar.gz | 9.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastllm_claude_code-0.0.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.7 kB
Release files / fastllm_claude_code-0.0.10.tar.gz
| Download URL | fastllm_claude_code-0.0.10.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc352c2156a3a240638ab49b016c6cd269bbba347cd18befafe049a0d63e093d
|
|
BLAKE2b-256 checksum How to use checksums |
c05c442bf50ad2068603eacedcf431ecfda1426807b218b1cba5dfdb3f3a4529
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / fastllm_claude_code-0.0.10-py3-none-any.whl
| Download URL | fastllm_claude_code-0.0.10-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72677a7654d942daab7444090d504770427eb1c5bd09a5ef1ce4c6c5405bd3f4
|
|
BLAKE2b-256 checksum How to use checksums |
920cd6b867bb1abe5ae5b979c87079b29a5a4d705101dcd26df458e93d2882c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|