Skip to main content

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.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastllm-claude-code 0.0.12
File Size Uploaded
fastllm_claude_code-0.0.12.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastllm-claude-code 0.0.12
File Interpreter ABI Platform
fastllm_claude_code-0.0.12-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / fastllm_claude_code-0.0.12.tar.gz

Download URL fastllm_claude_code-0.0.12.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7c26898ebefe0dc4fa0e5113da911f40db3b07cd4d7c9fe1fb89e8674a3702e6
BLAKE2b-256 checksum
How to use checksums
028aaf2bf6030aad0e50c3a61d062039db2629933921d1f653392035ff99205f
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.12-py3-none-any.whl

Download URL fastllm_claude_code-0.0.12-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de1bdac17aaa3e0a0ebe8d7894ccb562348fd4a83ba3daa84181ac49b0c35c00
BLAKE2b-256 checksum
How to use checksums
f3ca1923d587064308f488faa9c4b8fdd82cc02a6f2d4a6df660150942f81853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

0.0.16

2 release files

This release

0.0.12 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page