Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, and so do client-owned tool loops: FastLLM replays canonical history after each tool round, and fastclaude continues it in a fresh process.

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. A response containing tool calls ends the turn; execute them and call again with the history extended by their results, as with any completions provider. fastclaude continues that history in a fresh process, so no response id is issued and nothing is held between calls:

first = await acomplete(messages, model='claude_code/claude-sonnet-5', tools=tools)
assert first.tool_calls and first.response_id is None

final = await acomplete(messages_with_results, model='claude_code/claude-sonnet-5', tools=tools)

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.

About

Claude Code API for fastllm

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages