Skip to content

Commit 682dcf2

Browse files
author
Francisco
committed
feat(rust): port fc_parser to Rust extension via PyO3
- Add rust/fc_parser/ — new Rust extension alongside delta_normalizer and request_router - Implements parse_function_calls(accumulated_content, assistant_reply) returning List[Dict] — drop-in replacement for the Python hot path - Regex compilation via once_cell::Lazy — compiled once at module load - Handles: <fc> tag scanning, <plan> stripping, JSON repair, smart quote normalisation, trailing comma removal, string-encoded argument unwrapping, batch extraction, loose fallback, ID generation - All 7 tests passing: tests/rust/test_fc_parser.py - Update tool_routing_mixin.py — remove Python parsing implementation, delegate to fc_parser Rust extension in parse_and_set_function_calls() - Remove dead imports: json, re, uuid, FC_REGEX, _normalize_arguments
1 parent 96d408d commit 682dcf2

8 files changed

Lines changed: 1058 additions & 82 deletions

File tree

docker-compose.ollama.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# docker-compose.ollama.yml
2+
#
3+
# Ollama opt-in overlay — local LLM inference via Ollama.
4+
# Can be used independently of vLLM.
5+
#
6+
# USAGE:
7+
# pdavid --mode up --ollama
8+
#
9+
# Or manually:
10+
# docker compose -f docker-compose.yml -f docker-compose.ollama.yml up -d
11+
#
12+
# REQUIREMENTS:
13+
# - NVIDIA GPU with drivers installed
14+
# - NVIDIA Container Toolkit (https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html)
15+
#
16+
# IMAGE PINNING
17+
# ─────────────
18+
# Pinned: 2026-04-04 | ollama: 0.20.0 | See PINNED_IMAGES.md
19+
# NOTE: ollama digest is also present in docker-compose.gpu.yml.
20+
# Update both files when bumping version.
21+
22+
services:
23+
ollama:
24+
# 0.20.0 — upgrade tag to ollama/ollama:0.20.0 on next bump
25+
image: ollama/ollama@sha256:0455f166da85b1d07f694c33ba09278ca649603c0611ba8e46272b16eed7fccd
26+
container_name: ollama
27+
restart: unless-stopped
28+
runtime: nvidia
29+
environment:
30+
- NVIDIA_VISIBLE_DEVICES=all
31+
volumes:
32+
- ollama_data:/root/.ollama
33+
ports:
34+
- "11434:11434"
35+
networks:
36+
- my_custom_network
37+
deploy:
38+
resources:
39+
reservations:
40+
devices:
41+
- driver: nvidia
42+
count: all
43+
capabilities: [gpu]
44+
45+
# Override api to point at the real Ollama internal URL
46+
# instead of the localhost stub in the base compose file.
47+
api:
48+
environment:
49+
- OLLAMA_BASE_URL=http://ollama:11434/v1
50+
depends_on:
51+
ollama:
52+
condition: service_started
53+
54+
volumes:
55+
ollama_data:

0 commit comments

Comments
 (0)