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

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.11
File Size Uploaded
fastllm_claude_code-0.0.11.tar.gz 9.9 kB Details

Built distribution (wheel)

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

Total release size: 20.7 kB

Release files / fastllm_claude_code-0.0.11.tar.gz

Download URL fastllm_claude_code-0.0.11.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
78f82fe79ff7866b9b7b4b2ac6549eae5877df42f38f6c2a991968c78a409238
BLAKE2b-256 checksum
How to use checksums
4304fc79e4546fc957fc9171493559d4583db2728bd34a9645f808a8d3db1334
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.11-py3-none-any.whl

Download URL fastllm_claude_code-0.0.11-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa8ea3250ea933cb09d3c05662ac3dce949800621d165ef5fb3a184d45941a48
BLAKE2b-256 checksum
How to use checksums
d43161e2b1df75c4296fd3103672169f5b567963e56a6197786aa6070aa42b5e
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.11 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